Replacing pooling functions in Convolutional Neural Networks by linear combinations of increasing functions
Abstract
Tracasa Instrumental (iTRACASA), Spain
Full text
Neural Networks 152 (2022) 380–393 Contents lists available at ScienceDirect Neural Networks journal homepage: www.elsevier.com/locate/neunet Replacing pooling functions in Convolutional Neural Networks by linear combinations of increasing functions Iosu Rodriguez-Martinez a, Julio Lafuente a, Regivan H.N. Santiago b, Graçaliz Pereira Dimuro a,e, Francisco Herrera c,d, Humberto Bustince a,∗ aDepartment of Statistics, Computer Science and Mathematics, Public University of Navarre, Pamplona, 31006, Navarre, Spain bDepartment of Computer Science and applied Mathematics, Universidade Federal do Rio Grande, 1524, Rio Grande, Brasil cAndalusian Research Institute in Data Science and Computational Intelligence, University of Granada, Granada, 18071, Granada, Spain dFaculty of Computing and Information Technology, King Abdulaziz University, Jeddah, 21589, Saudi Arabia eCentro de Ciências Computacionais, Universidade Federal do Rio Grande, 96201-900, Rio Grande, Brasil article info Article history: Received 16 September 2021 Received in revised form 7 March 2022 Accepted 27 April 2022 Available online 6 May 2022 Keywords: Convolutional Neural Networks Pooling function Order statistic Generalized Sugeno integral abstract Traditionally, Convolutional Neural Networks make use of the maximum or arithmetic mean in order to reduce the features extracted by convolutional layers in a downsampling process known as pooling. However, there is no strong argument to settle upon one of the two functions and, in practice, this selection turns to be problem dependent. Further, both of these options ignore possible dependencies among the data. We believe that a combination of both of these functions, as well as of additional ones which may retain different information, can benefit the feature extraction process. In this work, we replace traditional pooling by several alternative functions. In particular, we consider linear combinations of order statistics and generalizations of the Sugeno integral, extending the latter’s domain to the whole real line and setting the theoretical base for their application. We present an alternative pooling layer based on this strategy which we name ‘‘CombPool’’ layer. We replace the pooling layers of three different architectures of increasing complexity by CombPool layers, and empirically prove over multiple datasets that linear combinations outperform traditional pooling functions in most cases. Further, combinations with either the Sugeno integral or one of its generalizations usually yield the best results, proving a strong candidate to apply in most architectures. ©2022 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). 1. Introduction Since the breakthrough of Krizhevsky, Sutskever, and Hinton (2012) on the Imagenet competition, Convolutional Neural Networks, or CNNs (Fukushima & Miyake,1982;LeCun, Bengio, & Hinton,2015), have set the state-of-the-art for image processing tasks. In this context, extensive research has been dedicated to developing new CNN designs: more heavily parameterized models have been proved to produce more robust and optimal architectures, offering impressive results for image classification (He, Zhang, Ren, & Sun,2016;Liu & Deng,2015); production environment constraints (e.g. smartphones or autonomous vehicles) have led to the development of more ‘‘compressed’’ but still competitive architectures (Howard et al.,2017;Huang, Liu, Van Der Maaten, & Weinberger,2017;Tan & Le,2019). Still, most of these strategies keep operating according to the same basic operations already presented in Fukushima and Miyake ∗Corresponding author. E-mail address: [email protected] (H. Bustince). (1982): convolution, which extracts local features of a given image; and pooling, which downsamples those extracted features sequentially. Although in the case of the pooling process there have been some new proposals (Forcén, Pagola, Barrenechea, & Bustince, 2020;Graham,2014;He, Zhang, Ren, & Sun,2015;Zeiler & Fergus,2013), most state-of-the-art models default to traditional maximum or average pooling. However, there is still no clear guide as to when to settle for one of the two options. Some theoretical studies defend that maximum pooling favours sparser feature representations (Boureau, Bach, LeCun, & Ponce,2010; Boureau, Ponce, & LeCun,2010) which are common in CNNs, but offer no explanation as to why average pooling performs better for some modern architectures (Huang et al.,2017). Therefore, the selection of pooling aggregation appears to be dependent on the input data as well as the precise model employed, acting as an additional hyperparameter. Further, both maximum and average pooling ignore all possible relationship among the values to be reduced, potentially ignoring important spatial dependencies among the data. Functions from aggregation theory (Beliakov, Sola, & Sánchez, 2016) such as fuzzy integrals can alleviate this problem, since https://doi.org/10.1016/j.neunet.2022.04.028 0893-6080/©2022 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 they may model the dependencies among input values (Dimuro et al.,2020). These functions have been used with success in the past to this end (Dias et al.,2018), as well as in the context of other image processing tasks (Bardozzo et al.,2021;Bueno, Dias, Pereira Dimuro, Santos, & Bustince Sola,2019;Mendoza, Melin, & Licea,2009), so we believe they can improve the classic behaviours. With respect to the selection of maximum or average pooling, in Lee, Gallagher, and Tu (2018) the authors test a convex combination of both methods as an alternative that, not only mitigates their individual shortcomings, but improves upon both of them in the general case. We think that this approach can be further extended if we consider a combination of additional functions which can retain different information. In this paper, we propose to replace the pooling function of a CNN by functions other than the maximum and arithmetic mean, taking into account their respective behaviour. Since the maximum ignores all values but one, we consider other order statistics. By contrast, the arithmetic mean takes into account all the aggregated information, so we propose the Sugeno integral (Beliakov et al.,2016), as well as some new generalizations (Bardozzo et al.,2021), as an alternative that models the relationship between the input values. It is important to remark that, although different in nature, the maximum and the arithmetic mean also share some properties. One such property is the monotonicity, in particular the increasingness. In the context of information fusion computing, the increasingness property is very important, since it guarantees that the higher the ‘‘quality of the information’’ provided by the inputs, the best the quality of the information of the aggregated value representing them (Dimuro, Costa, , & Claudio,2000), on the light of Domain Theory (Abramsky & Jung,1994;Stoltenberg- Hansen, Lindström, & Griffor,1994). Motivated by this, we would like to keep this property in our proposal. Thus, we present the linear combination of the previous increasing functions as a replacement for classic pooling layers, and refer to this strategy as Combination Pooling layer, or CombPool layer for short. We model the contribution of each function through new parameters of the model, whose values are optimized via the backpropagation algorithm, alike the rest of weights of a CNN. In order to obtain a resulting function which preserves increasigness, we study the conditions that these parameters must satisfy and ensure that they hold. To empirically show the usefulness of the CombPool layer, we have replaced the pooling layers of three different CNN architectures of different complexity. The performance of every model is evaluated over five different datasets, showing improvements with respect to the traditional models. We compare our results with the traditional pooling functions, as well as some of the additional mentioned alternatives. We show that, in general, combinations which use a generalization of the Sugeno integral outperform most of them. The paper is structured in the following way: Section 2re- freshes important notions related with CNNs and pooling functions, as well as several of the used functions; Section 3presents the definitions and theorems that set the theoretical justification for the performed experiments and introduces the new pooling layer; Section 4describes the different considered CNN architectures and datasets used in our experimentation, while Section 5presents the obtained results; a brief discussion is held in Section 6, in which the strengths of the proposal are commented; finally, Section 7ends the paper with some conclusions and ideas for future works. Additionally, all lemmas and mathematical proofs related with the theory presented in Section 3have been gathered in Appendix, with the intention of easing the readability of the paper. 2. Preliminaries In this section, we recall some important notions, both related to CNN architectures as well as to increasing functions, which will be subsequently taken into account on the theoretical and experimental parts. 2.1. Convolutional neural networks In the field of Deep Learning (Schmidhuber,2015), convolutional neural networks (CNN) are a type of neural network designed for dealing with data where local information is of relevance, such as in temporal series (Abdel-Hamid, Deng, & Yu, 2013), image (Krizhevsky et al.,2012) or video (Le Callet, Viard- Gaudin, & Barba,2006). These models perform two different processes over the input data: the first one is universal to all tasks and consists on the extraction of relevant features from the raw data, mapping input samples to a latent vector space. The second one uses the extracted features as input and can vary depending on the specific problem at hand, e.g. classifying samples into predefined categories or segmenting the different objects represented on a given image. Hereafter, we focus on image classification. CNN receive their name in relation to the first aforementioned process, since the feature extraction is performed via the convolution of image kernels over an input. By input, we understand a matrix X∈Rh×w×c, which can represent either an image of size h×w, where each pixel Xij ∈Rcis represented by ccolour channels (c=1 for grey scale images, c=3 for colour images) or a feature image, where each channel Xd∈Rh×wrepresents the presence or absence of a feature over all parts of a given image. Each of those cfeature maps will have been produced, at the same time, by the convolution of another kernel representing a specific feature over all parts of a previous input. To be more precise, the output produced by a feature kernel W∈Rk1×k2×cfor a k1×k2window (where k1,k2∈Nare odd numbers) of an input X∈Rh×w×ccentred on the pixel Xm,nis given by the following expression: Ym,n= c ∑ d=1 k2 ∑ j=1 k1 ∑ i=1 Wd ij ·Xd m−1+i−k1−1 2,n−1+j−k2−1 2 (1) The values of these kernels are ‘‘learnt’’ similarly to the weights of any conventional neural network: they are randomly initialized and optimized iteratively using some variation of the gradient descent algorithm, usually stochastic gradient descent (Ruder,2016). CNN are composed of several convolutional layers (in addition to other types of layers) that operate sequentially over the input data so that the output generated by the lth layer is provided as input for the (l+1)th layer. Each convolutional layer is composed of clfeature kernels that are applied to the received input, generating cldifferent feature images that are stacked together before sending the output to the following layer. Although the objective of the feature extractor is the reduction of the input image, the previous process has the opposite effect. In order to ensure this reduction, pooling layers are added at different points during the network. When a pooling layer receives an input X∈Rh×w×c, each independent channel is separated in disjoint windows of size k1×k2. After that, the values of each window are aggregated by means of some function. The most popular ones are the maximum and the average. 381
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 2.2. Pooling functions When LeCun, Bottou, Bengio, and Haffner (1998) presented the LeNet architecture, they used the average as pooling function, which attains reasonable performance for their particular model. However, some theoretical and empirical studies show clear improvements over similar architectures when using maximum pooling (Boureau, Bach, LeCun, & Ponce,2010;Scherer, Müller, & Behnke,2010), and it seems to have become the standard practice for most models (Krizhevsky et al.,2012;Simonyan & Zisserman,2014;Szegedy et al.,2015). Even then, other equally competitive architectures perform better when applying average pooling (Huang et al.,2017), which hinders the selection over the best pooling function. To this respect, several authors have provided alternatives to the classic pooling methods. Some of the most well known alternative pooling options differ in the objective they pursue, however: Spatial Pyramid Pooling was introduced as a means to remove the fixed size constraint of a CNN architecture, subsampling the output produced by the last convolutional layer of the network and generating fixed-length inputs for the classifier (He et al.,2015); Fractional Max Pooling puts the focus on the regions to be downsampled, which are randomly or pseudorandomly chosen, instead of on the method in which to aggregate its values (Graham,2014); fully convolutional networks remove the need of applying pooling functions altogether through their substitution by strided convolutional layers (i.e., convolutional layers in which filters skip over certain positions) (Springenberg, Dosovitskiy, Brox, & Riedmiller,2015) although they add more parameters to the model as a consequence. There have been other attempts at substituting the aggregation function of the pooling operation nevertheless. In Zeiler and Fergus (2013), the authors present a stochastic method which randomly chooses one of the values to downsample according to a multinomial distribution based on their magnitude. In Lee et al. (2018), a convex combination of both average and maximum pooling is presented, in which the coefficients of each aggregation are learnt through various different strategies: ‘‘mixed’’ pooling sets the coefficients as learnable parameters of the model directly; the ‘‘gated" version uses kernels which generate different coefficients for each region to be downsampled based on its values, via a logistic regression (similarly to a channel-wise convolution); the ‘‘tree’’ version uses a differentiable decision tree to learn the proportion of each coefficient. A tentative to use the Choquet integral (Choquet,1953–1954) in pooling layers was proposed by Dias et al. (2018,2019). In the experimental section we compare our proposal against some of these strategies, in addition to classic pooling strategies. 2.3. Increasing functions We recall now some increasing functions that we use later in order to define linear combinations to set as pooling functions. It will be assumed from now on that 2 ≤n∈N, 1 ≤r∈N. A map A:Rn→Ris said to be an increasing function if x,y∈Rn,x≤y, that is, xi≤yifor all i∈ {1,...,n}, implies A(x)≤A(y). Set N= {1,...,n}and Σnas group of all possible permutations of N. For all x=(x1,...,xn)∈Rnand σ∈Σn, denote xσ=(xσ(1),...,xσ(n)); if xσ(1) ≤ · · · ≤ xσ(n), denote σ∈x(↗). Consider r∈ {1,...,n}. Denote by OSrthe rth order statistic, that is, the function OSr:Rn→Rgiven for all x=(x1,...,xn)∈ Rn, by OSr(x)=xσ(r), where σ∈x(↗), independently of the chosen σ. We have, in particular, the maximum max =OSnand the minimum min =OS1. The arithmetic mean, is the function AM :Rn→R, given by AM(x)=(x1+ · · · + xn)/n, for all x=(x1,...,xn)∈Rn. Now we recall the definition of fuzzy measure Definition 2.1. A fuzzy measure on Nis a map ν:2N→ [0,+∞) such that 1. ν(∅)=0 and 2. S⊆T⊆Nimplies ν(S)≤ν(T). Definition 2.2. The Sugeno integral associated to the fuzzy measure νis the map Sν:Rn→R given, for x=(x1,...,xn)∈Rn, by Sν(x)=max (min(xσ(1), ν(Nσ 1)),...,min(xσ(n), ν(Nσ n))), where σ∈x(↗)and Nσ i= {σ(i), . . . , σ(n)}. A possible extension of the notion of Sugeno integral was presented in Bardozzo et al. (2021). We will revise it and offer an alternative definition in the following section. 3. Combination of increasing functions for the pooling function As we have already said, when taking into consideration the classic pooling layers, the maximum and the arithmetic mean are the two most common options. Both of these functions are particular cases of aggregation operators, which respect boundary and monotonicity conditions. That is, both functions F: [a,b]n→ [a,b]satisfy that F(a,...,a)=aand F(b,...,b)=b, and that F(x1,...,xn)≤F(y1,...,yn) if xi≤yifor all i∈ {1,...,n}. Therefore, both functions are increasing functions. In this section we study the conditions required for linear combinations of increasing functions to result into increasing functions. We consider order statistics, the arithmetic mean, the Sugeno integral and one of its generalizations. We conclude the section with the introduction of the CombPool layer, a pooling layer which enables the use of these linear combinations ensuring that the studied conditions are satisfied. For this work, no other property is imposed, since we want to avoid restricting the representability capabilities of the CNN models. Due to the optimization strategy of neural networks, based on the gradient descent algorithm, setting further constraints usually results in weaker models rather than more robust ones. 3.1. Increasing function construction via linear combination of increasing functions In the following we study linear combinations of increasing functions from Rn→R, in some cases from [0,+∞)n→ [0,+∞). We set 0=(0,...,0), 1=(1,...,1), ei=(0,...,1 i,...,0). Let A1,...,Ar:Rn→Rbe increasing functions. We denote I(A1,...,Ar)= {(α1, . . . , αr)∈Rn| r ∑ i=1 αiAi:Rn→ Ris an increasing function}. Proposition 3.1. (I(A1,...,Ar),+)is a semigroup with neutral element 0. Moreover, let R+denote the set of all positive real numbers, (R+∪ {0})r⊆I(A1,...,Ar). Negative coefficients may appear in elements of I(A1,...,Ar): 382
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 Remark 3.2. Consider (α1, . . . , αr)∈I(A1,...,Ar), where Ai:Rn→Ris an increasing function, i=1,...,r, and A= α1A1+ · · · + αrAr; if αi= 0 we have Ai=1 αi A−α1 αi A1−ˆ i . . . −αr αi Ar, hence (1 αi,−α1 αi,ˆ i . . ., −αr αi)∈I(A,A1,ˆ i . . ., Ar). However it could be that negative elements are not allowed in a particular I(A1,...,Ar). This is always the case if r=1: Proposition 3.3. Let A:Rn→Rbe a non-constant increasing function. Let α∈R. Then αAis an increasing function if and only if α≥0. Observe that if A:Rn→Ris a constant function, then we have that αAis also constant for all α∈R. Notation 3.4. Consider k ∈N, a,b∈R, a ≤b. We set (a,b|k+1) =a(e1+ · · · + ek)+b(ek+1+ · · · + en) if k <n and (a,b|n)=a(e1+ · · · + en). 3.2. Combinations of order statistics and arithmetic mean For the linear combination of order statistics to be an increasing function, the following must hold: Proposition 3.5. Consider i1,...,ir∈N, i1<· · · <ir. Then, for all order statistics OSi1,...,OSir, it holds that I(OSi1,...,OSir)= {(α1, . . . , αr)|α1, . . . , αr≥0} As by definition AM =1 n(OS1+ · · · + OSn), we have Proposition 3.6. Consider i1,...,ir∈N, i1<· · · <ir, r <n. Then, for all order statistics OSi1,...,OSir, it holds that I(AM,OSi1,...,OSir)= {(α, β1, . . . , βr)|α, α +nβ1, . . . , α +nβr≥0}. Analogously, for all order statistics OS1,...,OSn, we have that I(AM,OS1,...,OSn)= {(α, β1, . . . , βn)|α+nβ1, . . . , α +nβn≥0}. 3.3. Combinations with Sugeno integral We write νS=ν(S) for S⊆N,xσ=(xσ(1),...,xσ(n)), νσ i=ν(Nσ i), Ni= {i,...,n}and νi=ν(Ni). So Sν(x)= maxn i=1(min(xσ(i), νσ i)). We know that Sν(x1,...,xn)=max S⊆N[min(νS,(min i∈Sxi))]. Definition 3.7. A fuzzy measure ν:2N→ [0,+∞) is said to be strict in k∈Nif either k=nor there exists σ∈Σnsuch that νσ k> νσ k+1.νis strict if it is strict in k, for all k∈N. Proposition 3.8. Consider i1,...,ir∈N, i1<· · · <ir, r <n. Assume that there exists k ∈N\ {i1,...,ir}such that the fuzzy measure ν:2N→ [0,+∞)is strict in k. Then, for all order statistics OSi1,...,OSir, and Sugeno integral Sν, it holds that I(OSi1,...,OSir,Sν)= {(α1, . . . , αr, β |α1, . . . , αr, β ≥0)}. Corollary 3.9. Consider i1,...,ir∈N, i1<· · · <ir<n. For each fuzzy measure ν:2N→ [0,+∞)one has, for all order statistics OSi1,...,OSir, and Sugeno integral Sν, I(OSi1,...,OSir,Sν)= {(α1, . . . , αr, β)|(α1, . . . , αr, β ≥0)}. Proposition 3.10. Let ν:2N→ [0,+∞)be a fuzzy measure. If α1, . . . , αn, α1+β, . . . , αn+β≥0, then, for all order statistics OSi1,...,OSir, and Sugeno integral Sν, α1OS1+· · ·+αnOSn+βSνis increasing. If α1OS1+· · ·+αnOSn+βSν is increasing and νis strict in k ∈N, then αk+β≥0; hence if νis strict, one has that I(OS1,...,OSn,Sν)= {(α1, . . . , αn, β)|α1, . . . , αn, α1+β, . . . , αn+β≥0}. Proposition 3.11. Let ν:2N→ [0,+∞)be a fuzzy measure. We have I(AM,Sν)= {(α, β)∈R2|α, α +nβ≥0}. 3.4. Generalized Sugeno integrals and combinations Definition 3.12. Let Ube a connected subset of Rsuch that 0 ∈U. AU-fuzzy measure on Nis a map ν:2N→Usuch that 1. ν(∅)=0 and 2. S⊆T⊆Nimplies ν(S)≤ν(T). Obviously im ν⊆ [0,+∞), but we need this more general assumption on Uin the following. Definition 3.13. Let Uand Ibe two connected subsets of Rsuch that 0 ∈U⊆I. Let ν:2N→Ube a U-fuzzy measure. We say that the maps F:I×U→Iand G:In→Uare ν-admissible if the map A:In→Igiven, for x1,...,xn∈I, by A(x1,...,xn)=G(F(xσ(1), ν(Nσ 1)),...,F(xσ(n), ν(Nσ n))), where σ∈x(↗)and Nσ i= {σ(i), . . . , σ(n)}, is well defined (that is, the result does not change for σ , σ ′∈x(↗)) and increasing. Then we set A=A(F,G, ν) and name it the Sugeno-like (F,G, ν)-function, We write νS=ν(S) for S⊆N,xσ=(xσ(1),...,xσ(n)), νσ i=ν(Nσ i), Ni= {i,...,n}and νi=ν(Ni). So, for x1,...,xn∈I, we have that A(x1,...,xn)=G(F(xσ(1), νσ 1),...,F(xσ(n), νσ n)). Examples 3.14. •With U=I=R, if F(x,y)=min(x,y) and G(x)= max(x1,...,xn), we have the Sugeno integral Sνgiven in 2.2. Assume, moreover, that the fuzzy measure νis symmetrical (that is, ν(A)=ν(B) if A,B⊆Nand |A| = |B|; we set then νσ i=νi, as this only depends on iand, as usually it is not necessary to specify the permutations σ, also x(i)=xσ(i)). If G(x1,...,xn)=x1+· · ·+xn, we set A(F,G, ν)=A(F,Σ, ν), so that, if x∈In, A(F,Σ, ν)(x)= n ∑ i=1 F(x(i), νi). For instance with x=(0,1|i+1), y=(0,1|i), i∈N, we have x(i)<y(i)and x(j)=y(j)if i= j∈N. Thus F and Σare ν-admissible if and only if x,y∈I,x≤yimplies F(x, νi)≤F(y, νi) for i=1. . . , n. 383
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 •For F(x,y)=xy, set Dν=A(Π,Σ, ν). Then Dνis the aggregation function given by Dν(x)=∑n i=1x(i)νi, that is, Dν=∑n i=1νiOSi. Let now U= [0,1],I= [0,+∞), νsatisfying ν(N)=1, •Let H be the Hamacher t-norm corresponding to the null parameter and restricted to [0,1], that is, for x∈ [0,+∞), y∈ [0,1], H(x,y)={xy/(x+y−xy) if (x,y)= (0,0), 0 if (x,y)=(0,0). Set Tν=A(H,Σ, ν). Thus Tν(x)=∑n i=1H(x(i), νi). Remarks 3.15. In cases 2 and 3 above it is necessary to impose the restriction on νto be symmetrical: consider for instance the case n=2 and assume that ν({i})=ni,i=1,2 and n1= n2. Take x=(1,1); the identity id and the transposition τ=O(1,2) both belong to x(↗), and xid(1)νid 1+xid(2)νid 2=νN+n2= xτ(1)ντ 1+xτ(2)ντ 2=νN+n1 hence to be Dνwell defined the symmetry of νis necessary. We obtain the same result in relation to Tν. The restriction in the case 3 to U= [0,1],I= [0,+∞) is stated to avoid the occurrence of indeterminations. In the following, consider the case of Dν=A(Π,Σ, ν), where ν:2N→Ris a symmetric fuzzy measure. It is immediate that Dν(cx)=cDν(x) for all x∈Rn,c∈ [0,+∞), that is, Dνis positively homogeneous. Of course the above situation does not appear if ν1=1, except in the trivial case in which further ν2= · · · = νn=0. Proposition 3.16. Let us assume that νn= 0and x,y∈Rn,x≤y. Then Dν(x)=Dν(y)if and only if x=y. Proposition 3.17. Consider M ⊆N and set M′=N\M. We have I(OS1,...,OSM,Dν)= {(α1, . . . , αM, β)|(αi+βνi≥0if i ∈M)and (βνi≥0if i ∈M′)}. Corollary 3.18. Taking into account Proposition 3.17 and the fact that ν1≥ν2≥ · · · ≥ νn≥0, the following result holds. I(AM,Dν)= {(α, β)|(β, α +nβνn≥0) or (β≤0and α+nβν1≤0)}. Proposition 3.19. Let νbe strict. Then, we have I(Dν,Sν)= {(α, β)|α, ανn+β≥0}. 3.5. CombPool layer: Combinations of increasing functions as pooling functions Based on the previous theoretical developments, we now proceed to introduce a replacement for the classic max and average pooling layers, which we refer to as CombPool layer. Its process is as follows: we initially choose rincreasing functions A1,...,Ar such that Ai:Rn→R,for all i=1,...,rand generate r coefficients α1, α2, . . . , αr∈R, αi≥0,for all i=1,...,r. Then, when reducing all x=(x1,...,xn) values of each disjoint window of size k1×k2, with k1·k2=n, of a feature image channel Xc, the nincreasing functions are used, generating n different outputs y1,y2,...,yn. The combined output produced by our layer is calculated as the result of the following increasing function combination: y= r ∑ i=1 α2 i·Ai(x)= r ∑ i=1 α2 i·yi(2) An example of the resulting pooling process is represented in Fig. 1. Coefficients α1, . . . , αrare set as additional parameters of the model, in the same way as the weights of a multilayer perceptron or the kernels of a CNN. In this way we can take profit of the backpropagation algorithm of neural networks in order to finetune their values. Notice that, in order to ensure that the resulting pooling function is increasing, we do not weight each output yi with αi, but with its squared value, a strategy that satisfies that monotonicity and differentiability hold for all possible combinations without needing to impose constraints to the learning process of αi. Despite some of the Propositions in Sections 3.1– 3.4 allowing for different parameterizations for the combinations to remain increasing, we find the strategy of squaring the coefficients to be the most efficient one. The conditions required by Propositions 3.5,3.6,3.10,3.11,3.17,Corollary 3.18 and Proposition 3.19, which cover all the combinations considered in our experimentation, are all satisfied following this approach. Although learning a different set of coefficients for each window of the input is a valid approach, there are different strategies we can follow in order to reduce the number of learnable parameters of the resulting model, and therefore its complexity. We have tested the following options for each αicoefficient, based on the approach presented in Lee et al. (2018): the same parameter for all windows and channels in the same layer; a different parameter for each independent window (shared among all channels); a different parameter for each channel (shared for each independent window); a different parameter for each channel and independent window. In the end, however, results do not differ enough as to justify taking all combinations into account, and we have decided to report the models that use a different coefficient for each channel (shared by all windows), which appears to be a good compromise between representability capacity for the model and number of extra parameters. If the increasing property of CombPool layers were to be dropped, the exponent of the coefficients could be removed from Eq. (2), and any function Rn→Rcould be applied as function Ai. However, examples following this approach usually yield worse results. As a rather informal example, take Fig. 2. Here we have tested the performance of the same model on the same dataset when setting the function F(x)=αmax x+ β1 n∑n i=1xias pooling function. Instead of setting αand βas learnable parameters, we fix them to one of the values in {−1, −0.5, −0.1, 1}. The best results are obtained when both values are fixed to 1, which corresponds to the only increasing function out of all of them, and that accuracy rates tend to worsen the ‘‘more decreasing’’ the function becomes with respect to one of its terms. 4. Experimental framework We now present the models and datasets which have been used to test the effectiveness of the CombPool layer. 4.1. Deep learning architectures We have tested the effect of replacing the classic pooling layers of several different well known architectures by the CombPool layer presented in Section 3.5. We have chosen representative 384
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 Fig. 1. Example of the combination of pooling functions. We compute rreductions for each different window, which are afterwards weighted by rparameters α∈R. Fig. 2. Results obtained for different combinations of αand βwhen setting the values of the pooling function F(x)=αmax x+β1 n∑n i=1xifor the same experimental setting as one of the values in {−1, −0.5, −0.1, 1}. Results worsen the ‘‘more negative’’ one of the terms becomes. models of exponentially increasing parameter count and overall complexity, to test the effectiveness of CombPool layers on different contexts. In this way, we intend to get an intuition on whether CombPool layers may be more beneficial on simpler or more complex learning tasks. The chosen models have been the following ones: •Architecture 1: LeNet-5 The structure of this network, presented in LeCun et al. (1998) is the one associated with the canonical CNN. It is composed of two blocks of convolution and pooling layers (traditionally average pooling), followed by a 3 layer perceptron which acts as classifier. We have set the ReLU function as activation function for the hidden layers and the Softmax function for the output layer. We have also inserted ‘‘Batch Normalization’’ layers after each pooling layer (Ioffe & Szegedy,2015) in order to improve model convergence and mitigate overfitting. The architecture is detailed in Table 1. •Architecture 2: Network in Network This architecture is identical to the one presented in Lee et al. (2018), and we have tested it because of the similarity between our proposals. It is based, in turn, in the concept of ‘‘Network in Network’’ models, which replace convolution layers by multilayer perceptrons (i.e. universal function approximators) and the final classifier by a Global Average Pooling layer (Lin, Chen, & Yan,2014). Furthermore, this architecture version includes ‘‘hidden layer supervision’’ (Lee, Xie, Gallagher, Zhang, & Tu,2015), a strategy which includes several classifiers at different points through the network in order to reinforce the gradient flow during training time and alleviate the ‘‘vanishing gradient’’ problem which deep models tend to suffer. Details of the architecture are available in Table 2. •Architecture 3: DenseNet This CNN is a direct adaptation of the DenseNet architecture presented in Huang et al. (2017), and we have chosen it for being a clear representative of modern deep CNNs, composed by dozens of layers grouped in similar ‘‘blocks’’. DenseNets iterate on the concept of identity connections which ResNet architectures include as a mean to mitigate vanishing gradients, connecting the output of a layer with the input of the two following ones. In the case of DenseNet, each layer is connected with all the following ones. DenseNet networks are composed of a series of ‘‘dense blocks’’, formed by repetitions of Batch Normalization, ReLU, Convolutional and, optionally, Dropout layers (Srivastava, Hinton, Krizhevsky, Sutskever, & Salakhutdinov,2014). Since the output of each layer is processed by all the remaining layers, the authors refer by the factor kto the number of feature images which each convolutional layer adds to the ‘‘global knowledge’’ of the network. In order to avoid the number of filters of each following layer to keep increasing, 1×1 convolutions are set before each convolutional layer, in order to fix the size of these filters to a certain size. Pooling layers are added between every two dense blocks in order to progressively reduce the extracted feature dimensionality. 1 ×1 convolutions can be added again in order to reduce the number of channels of the global knowledge of the network Gby a factor θ.Table 3 sums up the architecture. 385
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 Table 1 Architecture 1 description. Layer type Output size Kernel size Conv1 32 ×32 ×64 3 ×3 ReLU 32 ×32 ×64 – Pool1 16 ×16 ×64 2 ×2 BatchNorm1 16 ×16 ×64 – Conv2 16 ×16 ×64 3 ×3 ReLU 16 ×16 ×64 – Pool2 8 ×8×64 2 ×2 BatchNorm2 8 ×8×64 – Flatten 4096 – MLP1 384 – MLP2 192 – MLP3 10 – Table 2 Architecture 2 description. The output of the layers named ‘‘HLSupervision’’ are not used as input for the following layer, but output as a prediction vector that will be taken into account when computing the value of the loss function. The following layer takes its input from the layer previous to the ‘‘HLSupervision’’ one. Layer type Output size Kernel size Conv1 32 ×32 ×128 3 ×3 ReLU 32 ×32 ×128 – HLSupervision1 10 – Conv2 32 ×32 ×128 3 ×3 ReLU 32 ×32 ×128 – HLSupervision2 10 – Mlpconv1 32 ×32 ×128 1 ×1 Pool1 16 ×16 ×128 3 ×3 Conv3 16 ×16 ×192 3 ×3 ReLU 16 ×16 ×192 – HLSupervision3 10 – Conv4 16 ×16 ×192 3 ×3 ReLU 16 ×16 ×192 – HLSupervision4 10 – Mlpconv2 16 ×16 ×192 1 ×1 Pool2 8 ×8×192 3 ×3 Conv5 8 ×8×256 3 ×3 ReLU 8 ×8×256 – HLSupervision5 10 – Conv6 8 ×8×256 3 ×3 ReLU 8 ×8×256 – HLSupervision6 10 – Mlpconv3 8 ×8×256 1 ×1 Mlpconv4 8 ×8×10 1 ×1 GlobalAvgPool 10 8 ×8 Although our main study focuses on these 3 initial architectures, we have also tested the use of CombPool layers in other currently relevant areas. For these tests, we also consider the following two architectures: •Architecture 4: RegNetX The authors of Radosavovic, Kosaraju, Girshick, He, and Dollár (2020) focused, not in presenting a particular architecture, but a method for statistically searching for the most effective architecture design decisions. They started studying a family of models based on the RESNet architecture, and progressively restricted the model until reaching a family of models named RegNetX. The specific details of the research goes beyond the scope of this work and can be found in the original paper. Interestingly, RegNetX models dispense with pooling layers, similarly to other current models such as RESNet, MobileNet (Howard et al.,2017) and EfficientNet (Tan & Le, 2019). Instead, they perform feature downsampling through convolution layers with stride bigger than 1. However, most of these architectures do use Global Average Pooling layers, which aggregate all the values on each output channel Table 3 Description of the third architecture. krepresents the growth rate of the network, which has been set to 12. Gspecifies the number of global knowledge channels up until each layer, and increases by kafter each convolution of a dense block. We explicitly represent the compression of this global knowledge indicating at the output of the transition block convolutions that the number of feature images becomes G/2, since we set θ=0.5. However, we return to using Gon following layers in favour of clearer notation. Layer type Output size Kernel size Initial block Conv 32 ×32 ×2k3×3 BatchNorm 32 ×32 ×2k– ReLU 32 ×32 ×2k– Dense block 1 (×16) BatchNorm 32 ×32 ×G– ReLU 32 ×32 ×G– Conv 32 ×32 ×4k1×1 BatchNorm 32 ×32 ×4k– ReLU 32 ×32 ×4k– Conv 32 ×32 ×k3×3 Transition block 1 BatchNorm 32 ×32 ×G ReLU 32 ×32 ×G Conv 32 ×32 ×G/2 1 ×1 Pool 16 ×16 ×G/2 Dense block 2 (×16) BatchNorm 16 ×16 ×G– ReLU 16 ×16 ×G– Conv 16 ×16 ×4k1×1 BatchNorm 16 ×16 ×4k– ReLU 16 ×16 ×4k– Conv 16 ×16 ×k3×3 Transition block 2 BatchNorm 16 ×16 ×G ReLU 16 ×16 ×G Conv 16 ×16 ×G/2 1 ×1 Pool 8 ×8×G/2 Dense block 3 (×16) BatchNorm 8 ×8×G– ReLU 8 ×8×G– Conv 8 ×8×4k1×1 BatchNorm 8 ×8×4k– ReLU 8 ×8×4k– Conv 8 ×8×k3×3 GlobalAvgPool G8×8 MLP 10 – through the arithmetic mean. We have tested if the replacement of Global Average Pooling by Global CombPool layers could be of interest for its consideration in these architectures. For our experiments, we have worked with the RegNetX- 200MF version. All hyperparameters are kept the same with respect to the original paper, with the difference that we work with smaller image sizes. •Architecture 5: Scalable Vision Transformer The original transformer architecture was presented in Vaswani et al. (2017) and has seen huge success in the Natural Language Processing (NLP) domain, with results as impressive as those of Brown et al. (2020) and Devlin, Chang, Lee, and Toutanova (2018), among others. It is based on the concept of ‘‘self-attention’’, a mechanism by which the relationship between the different values of an input is weighted, in order to give more importance to the most relevant ones. In the context of NLP, this would allow to measure the relationship between every pair of words in a sentence, according to a given objective. Actually, transformers use ‘‘multi-head attention’’ layers, which perform the previous process multiple times, each one focusing on a particular feature of the input. Similarly to DenseNets or ResNets, transformers are composed of a concatenation of similar blocks which perform the same operations. A detailed explanation of the architecture goes beyond the scope of this paper, and can be found in Dosovitskiy et al. (2020). 386
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 Table 4 Datasets MNIST (LeCun et al.,1998), Fashion-MNIST (Xiao, Rasul, & Vollgraf, 2017), EMNIST (Cohen, Afshar, Tapson, & van Schaik,2017), CIFAR10 and CIFAR100 (Krizhevsky, Hinton, et al.,2009) used in the experimental part. By ‘‘balanced’’ EMNIST we refer to the balanced partition of all the available subsets of the EMNIST dataset. Dataset Train Test Classes Colour Description MNIST 60000 10000 10 No Digits from 0 to 9 Fashion MNIST 60000 10000 10 No Clothing categories Balanced EMNIST 112800 18800 47 No Digits and characters CIFAR10 50000 10000 10 Yes Real life images CIFAR100 50000 10000 100 Yes Real life images NLP Transformers split an input sentence into parts and encode each of them generating a different input ‘‘token’’. In Dosovitskiy et al. (2020), the authors propose an adaptation of this strategy to work on image data instead, which they refer to as Vision Transformer (ViT). Unlike CNNs which work with whole images, for ViT inputs are previously split into disjoint patches which are encoded to generate the distinct input tokens. These input tokens are afterwards sequentially processed via a series of blocks of layers until obtaining the probability vector which can be used to classify the image. In our experiments we have worked with a particular implementation of ViT, known as Hierarchical Visual Transformer (HVT) which appends pooling layers between the different blocks of the transformer (Pan, Zhuang, Liu, He, & Cai,2021). Outputs are sequentially reduced in dimensionality, and the later blocks operate over the reduced feature vectors. Our preliminary results are presented in Section 5.5. All models have been optimized via stochastic gradient descent with momentum and L2 regularization, setting Cross Entropy as loss function. We use batch sizes of 128 samples. 4.2. Datasets The performance of all the different models has been evaluated on the datasets presented in Table 4. All models have been trained for 50 epochs over all datasets but CIFAR10/CIFAR100, in which they have been trained for 200 epochs. Architecture 3, due to its significantly higher amount of parameters, has been trained for 300 epochs over that same dataset. In order to try to limit the influence of stochastic initialization over our final results, each model has been independently trained 5 times and we report their mean accuracy, with the exception of the third architecture over datasets other than CIFAR10/CIFAR100. We consider that the variance over the results obtained for those datasets with that architecture were so small that it did not justify the computational and temporal cost required. 5. Experimental study In this section we test the effectiveness of the CombPool layer. We compare the differences among the different combinations, as well as with models that use individual functions as their pooling method, including the classic maximum and average pooling. Additionally, we include results obtained with other pooling methods presented in Section 2.2, namely stochastic and gated pooling. Stochastic pooling replaces the deterministic behaviour of max pooling by randomly choosing one of the input values, sampling from a multinomial distribution constructed from those values. Gated pooling computes a combination of pooling functions through a convex combination of the type F(x)=αA1(x)+βA2(x), with the difference that αand βare computed as the result of a linear transformation of the values in x. In that sense, rather than learning those parameters directly, the coefficients of the linear transformations are learnt. Whenever the Sugeno integral Sνor its Dνgeneralization is used, we set the ‘‘power measure’’ νpm given by νpm = |X|q/n for all X⊆Nas ν, a well known fuzzy measure which has been used with success in plenty of applications (Bardozzo et al.,2021; Lucca et al.,2019). Notice that, as commented in Remarks 3.15, in order for Dνto be well defined, νmust be symmetrical, which νpm satisfies. We have set the value of q=2 based on the results of preliminary tests and previous experience in other domains. 5.1. Pooling by means of individual functions Initially, we tested several models that use a single function for the pooling process. Apart from average and maximum pooling, we have tested the minimum, the median, the Sugeno integral and the Dνgeneralization. The test results are shown in Table 5. Although for both architectures 1 and 3 the best results are obtained with either the arithmetic mean or the maximum, it is interesting noting how for architecture 2, the generalization of the Sugeno integral performs the best for most datasets. In fact, as will be shown later, these options outperform even the combination of maximum and arithmetic mean, which is the one presented in Lee et al. (2018). However, in other cases, such as for the architecture 3 on CIFAR10 and CIFAR100, the Dνgeneralization is the one that performs the worst, which lets clear that the best function is both architecture and dataset dependant. Another conclusion is that the more complex models seem to have higher adaptability to non-standard functions whereas architecture 1 performs by far the best when using either average or maximum pooling, specially when faced with more complex datasets. Notice that, when considering the results obtained on CIFAR10 or CIFAR100, the only accuracy rates close to the ones reported when using the maximum or the average, are both versions of the Sugeno integral on CIFAR100, which perform marginally worse nonetheless. This might be due to the fact that the higher number of parameters of the rest of models allows them to model more complex functions which can adapt more easily to other pooling functions. 5.2. Pooling using combinations of increasing functions We have repeated the previous experimentation replacing the individual pooling layers by CombPool layers, testing plenty of increasing function combinations. The accuracy rate for all models and datasets is presented in Table 6. As stated in the previous section, architecture 1 has difficulty adapting to non-standard pooling functions. It is specially noteworthy for datasets EMNIST, CIFAR10 and CIFAR100, the hardest ones, where it only provides comparable results when one of the standard functions is part of the combination. Similarly, for the MNIST and FASHION dataset, most models offer results close to the individual variants, with the combinations that include the Dνgeneralization performing the best in average. Specifically, architecture 2 obtains the best result of any combination when using some of them. If we focus on architecture 3, for datasets EMNIST and CIFAR10 all groups of combinations manage to outperform the best individual accuracy obtained using the arithmetic mean. In particular, combining the Dνgeneralization with the arithmetic mean obtains the best results for CIFAR10, while combining it with the maximum offers the second best accuracy over EMNIST, only slightly behind the combination of the Dνintegral and the arithmetic mean. For CIFAR100 none of the combinations 387
I. Rodriguez-Martinez, J. Lafuente, R.H.N. Santiago et al. Neural Networks 152 (2022) 380–393 Table 5 Accuracy rate for architectures that use individual functions. Column Ai indicates references results obtained with the ith architecture. MNIST FASHION EMNIST CIFAR10 CIFAR100 A1 A2 A3 A1 A2 A3 A1 A2 A3 A1 A2 A3 A1 A2 A3 AM 99.37 99.09 99.10 93.24 91.81 93.79 87.58 88.59 89.52 77.08 87.65 89.25 46.55 54.72 70.78 Max 99.24 99.39 99.34 92.80 92.99 92.92 87.31 89.11 89.27 77.39 87.85 87.99 45.68 57.58 68.48 Min 98.98 99.38 99.27 92.13 93.03 92.99 86.22 89.05 89.40 70.24 87.61 88.28 42.26 51.72 68.86 Median 98.98 99.17 99.03 91.80 92.28 93.48 86.58 88.81 89.31 70.62 87.07 88.76 39.29 51.65 69.58 Sν99.14 99.24 99.39 92.01 92.07 93.56 86.51 88.71 89.44 72.47 86.79 88.97 44.73 54.71 68.42 Dν99.26 99.46 99.08 93.05 92.67 92.86 86.64 89.27 89.31 73.42 88.70 87.20 43.52 54.11 68.97 Table 6 Accuracy rate for models that replace classic max and mean pooling layers by CombPool layers. Each row presents the obtained result for a given combination of functions. Combinations have been grouped according to the order in which they have been presented in Section 3. MNIST FASHION EMNIST CIFAR10 CIFAR100 A1 A2 A3 A1 A2 A3 A1 A2 A3 A1 A2 A3 A1 A2 A3 Min + Max 99.30 99.30 99.02 92.56 91.91 92.77 87.31 88.68 89.26 77.02 87.42 88.55 45.64 55.14 68.8 Min + Max + Median 99.30 99.21 99.14 92.63 91.93 93.51 87.52 88.50 89.62 76.91 87.43 89.77 45.35 55.84 70.21 AM + Min 99.30 99.27 99.11 92.41 92.13 92.59 86.97 88.66 89.57 75.04 87.23 89.48 45.22 45.22 69.83 AM + Max 99.32 99.25 99.27 92.86 92.47 93.63 87.35 88.43 89.62 77.23 87.78 86.99 45.80 55.43 70.19 AM + Min + Max 99.30 99.25 99.35 92.68 91.91 92.99 87.14 88.86 89.75 77.17 87.25 88.52 45.78 55.79 69.40 AM + Min + Max + Median 99.33 99.26 99.29 92.72 92.17 92.85 87.34 88.91 89.22 77.04 87.57 89.83 46.27 55.98 69.95 Sν+ Min 99.07 99.27 99.24 92.23 92.18 93.25 86.49 88.53 89.26 72.41 87.46 88.58 43.50 54.35 68.24 Sν+ Max 99.22 99.43 99.43 92.96 92.39 93.19 87.11 88.52 89.66 77.09 87.60 89.48 46.37 54.83 67.66 Sν+ Min + Max 99.27 99.36 99.45 92.71 92.01 93.18 87.33 88.87 89.41 77.30 87.01 89.42 46.29 55.71 69.43 Sν+ Min + Max + Median 99.24 99.27 98.95 92.78 92.04 93.36 87.10 88.83 89.49 77.03 87.29 89.66 45.68 56.08 70.04 Sν+ AM 99.34 99.21 99.49 93.21 91.93 93.25 87.07 88.35 90.03 76.93 88.23 86.99 46.46 53.92 70.00 Dν+ Min 99.21 99.33 99.15 92.23 92.60 92.78 86.15 88.77 89.09 72.19 88.51 89.03 42.94 55.44 69.45 Dν+ Max 99.28 99.27 99.22 92.80 92.55 93.32 86.95 89.09 89.97 76.80 88.20 89.58 46.16 55.97 69.25 Dν+ Min + Max 99.27 99.38 99.27 92.66 92.53 92.69 87.37 88.69 89.46 77.81 88.61 89.83 45.78 55.73 70.31 Dν+ Min + Max + Median 99.32 99.35 99.22 92.87 92.57 93.79 87.46 89.06 89.85 76.15 88.30 89.75 45.19 55.77 69.98 Dν+ AM 99.32 99.35 99.39 92.69 92.56 93.21 87.37 88.40 89.61 76.39 88.40 89.87 44.89 55.04 69.56 Stochastic 99.34 99.35 99.53 92.49 92.17 93.64 87.45 88.91 89.81 77.43 87.29 91.57 47.77 58.18 70.68 Gated 99.33 99.35 99.51 92.91 92.03 93.12 87.23 88.27 89.71 77.43 88.61 90.41 46.38 57.26 69.99 outperform the arithmetic mean, but combinations with the Dν generalization still offer competitive results. We have also compared our results with both stochastic and gated pooling, which perform on par with the best functions, even though there is some important variance on simpler datasets. As previously stated, architecture 3 is the one which benefits the most from using non-standard pooling functions, and both methods show clear superior results for dataset CIFAR10. The comparison with gated pooling is not completely fair however, since we could employ the ‘‘gated’’ strategy for learning the coefficients of our CombPool layers and improve its respective best results. We will test this option in the next subsection. 5.3. Gated CombPool layers Even though our main study focus is the increasing function combinations and not the coefficient learning strategy, results on Table 6 which show a clear higher accuracy for models which employ gated pooling raise the question of whether that strategy can be adapted in CombPool layers. In order to achieve this, we simply replace each coefficient aiby a kernel Wi∈Rk1×k2. Coefficients aiare therefore computed for each different window via the channel-wise convolution of Wiover each window of the input. In order to test if the presented combinations still outperform the average and maximum combination when using gated pooling, we have focused on one of the hardest setups, the one which trains architecture 3 on the CIFAR10 dataset and have trained a model using the Dνgeneralization and arithmetic mean combination, which performs the best when following the mixed strategy. Table 7 shows that using the gated version of this combination increases the accuracy offered by mixed pooling by one point, and the one obtained by the original gated pooling combination by half a point. Table 7 Effect of the ‘‘gated’’ strategy applied to the CombPool layer. We focus on the Dνand arithmetic mean combination, the best combination for the ‘‘mixed’’ strategy in one of the hardest setups (Architecture 3 trained on the CIFAR10 dataset). The responsive nature of ‘‘gated’’ pooling results in improved models for both cases, but the presented combination still surpasses the maximum and arithmetic mean combination in this case. Method Accuracy Mixed AM + Max 86.99 Mixed Dν+ AM 89.87 Gated AM + Max 90.41 Gated Dν+ AM 90.89 5.4. Global CombPool layers Here we explore the modification of another pooling process in CNNs: ‘‘Global pooling’’. Global pooling is similar to classical pooling, with the difference that it is applied to all values of a feature channel at once, aggregating them into a single value. It is applied after the feature extraction process of a CNN in order to either ‘‘flatten’’ the resulting features into a ‘‘feature vector’’ to be fed for the classifier, or substituting the classifier altogether. It was first introduced in Lin et al. (2014) with this latter objective in mind, replacing the Multilayer Perceptron of their proposed model by a last convolution layer with as many convolution filters as classes followed by a Global Average Pooling layer. In this context, global pooling had the objective of forcing the last convolution filters of the model to learn transformations directly associated with each of the predicted classes, so that each one would search for the most representative feature of a given class. 388