<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Gated Local Adaptive Binarization using Supervised Learning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Javier Fumanal-Idocin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Juan Uriarte</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Borja de la Osa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Bardozzo</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Javier Fernández</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Humberto Bustince</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Estadística</institution>
          ,
          <addr-line>Informática, Matemáticas</addr-line>
          ,
          <institution>Public University of Navarre</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Neuronelab, DISA-MIS, University DegliStudy di Salerno</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Image thresholding is one of the most popular problems in image processing. However, changes in lightning and contrast in an image can cause trouble for the existing algorithms that use a global threshold for all the image. A solution for this problem is the adaptive thresholding, in which an image can have diferent thresholds for diferent parts of the image. Yet, the problem of choosing the most suitable threshold for each region of the image is still open. In this paper we present the Gated Local Adaptive Binarization algorithm, in which we choose the most appropriate threshold for each region of the image using a logistic regression. Our results show that this algorithm can efectively learn the most appropriate threshold in each situation, and beats other adaptive binarization solutions for a standard dataset in the literature.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Fuzzy logic</kwd>
        <kwd>Image Thresholding</kwd>
        <kwd>Image Processing</kwd>
        <kwd>Aggregation functions</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Image processing ins one of the most important research topics in the computer science areas [
        <xref ref-type="bibr" rid="ref1 ref2 ref3">1,
2, 3</xref>
        ]. Many problems have been studied in this area, like classification [
        <xref ref-type="bibr" rid="ref4 ref5 ref6">4, 5, 6</xref>
        ] and segmentation
of diferent objects in an image [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. One of the most researched topics in image processing is
image thresholding [
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ], also called image binarization, which consists of discriminating the
objects in an image from the background.
      </p>
      <p>
        The most popular binarization algorithm is the Otsu algorithm [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], and many other popular
algorithms have been proposed [
        <xref ref-type="bibr" rid="ref11 ref12 ref13">11, 12, 13</xref>
        ]. All of these algorithms work by establishing a
global threshold for the whole image. However, this strategy results in poor performance when
there are changes in the lightning and contrast of the image. In that case, the same threshold
cannot adapt itself to the diferent conditions in the image.
      </p>
      <p>
        Adaptive thresholding was proposed in [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] as a mean to solve this problem, by choosing a
diferent threshold for the diferent parts of the image. This algorithm works by precomputing
the integral image from the original one, and sliding a 3 × 3 window through all integral image,
where each window will use a diferent threshold according to its own characteristics. The
Adaptive thresholding was further developed in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. In that work, the authors focused on
the possible improvements using aggregation functions, and proposed a new generalization
of the Sugeno integral. Indeed, aggregation functions [16] have been successfully used in
many decision making problems [17, 18], brain computer interface classification tasks [ 19, 20],
community detection [21] and other image processing tasks [22, 23, 24, 25].
      </p>
      <p>
        However, there were some limits in the improvements of the algorithm proposed in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ],
as the fusion processes are limited by the quality of the data to fuse with the tested integrals.
In this work we propose a new algorithm to perform dynamic thresholding, the Gated Local
Adaptive Binarization (GLAB), that uses supervised learning to improve the results obtained by
other adaptive algorithms, based on a “gated” fusion process [26]. We also present a series of
extensions to the FLAT algorithm using other aggregation functions to compare to our newly
developed GLAB.
      </p>
      <p>
        The rest of this paper goes as follows: Section 2 describes the algorithm proposed in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], the
diferent aggregation functions used to extend it, and the proposed GLAB. Section 3 describes
our experiments and illustrates the results obtained. Finally, Section 4 details our conclusions
for this work and future lines of research.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Methods</title>
      <p>In this section we discuss the Fuzzy Local Adaptive Thresholding (FLAT) algorithm, and the
proposed Enhanced Local Adaptive Thresholding.</p>
      <sec id="sec-2-1">
        <title>2.1. Fuzzy Local Adaptive Thresholding</title>
        <p>
          The FLAT algorithm was proposed by Bardozzo et al. in [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] to improve the results of the local
Adaptive thresholding algorithm proposed in [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] using a new generalization of the Sugeno
integral. The FLAT algorithm consist of computing the fuzzy integral image of the original
image, and then perform the Adaptive binarization on the computed integral image.
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Computing the fuzzy integral image</title>
        <p>
          To compute the Fuzzy Integral Image, , we first compute the integral image , using the
formula:
(, ) = (, ) + (,  − 1) + ( − 1, ) − ( − 1,  − 1)
(1)
where  is the original image, and with convention (0, · ) = 0 and (· , 0) = 0. Then, we
compute the  as follows:
(, ) = ((, ), (,  − 1), ( − 1, ), ( − 1,  − 1))
(2)
where  is an aggregation function. The best result obtained in [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] was obtained using the
following Sugeno-like integral:
        </p>
        <p>= ∑︁ (︀  () ·  ()︀)
=1
 () = ||

where  is a permutation of  such that   &lt;  +1 for  ∈ {1, . . . , ||},  = {(), . . . , ()}
and  () is a fuzzy measure [27] that follows the expression:</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3. Computing adaptive binarization</title>
        <p>We compute the threshold for each window of size  ×  , usually a 3 × 3. For each of these
windows we do as follows:
1. Compute the area of the window:</p>
        <p>=  × 
2. Compute the area in the fuzzy integral image:
3. Compute the threshold using the ratio:
 = [1, 1] − [0, 1] − [1, 0] + [0, 0]
ℎℎ =</p>
        <p>where 0, 1, 0, 1 are the corners of the window. So, for each pixel we compute the
corresponding threshold using the 1 × 2 window where that pixel is the center, cropped in the
case of the borders of the image.</p>
      </sec>
      <sec id="sec-2-4">
        <title>2.4. Gated Local Adaptive Thresholding</title>
        <p>The Gated Local Adaptive Thresholding (GLAB) is a modification of the FLAT algorithm in
which the final threshold is computed using a logistic regression, using the values in the 1 × 2
window as an input vector, , we compute the resulting threshold using the expression:
ℎℎ =  (  + )
where  is the weight vector and  the bias to learn respectively, and  is the logistic
function.
(3)
(4)
(5)
(6)
(7)
(8)</p>
      </sec>
      <sec id="sec-2-5">
        <title>2.5. Evaluation Metrics</title>
        <p>As a evaluation metric, we have used the 1 score, comparing the obtained thresholding solution
with the ground truth label for each image. The 1 score is computed using the following
formulas, using the concepts of precision and recall:
  =</p>
        <p>+   
 =</p>
        <p>+</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Experimentation</title>
      <p>In this work we have taken the image thresholding dataset taken from [28], that consists of 9
diferent images in grayscale with ground-truth labels for each pixels. We show the images in
Figure 1.</p>
      <p>We studied the efect of diferent global threshold in the FLAT algorithm, in order to study
the relevance of this parameter in the FLAT algorithm, and then, we studied the performance of
the FLAT and GLAB algorithm for the images displayed in Figure 1.</p>
      <sec id="sec-3-1">
        <title>3.1. Studying diferent thresholds in Fuzzy Local Adaptive Thresholding</title>
        <p>First, we studied how setting diferent fixed threshold could impact the performance of the
FLAT algorithm. This is contrary to the local nature of the FLAT algorithm, but is representative
of the performance of the integral image-based thresholding for the global image, and can give
us an intuition of the expected changes in performance when changing the threshold value.
1.0 ('Image ', '6')</p>
        <p>Img. 1 Img. 2 Img. 3 Img. 4 Img. 5 Img. 6 Img. 7 Img. 8 Img. 9 Img. 10 Average
Results for all the images in the dataset and the average performance for the FLAT and GLAB algorithm,
using diferent aggregation functions to construct the Fuzzy Integral Image.</p>
        <p>Some of the results of this study are illustrated in Figure 2. We can determine that there is an
evident impact in the chosen threshold for each image, and that for the diferent combinations of
aggregations and images tested, the optimal threshold seem to vary a lot, which is an indication
of the suitability of the GLAB to optimize the threshold for each one.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Results of Gated Local Adaptive Thresholding</title>
        <p>To train and evaluate the performance of the GLAB we first computed the fuzzy integral image
of each of the original images. Then, we divided each image and the corresponding fuzzy
train the model and the rest to evaluate the performance of the GLAB.
integral image in non-overlapping windows of 3 × 3. Finally, we split the 80% of the images to</p>
        <p>In Table 1 we show the results for the GLAB and FLAT algorithms for the evaluation windows
corresponding to each image. We found results to be much higher than those obtained using
the FLAT, and that the best case was using the Choquet integral to construct the fuzzy integral
image, and then using the GLAB to perform the binarization.
1.0 ('Image ', '8')</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusions and Future Lines</title>
      <p>In this work we have presented the Gated version of the FLAT algorithm, the GLAB. The GLAB
computes the local threshold from each image using a logistic regression that learns the most
appropriate threshold for each region of the image. We found the results using GLAB to be
superior to the FLAT algorithm, and the GLAB constructing the fuzzy integral image using the
Choquet integral.</p>
      <p>Future research shall study the use of further aggregation functions, and to study the use of
the GLAB algorithm in a Convolutional Neural Network.
R. Tagliaferri, J. Fernandez, H. Bustince, Sugeno integral generalization applied to improve
adaptive image binarization, Information Fusion 68 (2021) 37–45.
[16] G. Beliakov, H. B. Sola, T. C. Sánchez, A practical guide to averaging functions, Springer,
2016.
[17] M. Papčo, I. Rodríguez-Martínez, J. Fumanal-Idocin, A. H. Altalhi, H. Bustince, A fusion
method for multi-valued data, Information Fusion 71 (2021) 1–10.
[18] Z. Takáč, J. Fernandez, J. Fumanal, C. Marco-Detchart, I. Couso, G. Dimuro, H. Santos,
H. Bustince, Distances between interval-valued fuzzy sets taking into account the width
of the intervals, in: 2019 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE),
IEEE, 2019, pp. 1–6.
[19] J. Fumanal-Idocin, Y.-K. Wang, C.-T. Lin, J. Fernández, J. A. Sanz, H. Bustince,
Motorimagery-based brain-computer interface using signal derivation and aggregation functions,
IEEE Transactions on Cybernetics (2021).
[20] J. Fumanal-Idocin, Z. Takac, J. Fernandez, J. A. Sanz, H. Goyena, C.-T. Lin, Y. Wang,
H. Bustince, Interval-valued aggregation functions based on moderate deviations applied
to motor-imagery-based brain computer interface, IEEE Transactions on Fuzzy Systems
(2021) 1–1.
[21] J. Fumanal-Idocin, A. Alonso-Betanzos, O. Cordón, H. Bustince, M. Minárová, Community
detection and social network analysis based on the italian wars of the 15th century, Future
Generation Computer Systems 113 (2020) 25–40.
[22] C. Lopez-Molina, H. Bustince, J. Fernández, P. Couto, B. De Baets, A gravitational approach
to edge detection based on triangular norms, Pattern Recognition 43 (2010) 3730–3741.
[23] M. Delić, L. Nedović, E. Pap, Extended power-based aggregation of distance functions and
application in image segmentation, Information sciences 494 (2019) 155–173.
[24] H. Jégou, A. Zisserman, Triangulation embedding and democratic aggregation for image
search, in: Proceedings of the IEEE conference on computer vision and pattern recognition,
2014, pp. 3310–3317.
[25] D. Paternain, J. Fernández, H. Bustince, R. Mesiar, G. Beliakov, Construction of image
reduction operators using averaging aggregation functions, Fuzzy Sets and Systems 261
(2015) 87–111.
[26] C.-Y. Lee, P. Gallagher, Z. Tu, Generalizing pooling functions in cnns: Mixed, gated, and
tree, IEEE transactions on pattern analysis and machine intelligence 40 (2017) 863–875.
[27] M. Sugeno, Fuzzy measure and fuzzy integral, Transactions of the Society of Instrument
and Control Engineers 8 (1972) 218–226.
[28] B. Pekala, U. Bentkowska, D. Kosior, Z. Takáč, A. Castillo, M. Sesma-Sara, J. Fernandez,
J. Lafuente, H. Bustince, Interval-valued equivalence measures respecting uncertainty in
image processing, International Journal of Intelligent Systems 36 (2021) 2767–2796.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>M. M. Petrou</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Petrou</surname>
          </string-name>
          ,
          <article-title>Image processing: the fundamentals</article-title>
          , John Wiley &amp; Sons,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>E. R.</given-names>
            <surname>Dougherty</surname>
          </string-name>
          ,
          <article-title>Digital image processing methods</article-title>
          , CRC Press,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Q.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Koltun</surname>
          </string-name>
          ,
          <article-title>Fast image processing with fully-convolutional networks</article-title>
          ,
          <source>in: Proceedings of the IEEE International Conference on Computer Vision</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>2497</fpage>
          -
          <lpage>2506</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Xie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Xia</surname>
          </string-name>
          ,
          <article-title>Medical image classification using synergic deep learning</article-title>
          ,
          <source>Medical image analysis 54</source>
          (
          <year>2019</year>
          )
          <fpage>10</fpage>
          -
          <lpage>19</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Ciregan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Meier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Schmidhuber</surname>
          </string-name>
          ,
          <article-title>Multi-column deep neural networks for image classification</article-title>
          , in: 2012 IEEE conference
          <article-title>on computer vision and pattern recognition</article-title>
          , IEEE,
          <year>2012</year>
          , pp.
          <fpage>3642</fpage>
          -
          <lpage>3649</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>I.</given-names>
            <surname>Goodfellow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Courville</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          ,
          <article-title>Deep learning</article-title>
          , volume
          <volume>1</volume>
          , MIT press Cambridge,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>O.</given-names>
            <surname>Ronneberger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Brox</surname>
          </string-name>
          , U-net:
          <article-title>Convolutional networks for biomedical image segmentation</article-title>
          ,
          <source>in: International Conference on Medical image computing and computerassisted intervention</source>
          , Springer,
          <year>2015</year>
          , pp.
          <fpage>234</fpage>
          -
          <lpage>241</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Sezgin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Sankur</surname>
          </string-name>
          ,
          <article-title>Survey over image thresholding techniques and quantitative performance evaluation</article-title>
          ,
          <source>Journal of Electronic imaging 13</source>
          (
          <year>2004</year>
          )
          <fpage>146</fpage>
          -
          <lpage>165</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>T. Y.</given-names>
            <surname>Goh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. N.</given-names>
            <surname>Basah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Yazid</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J. A.</given-names>
            <surname>Safar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. S. A.</given-names>
            <surname>Saad</surname>
          </string-name>
          ,
          <article-title>Performance analysis of image thresholding: Otsu technique</article-title>
          ,
          <source>Measurement</source>
          <volume>114</volume>
          (
          <year>2018</year>
          )
          <fpage>298</fpage>
          -
          <lpage>307</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>P. L.</given-names>
            <surname>Rosin</surname>
          </string-name>
          , E. Ioannidis,
          <article-title>Evaluation of global image thresholding for change detection</article-title>
          ,
          <source>Pattern recognition letters 24</source>
          (
          <year>2003</year>
          )
          <fpage>2345</fpage>
          -
          <lpage>2356</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>H.</given-names>
            <surname>Bustince</surname>
          </string-name>
          , E. Barrenechea,
          <string-name>
            <given-names>M.</given-names>
            <surname>Pagola</surname>
          </string-name>
          ,
          <article-title>Image thresholding using restricted equivalence functions and maximizing the measures of similarity</article-title>
          ,
          <source>Fuzzy Sets and Systems</source>
          <volume>158</volume>
          (
          <year>2007</year>
          )
          <fpage>496</fpage>
          -
          <lpage>516</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>M. P. De Albuquerque</surname>
            ,
            <given-names>I. A.</given-names>
          </string-name>
          <string-name>
            <surname>Esquef</surname>
            ,
            <given-names>A. G.</given-names>
          </string-name>
          <string-name>
            <surname>Mello</surname>
          </string-name>
          ,
          <article-title>Image thresholding using tsallis entropy</article-title>
          ,
          <source>Pattern Recognition Letters</source>
          <volume>25</volume>
          (
          <year>2004</year>
          )
          <fpage>1059</fpage>
          -
          <lpage>1065</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>L.-K. Huang</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.-J. J. Wang</surname>
          </string-name>
          ,
          <article-title>Image thresholding by minimizing the measures of fuzziness</article-title>
          ,
          <source>Pattern recognition 28</source>
          (
          <year>1995</year>
          )
          <fpage>41</fpage>
          -
          <lpage>51</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>D.</given-names>
            <surname>Bradley</surname>
          </string-name>
          , G. Roth,
          <article-title>Adaptive thresholding using the integral image</article-title>
          ,
          <source>Journal of graphics tools 12</source>
          (
          <year>2007</year>
          )
          <fpage>13</fpage>
          -
          <lpage>21</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>F.</given-names>
            <surname>Bardozzo</surname>
          </string-name>
          ,
          <string-name>
            <surname>B. De La Osa</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Horanská</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Fumanal-Idocin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>delli</article-title>
          <string-name>
            <surname>Priscoli</surname>
          </string-name>
          , L. Troiano,
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>