<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.131775.2</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Research Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>Novel Deep Learning Application: Recognizing Inconsistent Characters on Pharmaceutical Packaging</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 2; peer review: 1 approved with reservations, 1 not approved]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Koponen</surname>
                        <given-names>Jarmo</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Data Curation</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Visualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-8963-9315</uri>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Haataja</surname>
                        <given-names>Keijo</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Funding Acquisition</role>
                    <role content-type="http://credit.niso.org/">Project Administration</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Toivanen</surname>
                        <given-names>Pekka</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>School of Computing, Kuopio campus, University of Eastern Finland, Kuopio, Pohjois-Savo, FI-70211, Finland</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:jarmo.koponen@uef.fi">jarmo.koponen@uef.fi</email>
                </corresp>
                <fn fn-type="conflict">
                    <p>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>23</day>
                <month>7</month>
                <year>2024</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2023</year>
            </pub-date>
            <volume>12</volume>
            <elocation-id>427</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>24</day>
                    <month>6</month>
                    <year>2024</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2024 Koponen J et al.</copyright-statement>
                <copyright-year>2024</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/12-427/pdf"/>
            <abstract>
                <sec>
                    <title>Background</title>
                    <p>Machine vision faces significant challenges when applied to text recognition on cardboard packaging particularly due to multiple printing methods, irregular character shapes, and curved packaging surfaces.</p>
                </sec>
                <sec>
                    <title>Methods</title>
                    <p>This research introduces a novel deep learning application for recognizing binarized expiration date and batch code characters printed using multiple printing methods. The method, based on Region-based Convolutional Neural Networks (R-CNN), enables character recognition directly from in the images without the need for extracting handcrafted features. In detail, this approach performs character recognition by using the whole image as input, extracting and learning salient character features directly from the packaging surface images.</p>
                </sec>
                <sec>
                    <title>Results</title>
                    <p>The R-CNN model, with a precision of 91.1% and an F1 score of 80.9%, effectively recognizes manufacturing markings on pharmaceutical packages, with inconsistencies in the characters&#x2019; shapes. In a comparative experiment using the same dataset of images, the R-CNN model significantly outperformed Tesseract OCR, achieving much higher precision, recall, and F1 scores.</p>
                </sec>
                <sec>
                    <title>Conclusions</title>
                    <p>The results of this study reveal that the deep learning method outperforms the well-established optical character recognition method in recognizing text characters printed with different printing methods. Presented in this study, the deep learning method recognizes text characters with high precision. It is also suitable for recognizing text printed on curved surfaces, provided proper preprocessing is applied. The problem investigated in the study differs from previous research in the field, focusing on the recognition of texts printed with different printing methods. The research thus fills a gap in text recognition that existed in the research of the field. Furthermore, the study presents new ideas that will be utilized in our future research.</p>
                </sec>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>Text recognition</kwd>
                <kwd>Machine Vision</kwd>
                <kwd>Deep Learning</kwd>
                <kwd>Regions with Convolutional Neural Networks</kwd>
                <kwd>R-CNN</kwd>
                <kwd>Character Recognition</kwd>
                <kwd>Printing Methods</kwd>
                <kwd>Expiration Date</kwd>
                <kwd>Batch Codes</kwd>
                <kwd>Handcrafted Features</kwd>
                <kwd>Image Recognition</kwd>
                <kwd>Multi-Object Recognition</kwd>
                <kwd>OCR</kwd>
                <kwd>Tesseract OCR</kwd>
                <kwd>Precision</kwd>
                <kwd>Recall</kwd>
                <kwd>Accuracy</kwd>
                <kwd>F-Measure</kwd>
                <kwd>Curved Surfaces</kwd>
                <kwd>Preprocessing</kwd>
            </kwd-group>
            <funding-group>
                <funding-statement>The author(s) declared that no grants were involved in supporting this work.</funding-statement>
            </funding-group>
        </article-meta>
        <notes>
            <sec sec-type="version-changes">
                <label>Revised</label>
                <title>Amendments from Version 1</title>
                <p>The title has been revised from "new method" to "new application." The English language usage has been improved. Details about the role of AlexNet in the method have been added to the method description. AlexNet has been included in the description of the Region CNN method. The performance curves of obtained over all threshold values &#x200b;&#x200b;have been added. The key performance metrics have been updated to be more relevant for text character performance measurement.</p>
            </sec>
        </notes>
    </front>
    <body>
        <sec id="sec1" sec-type="intro">
            <title>Introduction</title>
            <p>By the end of 2023, the market value of the pharmaceutical packaging sector is expected to reach USD 101 billion.
                <sup>
                    <xref ref-type="bibr" rid="ref1">1</xref>
                </sup> Recognizing product codes using machine vision enables the storage and processing of package-specific manufacturing data, as well as the electronic search and extraction of codes and dates, which is important in the development of intelligent product handling systems.</p>
            <p>Cardboard is typically used in pharmaceutical product packaging. Boxes made of cardboard have curved surfaces. When accurate text recognition of text printed on surfaces is needed using 2D machine vision, the curvature is a difficulty in itself as it causes uneven illumination of the packaging surface as presented in 
                <xref ref-type="fig" rid="f1">Figure 1</xref>. Several printing methods are used to print the expiration date and manufacturing batch codes that are important for the usage and handling of pharmaceutical packages. Changes in physical conditions in package imaging as well as printing methods producing low-contrast and irregularly shaped characters make code recognition more challenging. The recognition process is especially challenging because there are many variants in the codes used on various packages using different printing methods, as well as variances in the codes&#x2019; forms, structures, regularity, and colors. In the past ten years, product code recognition techniques have advanced, and several researchers have become more interested in this area of study.</p>
            <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                <label>Figure 1. </label>
                <caption>
                    <title>Two cardboard pharmaceutical packages with the expiration date and batch codes printed on the curved packaging surfaces.</title>
                </caption>
                <graphic id="gr1" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/168145/93191b0b-ca3b-4617-89fb-727dfb488ee1_figure1.gif"/>
            </fig>
            <p>The purpose of this research is to demonstrate that, despite difficulties in the field, text characters with imperfections and inconsistencies in their forms on pharmaceutical packaging can be accurately recognized using appropriate pre-processing and deep learning techniques. In the experimental part of the study, a deep learning model trained on a real-life image set was used to evaluate the recognition of dot matrix and ink-printed characters, employing three key metrics: True Positives (TP), False Positives (FP), and False Negatives (FN). Subsequently, the performance of this deep learning model was compared with that of the Tesseract OCR method using the same metrics relevant for text characters recognition. It is important to note that information related to expiration dates and manufacturing batch codes on pharmaceutical packages is important for safety and must be accurate and reliable. The rest of the paper is organized as follows: the next section discusses related work found in the literature. The next section details the approach to using deep learning for recognizing manufacturing marking texts on pharmaceutical packaging. Then deep learning with focus on R-CNN and using it for expiration date and batch codes recognition is presented in the extent to which it serves this research work. Analysis of experimental results is then presented and finally, the conclusion and future works are presented in the final section.</p>
            <sec id="sec1.1">
                <title>Related works</title>
                <p>Optical character recognition (OCR) for document images is a well-studied field.
                    <sup>
                        <xref ref-type="bibr" rid="ref3">2</xref>
                    </sup> In OCR, characters are recognized by comparing groups of pixels detected in the source image with the model patterns that the system has been trained on. OCR software is used for the recognition of manufacturing markings printed on product surfaces where it is highly effective at recognizing regularly shaped characters with good contrast against a simple background.
                    <sup>
                        <xref ref-type="bibr" rid="ref2">3</xref>
                    </sup> Product text recognition is performed on digital images produced by an imaging system that captures energy reflected from the product surface in the scene onto its image plane.
                    <sup>
                        <xref ref-type="bibr" rid="ref2">3</xref>
                    </sup> Varying positions and orientations of the text in the camera scene, changes in illumination on the package surface, low contrast between text and background, irregular fonts, and motion blur of images acquired from moving packages reduces the usability of OCR methods in this high-accuracy task.
                    <sup>
                        <xref ref-type="bibr" rid="ref2">3</xref>
                    </sup> Tesseract OCR is a widely used open-source optical character recognition program. It has been in use since 1985 and has evolved significantly throughout the years. Over time, Tesseract OCR has changed. Numerous languages are supported, image binarization is included, and Tesseract 4 added an OCR engine with a long short-term memory (LSTM)-based neural network, which process an input image line by line into boxes and then feeds them to the LSTM network, which produces the recognition result.
                    <sup>
                        <xref ref-type="bibr" rid="ref4">4</xref>
                    </sup>
                </p>
                <p>The capability of different methods to recognize product texts printed with irregular characters on product packaging varies.
                    <sup>
                        <xref ref-type="bibr" rid="ref2">3</xref>
                    </sup> Detecting text as binary large objects using K-nearest neighborhood (KNN) classification
                    <sup>
                        <xref ref-type="bibr" rid="ref15">5</xref>
                    </sup> for opaque labels, and traditional OCR methods
                    <sup>
                        <xref ref-type="bibr" rid="ref16">6</xref>
                    </sup> for consumer product cardboard packages have difficulties in recognizing irregular fonts. Although these techniques are fundamental, they often struggle to adapt to the diverse real-life conditions. Gabor filter-based methods,
                    <sup>
                        <xref ref-type="bibr" rid="ref17">7</xref>
                    </sup>
                    <sup>,</sup>
                    <sup>
                        <xref ref-type="bibr" rid="ref18">8</xref>
                    </sup> are robust against variations in surface shapes and uneven illumination, but face challenges in recognizing irregular characters, emphasizing the difficulty of adapting to them. A Histograms of Oriented Gradients (HOG) feature-based neural network,
                    <sup>
                        <xref ref-type="bibr" rid="ref19">9</xref>
                    </sup> with an imaging environment with multi-directional illumination of the package surface and sub-images fusing alleviates problems related to low contrast and uneven illumination. However, methods performance on irregular font shapes and motion blur is still limited. In controlled imaging environments, deep learning methods, integrating Connectionist Text Proposal Neural Network (CTPN) for text area detection and capsule network (CapsNet) text recognition,
                    <sup>
                        <xref ref-type="bibr" rid="ref20">10</xref>
                    </sup> tolerate packaging surface shape changes, uneven packaging surface illumination, and motion blur. The method is capable of handling character irregularities, including irregular fonts. The integration of two deep learning neural network methods, FCN, and R-CNN
                    <sup>
                        <xref ref-type="bibr" rid="ref21">11</xref>
                    </sup> and Faster-CNN and LeNet DNN,
                    <sup>
                        <xref ref-type="bibr" rid="ref22">12</xref>
                    </sup> effectively detects and recognizes text in various food and beverage packaging, even with irregular fonts. The method, as is possible for deep learning text recognition, directly detects and learns the most important characters features directly from source images, enabling generalization to various conditions, such as irregular characters, which pose challenges to traditional pattern-matching-based text recognition techniques.</p>
            </sec>
        </sec>
        <sec id="sec2" sec-type="methods">
            <title>Methods</title>
            <p>This research focuses on using deep learning to recognize manufacturing marking texts printed on pharmaceutical packaging surfaces, which contain irregularities in character shapes. Previously, our research into recognizing manufacturing markings on cardboard pharmaceutical packages led to the development and introduction of a novel method for binarizing texts on curved packaging surfaces.
                <sup>
                    <xref ref-type="bibr" rid="ref23">13</xref>
                </sup> This method employs source images acquired in a controlled imaging environment, enabling the accurate and robust binarization of texts while effectively addressing challenges associated with surface curvature. The text recognition ability of the trained R-CNN model is first evaluated using three key metrics. Additionally, the performance of this deep learning network for text recognition is compared with Tesseract OCR, using the same three key criteria. Text recognition of texts pressed without ink, stamped, or laser printed is excluded from the study. In the experimental recognition tests, we used a set of images of a Finnish health technology company taken from real medical packages, with dot matrix printed and pressed ink-marked texts. The study&#x2019;s text recognition was performed on the packaging production batch and expiration date markings, and titles. An example of the binarized images used for text recognition is shown in 
                <xref ref-type="fig" rid="f2">Figure 2</xref>. In the experimental tests, real pharmaceutical packages have been used to ensure that the results of our research are reliable. Since the text recognition of pharmaceutical packages is a new area of research, the number of source images was limited. However, this limitation is only temporary, and research will continue as more source images become available.</p>
            <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                <label>Figure 2. </label>
                <caption>
                    <title>Batch code and expiration date texts in a binarized images printed with a pressed ink-marked (left) and with the dot matrix printing methods.</title>
                </caption>
                <graphic id="gr2" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/168145/93191b0b-ca3b-4617-89fb-727dfb488ee1_figure2.gif"/>
            </fig>
            <sec id="sec2.1">
                <title>Deep Learning</title>
                <p>Deep Learning (DL) is a subset of machine learning in which neural networks are used to learn from data and generate predictions or choices. It is described as a method of teaching a computer to learn from data and make predictions or judgments using neural networks, much like a child does. Deep Learning can be used for a variety of tasks, including image classification, object detection, speech recognition, and natural language processing, because of its ability to interpret and analyze complex patterns in data.</p>
            </sec>
            <sec id="sec2.2">
                <title>Regions with CNN features (R-CNN)</title>
                <p>In the paper &#x2018;Rich feature hierarchies for accurate object detection and semantic segmentation,&#x2019; Girshick, Ross, et al.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup> introduce an original R-CNN method for object detection from images, based on the use of region proposals. The paper details the operation of the detection layer, offering insights on how high-capacity convolutional neural networks (CNNs) are applied to bottom-up region proposals to localize and segment objects. It also discusses the strategy of using supervised pre-training for an auxiliary task when labeled training data is scarce, followed by domain-specific fine-tuning, which yields a significant performance boost.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                </p>
                <p>The object detection algorithm in the Region CNN model is based on using high-capacity convolutional neural networks to find and segment objects in a bottom-up manner. Training the CNN model with a limited labeled training set is achieved by training in two steps: first with supervised learning using a large dataset, and then fine-tuned with a targeted, limited dataset.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                </p>
                <p>In Region-CNN, the selective search method is used to produce region proposals. Selective search segments the image into multiple parts at various scales, iteratively combining these segments based on similarities in color, texture, or size, generating region proposals for potential object locations in the image. This process results in hundreds of region proposal areas (ROIs) from the image that potentially contain objects. Each region proposals area is scaled to a fixed size and fed into a convolutional network, which extracts features and classifies the regions. CNN uses a trained model to predict whether each area contains an object and, if so, which class of object it is. The output layer of the area CNN contains a classification layer (Classification Layer), which predicts the class of each region proposals. This layer produces probabilities that a given region belongs to a class defined in the training data. The Bounding Box Regression Layer produces adjustment values for the bounding boxes of the region proposals, allowing the creation of accurate, class-specific bounding boxes. By combining the results of these two layers, Region-CNN produces class-specific bounding boxes that are more accurate than the original region proposals.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                </p>
                <p>As a result, Region-CNN produces a set of bounding boxes classified according to objects, along with confidence scores for each detection. This information allows determining the location of the object in the image as well as their classes. In multi-object detection, the Region-CNN model handles multiple classes and area proposals, with separate SVM classifiers for each area. Each area proposal found by the selective search method (Region Proposal) is scaled and fed into a CNN, which extracts its features. These features are then fed into each SVM classifier, each trained to recognize one class. Class-specific score values: Each SVM produces a score value that reflects its confidence that the particular area belongs to the class it represents. Thus, for example, if the model has 20 classes, each area receives 20 score values, one from each SVM. Class selection based on score values: After obtaining the score values for each region from all SVM classifiers, R-CNN selects the class with the highest score for the given region as the final classification. Each region is assigned the class that the model predicts is most likely in that location.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                </p>
                <p>Non-Maximum Suppression (NMS): Since many region proposals may overlap with the same object, R-CNN uses a non-maximum suppression method to prune overlapping proposals. From each group of overlapping regions, the NMS selects the one with the highest point value and discards the others. Ensuring that each object detected is represented in the results only once according to the proposal with the highest score. Result: The result is a set of bounding boxes, each classified into the class with the highest score for that area, with overlaps pruned by NMS. This enables the identification and classification of multiple objects from the same image.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                </p>
                <p>The R-CNN model allows for accurate and efficient multi-object detection. The model classifies each proposed area into the class that receives the highest score from the separate SVM classifiers. Each area is assigned the class it most likely belongs to, allowing for the reliable detection of multiple objects from the same image.
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                </p>
            </sec>
            <sec id="sec2.3">
                <title>R-CNN for expiration date and batch codes recognition</title>
                <p>In text character recognition, Regions with Convolutional Neural Networks (R-CNN) architecture combine rectangular region proposals with convolutional neural network features for character detection and classification. As illustrated in 
                    <xref ref-type="fig" rid="f3">Figure 3</xref>, the process initiated by extracting multiple region proposals from the source image using the method of selective search (
                    <xref ref-type="fig" rid="f3">Figure 3a</xref>). Each proposed region, potentially containing text, is sent on to the convolution neural network to create a fixed-size feature vector ( 
                    <xref ref-type="fig" rid="f3">Figure 3b</xref>). This feature vector serves as the input to a set of linear SVMs that are trained to classify character classes, producing initial classification ( 
                    <xref ref-type="fig" rid="f3">Figure 3c</xref>). Detection is further refined using a bounding box refinement layer, which adjusts the coordinates of each proposed bounding box to better align with the actual text characters in the image (
                    <xref ref-type="fig" rid="f3">Figure 3d</xref>).
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup>
                    <sup>,</sup>
                    <sup>
                        <xref ref-type="bibr" rid="ref7">15</xref>
                    </sup>
                </p>
                <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                    <label>Figure 3. </label>
                    <caption>
                        <title>Region-CNN model working principle.</title>
                    </caption>
                    <graphic id="gr3" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/168145/93191b0b-ca3b-4617-89fb-727dfb488ee1_figure3.gif"/>
                </fig>
                <p>R-CNN&#x2019;s training process, which combines a large, pre-trained network with a smaller, domain-specific network for fine-tuning, is well-suited for handling the limited datasets and complex labels typical of cardboard pharmaceutical packaging.</p>
            </sec>
            <sec id="sec2.4">
                <title>Training details</title>
                <p>The dataset utilized for training the model contains 27 binarized source images: 16 with dot matrix characters and 11 with pressed, and ink-marked characters. With these images, the model was trained to recognize characters with inconsistencies in their shapes due to the different printing methods used on pharmaceutical packaging. The images were resized to fit the input size of 227 &#x00d7; 227 pixels to fit the input requirements of the pre-trained AlexNet model. The deep learning model employs a dual architecture, combining AlexNet and a region-based convolutional neural network (R-CNN). AlexNet, pre-trained on a large-scale image dataset, serves as a native feature extractor. In this setup, source images resized to 227 &#x00d7; 227 pixels undergo convolution-based feature extraction. This model follows the method proposed by Ross Girshick et al.,
                    <sup>
                        <xref ref-type="bibr" rid="ref8">14</xref>
                    </sup> utilizing high-capacity CNNs for generating detailed region proposals to accurately locate and segment objects. Training was conducted using stochastic gradient descent with momentum optimization, starting with a learning rate of 1e-4, which was reduced by 0.02 after every eighth epoch to improve convergence. Other training parameters include 400 epochs and a mini-batch size of 58. The final layers of AlexNet were modified to match the number of 43 different object classes in the training dataset. To prevent network overfitting, data augmentation techniques such as rotations, scaling and translations were used. These augmented images were then used to train the Region-CNN, fine-tuning it for the specific tasks of detecting and recognizing varied text character features of pharmaceutical packaging. The dataset was randomly divided into a 70% training and 30% validation split for training and thorough validation. This method utilizes both AlexNet&#x2019;s strengths for extensive initial learning and R-CNN&#x2019;s strengths for targeted fine-tuning.</p>
            </sec>
            <sec id="sec2.4.1">
                <title>Key metrics for evaluating text character recognition models</title>
                <p>In the evaluation of text recognition models, such as R-CNN, the most important metrics are True Positives (TP), False Positives (FP), and False Negatives (FN). In this domain True Negatives (TN) are not considered in the evaluation process as the concept of &#x2018;non-character&#x2019; regions is inapplicable.
                    <sup>
                        <xref ref-type="bibr" rid="ref24">16</xref>
                    </sup> IoU (Intersection over Union) is a common object detection evaluation metric. IoU measures the overlap between the ground truth boundary box and the boundary box detected by the algorithm.
                    <sup>
                        <xref ref-type="bibr" rid="ref11">17</xref>
                    </sup> IoU, as defined in 
                    <xref ref-type="disp-formula" rid="e1">Equation (1)</xref>, is calculated as the area of overlap between the ground truth bounding box and the predicted bounding box divided by the area of the union of these two.
                    <sup>
                        <xref ref-type="bibr" rid="ref11">17</xref>
                    </sup>
                    <disp-formula id="e1">
                        <mml:math display="block">
                            <mml:mi mathvariant="italic">IoU</mml:mi>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mtext>Area of Overlap</mml:mtext>
                                <mml:mtext>Area of Union</mml:mtext>
                            </mml:mfrac>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mrow>
                                    <mml:mtext>area</mml:mtext>
                                    <mml:mspace width="0.25em"/>
                                    <mml:mfenced close=")" open="(">
                                        <mml:mrow>
                                            <mml:mtext>ground truth bounding</mml:mtext>
                                            <mml:mspace width="0.25em"/>
                                            <mml:mi>box</mml:mi>
                                            <mml:mo>&#x2229;</mml:mo>
                                            <mml:mtext>predicted bounding</mml:mtext>
                                            <mml:mspace width="0.25em"/>
                                            <mml:mi>box</mml:mi>
                                        </mml:mrow>
                                    </mml:mfenced>
                                </mml:mrow>
                                <mml:mrow>
                                    <mml:mtext>area</mml:mtext>
                                    <mml:mspace width="0.25em"/>
                                    <mml:mfenced close=")" open="(">
                                        <mml:mrow>
                                            <mml:mtext>ground truth bounding</mml:mtext>
                                            <mml:mspace width="0.25em"/>
                                            <mml:mi>box</mml:mi>
                                            <mml:mo>&#x222a;</mml:mo>
                                            <mml:mtext>predicted bounding</mml:mtext>
                                            <mml:mspace width="0.25em"/>
                                            <mml:mi>box</mml:mi>
                                        </mml:mrow>
                                    </mml:mfenced>
                                </mml:mrow>
                            </mml:mfrac>
                        </mml:math>
                        <label>(1)</label>
                    </disp-formula>
                </p>
                <p>Positive samples are used in object recognition for supervised learning models, such as R-CNN&#x2019;s application for text recognition, where the model classifies different areas as containing text. After training and testing, the sample group in such scenarios can be classified into three main states, as shown in 
                    <xref ref-type="table" rid="T1">Table 1</xref>.
                    <sup>
                        <xref ref-type="bibr" rid="ref12">18</xref>
                    </sup>
                </p>
                <table-wrap id="T1" orientation="portrait" position="float">
                    <label>Table 1. </label>
                    <caption>
                        <title>Prediction result of the sample set.</title>
                    </caption>
                    <table content-type="article-table" frame="hsides">
                        <thead>
                            <tr>
                                <th align="left" colspan="1" rowspan="1" valign="top"/>
                                <th align="left" colspan="1" rowspan="1" valign="top">Actual positive</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Actual negative</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">Predicted positive</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">True positives (TP)</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">False positives (FP)</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">Predicted negative</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">False negatives (FN)</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">(Not applicable)</td>
                            </tr>
                        </tbody>
                    </table>
                </table-wrap>
                <p>Positive samples may create the following scenarios:
                    <list list-type="order">
                        <list-item>
                            <label>1.</label>
                            <p>TP (true positive), in which a region is correctly identified by the model as containing text, IoU &#x2265; &#x03b1;.</p>
                        </list-item>
                        <list-item>
                            <label>2.</label>
                            <p>FN (false negative), in which model fails to detect text region that is actually present.</p>
                        </list-item>
                    </list>
                </p>
                <p>Negative samples, which are areas not containing text can create the following scenario:
                    <list list-type="order">
                        <list-item>
                            <label>3.</label>
                            <p>The detector determines FP (false positive), in which the model identifies a region without text as containing text, IoU &lt; &#x03b1;.</p>
                        </list-item>
                    </list>
                </p>
                <p>These formulas are used to calculate precision and recall:</p>
                <p>Precision is the proportion of all correctly retrieved samples (TP) that account for all retrieved samples (TP + FP).
                    <sup>
                        <xref ref-type="bibr" rid="ref12">18</xref>
                    </sup> Its equation is, as given in 
                    <xref ref-type="disp-formula" rid="e2">(2)</xref>:
                    <disp-formula id="e2">
                        <mml:math display="block">
                            <mml:mtext>Precision</mml:mtext>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mi>TP</mml:mi>
                                <mml:mrow>
                                    <mml:mi>TP</mml:mi>
                                    <mml:mo>+</mml:mo>
                                    <mml:mi>FP</mml:mi>
                                    <mml:mspace width="0.25em"/>
                                </mml:mrow>
                            </mml:mfrac>
                            <mml:mspace width="0.25em"/>
                        </mml:math>
                        <label>(2)</label>
                    </disp-formula>
                </p>
                <p>The recall is the proportion of all correctly retrieved samples (TP) that accounts for all objects that should be retrieved (TP + FN).
                    <sup>
                        <xref ref-type="bibr" rid="ref12">18</xref>
                    </sup> Its equation is, as given in 
                    <xref ref-type="disp-formula" rid="e3">(3)</xref>:
                    <disp-formula id="e3">
                        <mml:math display="block">
                            <mml:mtext>Recall</mml:mtext>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mi>TP</mml:mi>
                                <mml:mrow>
                                    <mml:mi>TP</mml:mi>
                                    <mml:mo>+</mml:mo>
                                    <mml:mi>FN</mml:mi>
                                    <mml:mspace width="0.25em"/>
                                </mml:mrow>
                            </mml:mfrac>
                        </mml:math>
                        <label>(3)</label>
                    </disp-formula>
                </p>
                <p>The F1 Score, as defined in 
                    <xref ref-type="disp-formula" rid="e4">Eq (4)</xref>, is the weighted harmonic average of precision and recall.
                    <sup>
                        <xref ref-type="bibr" rid="ref12">18</xref>
                    </sup>
                    <disp-formula id="e4">
                        <mml:math display="block">
                            <mml:mtext>F&#x2010;Measure</mml:mtext>
                            <mml:mo>=</mml:mo>
                            <mml:mfrac>
                                <mml:mrow>
                                    <mml:mn>2</mml:mn>
                                    <mml:mo>&#x2217;</mml:mo>
                                    <mml:mfenced close=")" open="(">
                                        <mml:mrow>
                                            <mml:mtext>Precision</mml:mtext>
                                            <mml:mo>&#x2217;</mml:mo>
                                            <mml:mtext>Recall</mml:mtext>
                                        </mml:mrow>
                                    </mml:mfenced>
                                </mml:mrow>
                                <mml:mrow>
                                    <mml:mtext>Precision</mml:mtext>
                                    <mml:mo>+</mml:mo>
                                    <mml:mtext>Recall</mml:mtext>
                                </mml:mrow>
                            </mml:mfrac>
                        </mml:math>
                        <label>(4)</label>
                    </disp-formula>
                </p>
            </sec>
        </sec>
        <sec id="sec3" sec-type="results">
            <title>Results</title>
            <p>The experiments aimed to evaluate the recognition accuracy of the deep learning method for text recognition, using images of real-world pharmaceutical packages. The experiments were carried out on available dot matrix printed and ink-marked texts. The recognition results were achieved by comparing the from test image set to the ground truth data.</p>
            <sec id="sec3.1">
                <title>R-CNN evaluation in MATLAB</title>
                <p>At first, the text recognition performance of the R-CNN model was analyzed using a dataset and evaluated using Precision, Recall, and F1 scores. Functions measure the performance of a multi-object detector. The precision metric considers both the number of correctly recognized characters and the number of incorrectly recognized characters. Recall determines the ability of the model to correctly recognize all characters in the image, considering both correctly recognized and those that fail to be recognized. The F1 Score combines precision and recall into a single metric, balancing the rate of correctly recognized characters with the model&#x2019;s ability to recognize all characters in an image, encompassing both precise recognitions and any missed characters. 
                    <xref ref-type="fig" rid="f4">Figure 4</xref> illustrates the results of the proposed text recognition model&#x2019;s precision (top), recall (middle), and F1 Score (bottom) at varying thresholds.</p>
                <fig fig-type="figure" id="f4" orientation="portrait" position="float">
                    <label>Figure 4. </label>
                    <caption>
                        <title>Results of the proposed text recognition model&#x2019;s precision (top), recall (middle), and F1 Score (bottom) at varying thresholds.</title>
                    </caption>
                    <graphic id="gr4" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/168145/93191b0b-ca3b-4617-89fb-727dfb488ee1_figure4.gif"/>
                </fig>
                <p>The results in the graph where threshold values are determined by the overlap between the bounding boxes produced by the model and the ground truth, show that the model&#x2019;s precision remains high across different IoU thresholds. A decreasing recall at higher IoU thresholds indicates the model&#x2019;s increasing specificity at the expense of sensitivity. The F1 score, a combination of precision and recall, reaches its optimal score at an IoU threshold of 0.6. This threshold indicates the most balanced performance between detecting true positives and avoiding false positives, highlighting the model&#x2019;s accuracy in distinguishing relevant text characters from background in complex image datasets.</p>
            </sec>
            <sec id="sec3.1.1">
                <title>Comparison to Tesseract OCR</title>
                <p>In the second experiment, both the R-CNN deep learning model and Tesseract OCR were used to recognize text characters from the same data set. Initially, the total number of characters in each image was counted. The performance evaluation included counting the number of characters that were correctly identified, incorrectly recognized, unrecognized, and those identified more than once. This provided detailed insights into the character recognition accuracy of each method. Notably, the threshold value (&#x03b1;) for the R-CNN model was set to 0.99 to compare its recognition precision against the widely used Tesseract OCR.</p>
                <p>Using the same three metrics as in the previous experiment, the text character recognition performance of the R-CNN deep learning model and the Tesseract OCR algorithms is compared in 
                    <xref ref-type="table" rid="T2">Table 2</xref>, with the targets being characters printed on the images.</p>
                <table-wrap id="T2" orientation="portrait" position="float">
                    <label>Table 2. </label>
                    <caption>
                        <title>Text recognition performance comparison table based on three metrics.</title>
                    </caption>
                    <table content-type="article-table" frame="hsides">
                        <thead>
                            <tr>
                                <th align="left" colspan="1" rowspan="1" valign="top"/>
                                <th align="left" colspan="1" rowspan="1" valign="top">Region-CNN (%)</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Tesseract OCR (%)</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">Precision</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">91.1</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">38.3</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">Recall</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">72.7</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">61.3</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">F1 Score</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">80.9</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">47.1</td>
                            </tr>
                        </tbody>
                    </table>
                </table-wrap>
                <p>The comparison reveals that the Region-CNN model achieved a precision of 91.1%, whereas the OCR method&#x2019;s precision was 38.3%, indicating significantly fewer false positive detections by the Region-CNN model. The recall value of 72.7% indicates that the R-CNN model correctly identifies a significant portion of the characters on pharmaceutical packaging. However, fails to recognize 27.3% of the characters, meaning false negatives. OCR&#x2019;s recall value of 61.3% to recognize manufacturing markings characters of images on pharmaceutical packages means about 38.7% of the appropriate markings remain unrecognized. The R-CNN model, with an F1 score of 80.9, accurately identifies a high percentage of characters (demonstrating high precision) and efficiently covers a significant proportion of all characters available in the dataset (indicating high recall).</p>
                <p>The deep learning model has much higher accuracy and recall ratings. By balancing these factors, the F1 Score illustrates the amount better the model was in this test. In specific, the deep learning model shows to be a better text recognition method, especially able to precisely recognize characters containing more irregular shapes. 
                    <xref ref-type="fig" rid="f5">Figure 5</xref> illustrates the results of text recognition using the Region-CNN method.</p>
                <fig fig-type="figure" id="f5" orientation="portrait" position="float">
                    <label>Figure 5. </label>
                    <caption>
                        <title>The result of deep text recognition in the whole image.</title>
                        <p>Left: recognized printed ink-marked packaging text. Right: recognized dot matrix printed packaging text.</p>
                    </caption>
                    <graphic id="gr5" orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/168145/93191b0b-ca3b-4617-89fb-727dfb488ee1_figure5.gif"/>
                </fig>
            </sec>
        </sec>
        <sec id="sec4" sec-type="conclusions">
            <title>Conclusions</title>
            <p>In this paper, a novel application of deep learning for text recognition on pharmaceutical packages is presented. A method combining a pretrained Convolutional Neural Network (CNN) with Region-based CNN (R-CNN) is employed for comprehensive feature extraction from each proposed character region. This approach has achieved promising results in the recognition of manufacturing markings and texts with inconsistent character shapes.</p>
            <p>Various methods for recognizing text printed on products have been developed. Commercial OCR engines are available that can recognize high-contrast regularly shaped texts printed on flat surfaces. In the industry, large amounts of perishable food and pharmaceutical packages are produced daily, and the texts printed on their surface are read by people several times during the operation. Text is printed on product surfaces using various printing methods to achieve cost-effective production. The pharmaceutical industry employs various printing methods, such as laser printing, pressed without ink, and pressed with ink, resulting in consistent character shapes. However, characters printed using dot matrix and manual stamping methods may have inconsistencies in their character shapes. In places where pharmaceutical product packaging is handled, such as pharmacies and drug storage facilities, where it is essential to recognize texts printed with various methods, a targeted method is required.</p>
            <p>We compare the text recognition performance obtained using a Tesseract OCR and R-CNN based method with real-life pharmaceutical packaging in this study. We find that the deep learning method produces highly accurate recognition results that completely outperform the results obtained using a Tesseract OCR, indicating the limitations of optical text recognition for the research&#x2019;s text recognition needs.</p>
            <p>Although text recognition for pharmaceutical packaging texts printed with different methods is an essential task, it is still in its early stages due to the limited availability of source images of actual pharmaceutical packages for research purposes.</p>
            <p>To the best of our knowledge, this is the first study in which deep learning is used to recognize inconsistencies in texts printed using different printing methods. We are confident that with more training data, the proposed method&#x2019;s performance would increase even more.</p>
            <p>In the following study, we focus on the domain-specific contextual processing of recognized text characters. This results in a three-phase text recognition pipeline targeted at recognizing manufacturing markings on pharmaceutical packaging. With this approach, we improve the understanding of how deep learning can be applied in this field.</p>
        </sec>
        <sec id="sec5">
            <title>Data availability</title>
            <sec id="sec6">
                <title>Underlying data</title>
                <p>Open Scientific Framework: The underlying data for A R-CNN deep learning method for recognizing texts printed with multiple different printing methods, 
                    <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.17605/OSF.IO/MP3RB">https://doi.org/10.17605/OSF.IO/MP3RB</ext-link>.
                    <sup>
                        <xref ref-type="bibr" rid="ref13">19</xref>
                    </sup>
                </p>
                <p>This project contains the following underlying data:
                    <list list-type="bullet">
                        <list-item>
                            <label>&#x2022;</label>
                            <p>R-CNN text recognition methods source code for the Octave software.</p>
                        </list-item>
                        <list-item>
                            <label>&#x2022;</label>
                            <p>RCNN and OCR recognition methods metrics spreadsheet.xlsx (An Excel spreadsheet containing the achieved recognition results).</p>
                        </list-item>
                    </list>
                </p>
                <p>Data are available under the terms of the 
                    <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons Zero &#x201c;No rights reserved&#x201d; data waiver</ext-link> (CC0 1.0 Public domain dedication).</p>
            </sec>
        </sec>
    </body>
    <back>
        <ref-list>
            <title>References</title>
            <ref id="ref1">
                <label>1</label>
                <mixed-citation publication-type="other">
                    <collab>Global Packaging Market Size</collab>.<year>2020</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.marketwatch.com/press-release/pharmaceutical-packaging-market-current-scenario-and-future-aspect-analysis-with-top-countries-data-2023-02-25">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref3">
                <label>2</label>
                <mixed-citation publication-type="other">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Althobaiti</surname>
                            <given-names>H</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Lu</surname>
                            <given-names>C</given-names>
                        </name>
</person-group>:
                    <article-title>A survey on Arabic optical character recognition and an isolated handwritten Arabic character recognition algorithm using encoded freeman chain code.</article-title>
                    <source>

                        <italic toggle="yes">Paper presented at the 2017 51st Annual Conference on Information Sciences and Systems, CISS 2017.</italic>
</source>
                    <year>2017</year>.</mixed-citation>
            </ref>
            <ref id="ref2">
                <label>3</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Koponen</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Haataja</surname>
                            <given-names>K</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Toivanen</surname>
                            <given-names>P</given-names>
                        </name>
</person-group>:
                    <article-title>Recent advancements in machine vision methods for product code recognition: A systematic review.</article-title>
                    <source>

                        <italic toggle="yes">F1000Res.</italic>
</source>
                    <year>2022</year>;<volume>11</volume>(<issue>1099</issue>):<fpage>1099</fpage>.
                    <pub-id pub-id-type="doi">10.12688/f1000research.124796.1</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref4">
                <label>4</label>
                <mixed-citation publication-type="other">
                    <article-title>Tesseract User Manual|tessdoc (tesseract-ocr.github.io).</article-title>
                </mixed-citation>
            </ref>
            <ref id="ref15">
                <label>5</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Mishra</surname>
                            <given-names>RK</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Jain</surname>
                            <given-names>P</given-names>
                        </name>
</person-group>:
                    <article-title>A system on chip based serial number identification using computer vision. Paper presented at the 2016 IEEE International Conference on Recent Trends in Electronics, Information and Communication Technology.</article-title>
                    <source>

                        <italic toggle="yes">RTEICT 2016-Proceedings.</italic>
</source>
                    <year>2016</year>: pp.<fpage>278</fpage>&#x2013;<lpage>283</lpage>.</mixed-citation>
            </ref>
            <ref id="ref16">
                <label>6</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Peng</surname>
                            <given-names>E</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Peursum</surname>
                            <given-names>P</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Li</surname>
                            <given-names>L</given-names>
                        </name>
</person-group>:
                    <article-title>Product barcode and expiry date detection for the visually impaired using a smartphone. Paper presented at the 2012 International Conference on Digital Image Computing Techniques and Applications.</article-title>
                    <source>

                        <italic toggle="yes">DICTA</italic>
</source>
                    <year>2012</year>:<fpage>2012</fpage>.</mixed-citation>
            </ref>
            <ref id="ref17">
                <label>7</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Zaafouri</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Sayadi</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Fnaiech</surname>
                            <given-names>F</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>A new method for expiration code detection and recognition using gabor features based collaborative representation.</article-title>
                    <source>

                        <italic toggle="yes">Adv. Eng. Inform.</italic>
</source>
                    <year>2015</year>;<volume>29</volume>(<issue>4</issue>):<fpage>1072</fpage>&#x2013;<lpage>1082</lpage>.</mixed-citation>
            </ref>
            <ref id="ref18">
                <label>8</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Zaafouri</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Sayadi</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Fnaiech</surname>
                            <given-names>F</given-names>
                        </name>
</person-group>:
                    <article-title>A vision approach for expiry date recognition using stretched gabor features.</article-title>
                    <source>

                        <italic toggle="yes">Int. Arab. J. Inf. Technol.</italic>
</source>
                    <year>2015</year>;<volume>12</volume>(<issue>5</issue>):<fpage>448</fpage>&#x2013;<lpage>455</lpage>.</mixed-citation>
            </ref>
            <ref id="ref19">
                <label>9</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Xiang</surname>
                            <given-names>Z</given-names>
                        </name>

                        <name name-style="western">
                            <surname>You</surname>
                            <given-names>Z</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Qian</surname>
                            <given-names>M</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Metal stamping character recognition algorithm based on multi-directional illumination image fusion enhancement technology.</article-title>
                    <source>

                        <italic toggle="yes">EURASIP J. Image Video Process.</italic>
</source>
                    <year>2018</year>;<volume>2018</volume>(<issue>1</issue>).
                    <pub-id pub-id-type="doi">10.1186/s13640-018-0321-7</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref20">
                <label>10</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Singh</surname>
                            <given-names>CK</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Gangwar</surname>
                            <given-names>VK</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Singh</surname>
                            <given-names>HV</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Deep capsule network based automatic batch code identification pipeline for a real-life industrial application.</article-title>
                    <source>Paper presented at the Proceedings of the International Joint Conference on Neural Networks.</source>
                    <year>2019</year>-July.</mixed-citation>
            </ref>
            <ref id="ref21">
                <label>11</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Gong</surname>
                            <given-names>L</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Thota</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Yu</surname>
                            <given-names>M</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>A novel unified deep neural networks methodology for use by date recognition in retail food package image.</article-title>
                    <source>

                        <italic toggle="yes">SIViP.</italic>
</source>
                    <year>2020</year>;<volume>15</volume>(<issue>3</issue>):<fpage>449</fpage>&#x2013;<lpage>457</lpage>.
                    <pub-id pub-id-type="doi">10.1007/s11760-020-01764-7</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref22">
                <label>12</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Ashino</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Takeuchi</surname>
                            <given-names>Y</given-names>
                        </name>
</person-group>:
                    <article-title>Expiry-Date Recognition System Using Combination of Deep Neural Networks for Visually Impaired.</article-title>
                    <source>

                        <italic toggle="yes">Expiry-date recognition system using combination of deep neural networks for visually impaired.</italic>
</source>
                    <year>2020</year>.
                    <pub-id pub-id-type="doi">10.1007/978-3-030-58796-3_58</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref23">
                <label>13</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Koponen</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Haataja</surname>
                            <given-names>K</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Toivanen</surname>
                            <given-names>P</given-names>
                        </name>
</person-group>:
                    <article-title>Text Recognition of Cardboard Pharmaceutical Packages by Utilizing Machine Vision.</article-title>
                    <source>

                        <italic toggle="yes">Electron. Imaging.</italic>
</source>
                    <year>2021</year>;<volume>33</volume>:<fpage>235-1</fpage>&#x2013;<lpage>235-7</lpage>.
                    <pub-id pub-id-type="doi">10.2352/ISSN.2470-1173.2021.10.IPAS-235</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref8">
                <label>14</label>
                <mixed-citation publication-type="other">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Girshick</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Donahue</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Darrell</surname>
                            <given-names>T</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Rich feature hierarchies for accurate object detection and semantic segmentation.</article-title>
                    <source>

                        <italic toggle="yes">Proceedings of the 2014 Conference on Computer Vision and Pattern Recognition.</italic>
</source>
                    <year>2014</year>.</mixed-citation>
            </ref>
            <ref id="ref7">
                <label>15</label>
                <mixed-citation publication-type="other">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Wang</surname>
                            <given-names>Y</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Liu</surname>
                            <given-names>X</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Tang</surname>
                            <given-names>Z</given-names>
                        </name>
</person-group>:
                    <article-title>An R-CNN based method to localize speech balloons in comics.</article-title>
                    <source>

                        <italic toggle="yes">MultiMedia Modeling: 22nd International Conference, MMM 2016, Miami, FL, USA, January 4-6, 2016, Proceedings, Part I 22.</italic>
</source>
                    <year>2016</year>; pp.<fpage>444</fpage>&#x2013;<lpage>453</lpage>.</mixed-citation>
            </ref>
            <ref id="ref24">
                <label>16</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Murphy</surname>
                            <given-names>KP</given-names>
                        </name>
</person-group>:
                    <source>

                        <italic toggle="yes">Machine learning: a probabilistic perspective</italic>
</source>:
                    <publisher-name>MIT Press</publisher-name>;<year>2012</year>.</mixed-citation>
            </ref>
            <ref id="ref11">
                <label>17</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Nachappa</surname>
                            <given-names>CH</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Rani</surname>
                            <given-names>NS</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Pati</surname>
                            <given-names>PB</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Adaptive dewarping of severely warped camera-captured document images based on document map generation.</article-title>
                    <source>

                        <italic toggle="yes">Int. J. Doc. Anal. Recognit.</italic>
</source>
                    <year>2023</year>;<fpage>1</fpage>&#x2013;<lpage>21</lpage>.
                    <pub-id pub-id-type="pmid">36687334</pub-id>
                    <pub-id pub-id-type="doi">10.1007/s10032-022-00425-4</pub-id>
                    <pub-id pub-id-type="pmcid">PMC9838515</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref12">
                <label>18</label>
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Gong</surname>
                            <given-names>S</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Liu</surname>
                            <given-names>C</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Ji</surname>
                            <given-names>Y</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <source>

                        <italic toggle="yes">Advanced image and video processing using MATLAB.</italic>
</source>Vol.<volume>12</volume>.
                    <publisher-name>Springer</publisher-name>;<year>2018</year>; p.<fpage>581</fpage>.</mixed-citation>
            </ref>
            <ref id="ref13">
                <label>19</label>
                <mixed-citation publication-type="other">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Koponen</surname>
                            <given-names>J</given-names>
                        </name>
</person-group>:
                    <article-title>Novel Deep Learning Application: Recognizing Inconsistent Characters on Pharmaceutical Packaging.</article-title>
                    <year>13 March 2023</year>.
                    <pub-id pub-id-type="doi">10.17605/OSF.IO/MP3RB</pub-id>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report201970">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.144650.r201970</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Ghosh</surname>
                        <given-names>Mridul</given-names>
                    </name>
                    <xref ref-type="aff" rid="r201970a1">1</xref>
                    <role>Referee</role>
                </contrib>
                <aff id="r201970a1">
                    <label>1</label>Computer Science, Shyampur Siddheswari Mahavidyalaya, Ajodhya, West Bengal, India</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>12</day>
                <month>12</month>
                <year>2023</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2023 Ghosh M</copyright-statement>
                <copyright-year>2023</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport201970" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.131775.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>reject</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>1. According to the title of the paper the&#x00a0; "novel deep-learning method for recognizing texts with multiple different printing methods" the novelty is questionable. The authors should clearly explain the novelty. They claim they designed the R-CNN framework. The name R-CNN stands for Region-based CNN but the authors presented as region with CNN. What is the difference between them should be reflected in the paper.&#x00a0;</p>
            <p> 2. The novelty in the framework is not seen. The authors should explain that.</p>
            <p> 3. The R-CNN framework is not explained in this paper. The authors should explain in detail.</p>
            <p> 4. The dataset section is weak. The number of images is very low. How deep-learning is working with these images though authors claim that they used data augmentation. But what are the techniques and how many images in the final dataset are not described?&#x00a0;</p>
            <p> 5. The evaluation metrics are generally described in the experimental section before the results.&#x00a0;</p>
            <p> 6. In the training the authors stated that they used Alexnet but it is not the R-CNN diagram. What are the requirements of these two deep learning methods?</p>
            <p> 7. In the training details the train-test rations are not mentioned.</p>
            <p> 8. The comparison with the state of the art is not performed.&#x00a0;</p>
            <p> 9. The reference section is weak.</p>
            <p>Is the work clearly and accurately presented and does it cite the current literature?</p>
            <p>No</p>
            <p>If applicable, is the statistical analysis and its interpretation appropriate?</p>
            <p>No</p>
            <p>Are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>Partly</p>
            <p>Is the study design appropriate and is the work technically sound?</p>
            <p>No</p>
            <p>Are the conclusions drawn adequately supported by the results?</p>
            <p>Partly</p>
            <p>Are sufficient details of methods and analysis provided to allow replication by others?</p>
            <p>No</p>
            <p>Reviewer Expertise:</p>
            <p>Artificial intelligence, Deep learning, image processing</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to state that I do not consider it to be of an acceptable scientific standard, for reasons outlined above.</p>
        </body>
        <sub-article article-type="response" id="comment11828-201970">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Koponen</surname>
                            <given-names>Jarmo</given-names>
                        </name>
                        <aff>University of Eastern Finland, Finland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>NO</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>20</day>
                    <month>6</month>
                    <year>2024</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Thank you for your peer review feedback on my publication. I have revised the publication considering your comments. Here are detailed responses to the points raised:</p>
                <p> 1. According to the title of the paper the&#x00a0; "novel deep-learning method for recognizing texts with multiple different printing methods" the novelty is questionable. The authors should clearly explain the novelty. They claim they designed the R-CNN framework. The name R-CNN stands for Region-based CNN but the authors presented as region with CNN. What is the difference between them should be reflected in the paper.</p>
                <p> This is valuable feedback. I have not developed the Region CNN method, but I have created a new application that uses the Region CNN method.</p>
                <p> 2. The novelty in the framework is not seen. The authors should explain that.</p>
                <p> Referring to the previous response, I would like to add that the application is in a new area that has been scarcely studied.</p>
                <p> 3. The R-CNN framework is not explained in this paper. The authors should explain in detail.</p>
                <p> The paper has been revised to enhance the explanation of the R-CNN framework. Although the original version included an explanation through both text and an illustrative figure, we have now provided a more detailed description to clarify the framework further.</p>
                <p> 4. The dataset section is weak. The number of images is very low. How deep-learning is working with these images though authors claim that they used data augmentation. But what are the techniques and how many images in the final dataset are not described?</p>
                <p> In training details include that information. In addition underlying data section provides more information on the matter</p>
                <p> 5. The evaluation metrics are generally described in the experimental section before the results.</p>
                <p> I have thoroughly revised the evaluation metrics to ensure they are relevant to the research domain. The metrics have been updated and are now specifically tailored to better align with the study&#x2019;s objectives and context.</p>
                <p> 6. In the training the authors stated that they used Alexnet but it is not the R-CNN diagram. What are the requirements of these two deep learning methods?</p>
                <p> I have clarified the requirements and differences between AlexNet and the R-CNN methods in the revised manuscript, ensuring that their respective roles and implementations are clearly explained.</p>
                <p> 7. In the training details the train-test rations are not mentioned.</p>
                <p> This information is provided both in the paper and in the 'Underlying Data' section.</p>
                <p> 8. The comparison with the state of the art is not performed.</p>
                <p> The comparison has been performed against both a method obtained from a pharmaceutical packaging publication (Kumar, G. P., &amp; Prasad, P. B. (2014). Machine vision based quality control: importance in pharmaceutical Industry. International Journal of Computer Applications, 975, 8887.)) and an industry-validated method. Additionally, a systematic review article (Koponen, J., Haataja, K., &amp; Toivanen, P. (2022). Recent advancements in machine vision methods for product code recognition: A systematic review. F1000Research, 11.) did not find an existing solution but identified a research gap regarding the state-of-the-art method in the pharmaceutical packaging field.</p>
                <p> 9. The reference section is weak</p>
                <p> The related work section has been strengthened, particularly in relation to the context of the study.</p>
            </body>
        </sub-article>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report174859">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.144650.r174859</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Chandio</surname>
                        <given-names>Asghar Ali</given-names>
                    </name>
                    <xref ref-type="aff" rid="r174859a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-8821-2355</uri>
                </contrib>
                <aff id="r174859a1">
                    <label>1</label>Quaid-e-Awam University of Engineering, Nawabshah, Pakistan</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>12</day>
                <month>12</month>
                <year>2023</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2023 Chandio AA</copyright-statement>
                <copyright-year>2023</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport174859" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.131775.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve-with-reservations</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The authors have worked on the text recognition from pharmaceutical images. This is a complex and challenges problem, however, the methods used by the authors are not state-of-the-art. Moreover, the comparison is not made with the related work.</p>
            <p> </p>
            <p> 1. The paper lacks the novelty of the work.</p>
            <p> 2. A comparison has been made between a CNN model and Tesseract OCR, however, the Tesseract OCR works for scanned text documents. The authors should compare their work with text recognition from images (synthetic or natural scenes) methods.</p>
            <p> 3. The authors may use instance or semantic segmentation, which will give better accuracy than the RCNN.</p>
            <p> 4. Why the Recall and Accuracy values are very smaller than the Precision?</p>
            <p> 5. The Alex-Net is a very old model and is not preferred nowadays. The authors may use a state-of-the-art pretrained model.&#x00a0;</p>
            <p> 6. The number of images in the dataset are very low. For this low data, RCNN model will not give better results.</p>
            <p> 7. There are several English grammar mistakes.</p>
            <p>Is the work clearly and accurately presented and does it cite the current literature?</p>
            <p>Yes</p>
            <p>If applicable, is the statistical analysis and its interpretation appropriate?</p>
            <p>I cannot comment. A qualified statistician is required.</p>
            <p>Are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>Yes</p>
            <p>Is the study design appropriate and is the work technically sound?</p>
            <p>Partly</p>
            <p>Are the conclusions drawn adequately supported by the results?</p>
            <p>Yes</p>
            <p>Are sufficient details of methods and analysis provided to allow replication by others?</p>
            <p>Partly</p>
            <p>Reviewer Expertise:</p>
            <p>I am a PhD in Computer Vision and Image Processing. My area of research is related to text detection and recognition from natural scene images, document analysis and OCR.</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.</p>
        </body>
        <sub-article article-type="response" id="comment11829-174859">
            <front-stub>
                <contrib-group>
                    <contrib contrib-type="author">
                        <name>
                            <surname>Koponen</surname>
                            <given-names>Jarmo</given-names>
                        </name>
                        <aff>University of Eastern Finland, Finland</aff>
                    </contrib>
                </contrib-group>
                <author-notes>
                    <fn fn-type="conflict">
                        <p>
                            <bold>Competing interests: </bold>No</p>
                    </fn>
                </author-notes>
                <pub-date pub-type="epub">
                    <day>20</day>
                    <month>6</month>
                    <year>2024</year>
                </pub-date>
            </front-stub>
            <body>
                <p>Thank you for your peer review feedback on my publication. I have revised the publication considering your comments. Here are detailed responses to the points raised:</p>
                <p> 1. The paper lacks the novelty of the work.</p>
                <p> This is valuable feedback. The title of the entire publication has been reconsidered and adapted. I have not developed the Region CNN method, but I have created a new application that uses the Region CNN method.</p>
                <p> 2. A comparison has been made between a CNN model and Tesseract OCR, however, the Tesseract OCR works for scanned text</p>
                <p> documents. The authors should compare their work with text recognition from images (synthetic or natural scenes) methods.</p>
                <p> The comparison has been performed against both a method obtained from a pharmaceutical packaging publication ( Kumar, G. P., &amp; Prasad, P. B. (2014). Machine vision based quality control: importance in pharmaceutical Industry. 
                    <italic>International Journal of Computer Applications</italic>, 
                    <italic>975</italic>, 8887.) and an industry-validated method. Additionally, a systematic review article ( Koponen, J., Haataja, K., &amp; Toivanen, P. (2022). Recent advancements in machine vision methods for product code recognition: A systematic review. 
                    <italic>F1000Research</italic>, 
                    <italic>11</italic>.) did not find an existing solution but identified a research gap regarding the state-of-the-art method in the pharmaceutical packaging field.</p>
                <p> 3. The authors may use instance or semantic segmentation, which will give better accuracy than the RCNN.</p>
                <p> Since OCR is proven to be in use in the pharmaceutical industry, we have not compared two new methods, but rather compared the new application to the previously used one. However, in a future study, we can compare this application using the Region CNN model to another application based on a different deep learning model.</p>
                <p> 4. Why the Recall and Accuracy values are very smaller than the Precision?</p>
                <p> This feedback led to a thorough review and adaptation of the performance metrics. Now, the curve surpassing all threshold values enables evaluation with three relevant metrics.</p>
                <p> 5. The Alex-Net is a very old model and is not preferred nowadays. The authors may use a state-of-the-art pretrained model.</p>
                <p> This is valuable feedback. However, although AlexNet and the Region CNN model are considered older, they contain beneficial features that are not present in newer members of the CNN family (Fast, Faster), such as a fixed size of 4096 feature vector for each region proposal.</p>
                <p> 6. The number of images in the dataset are very low. For this low data, RCNN model will not give better results.</p>
                <p> This field of study, being new, is still in the development phase. The diagram of metrics added in the paper presents insights into the model's performance.</p>
                <p> 7. There are several English grammar mistakes.</p>
                <p> I apologize for the errors. I have now corrected them.</p>
                <p> Thank you again for your valuable feedback. I have taken it into account, and it has helped improve my skills.</p>
            </body>
        </sub-article>
    </sub-article>
</article>
