DEEP CHARACTER-LEVEL NEURAL MACHINE TRANSLATION BY LEARNING MORPHOLOGY
Neural machine translation aims at building a single large neural network that can be trained to maximize translation performance. The encoder-decoder architecture with an attention mechanism achieves a translation performance comparable to the existing state-of-the-art phrase-based systems. However, the use of large vocabulary becomes the bottleneck in both training and improving the performance. In this paper, we propose a novel architecture which learns morphology by using two recurrent networks and a hierarchical decoder which translates at character level. This gives rise to a deep character-level model consisting of six recurrent networks. Such a deep model has two major advantages. It avoids the large vocabulary issue radically; at the same time, it is more efficient in training than word-based models. Our model obtains a higher BLEU score than the bpe-based model after training for one epoch on En-Fr and En-Cs translation tasks. Further analyses show that our model is able to learn morphology.
1 INTRODUCTION
Neural machine translation (NMT) attempts to build a single large neural network that reads a sentence and outputs a translation (Sutskever et al., 2014). Most of the extant neural machine translations models belong to a family of word-level encoder-decoders (Sutskever et al., 2014; Cho et al., 2014). Recently, Bahdanau et al. (2015) proposed a model with attention mechanism which automatically searches the alignments and greatly improves the performance. However, the use of a large vocabulary seems necessary for the word-level neural machine translation models to improve performance (Sutskever et al., 2014; Cho et al., 2015).
Chung et al. (2016a) listed three reasons behind the wide adoption of word-level modeling: (i) word is a basic unit of a language, (ii) data sparsity, (iii) vanishing gradient of character-level modeling. Consider that a language itself is an evolving system. So it is impossible to cover all words in the language. The problem of rare words that are out of vocabulary (OOV) is a critical issue which can effect the performance of neural machine translation. In particular, using larger vocabulary does improve performance (Sutskever et al., 2014; Cho et al., 2015). However, the training becomes much harder and the vocabulary is often filled with many similar words that share a lexeme but have different morphology.
There are many approaches to dealing with the out-of-vocabulary issue. For example, Gulcehre et al. (2016); Luong et al. (2015); Cho et al. (2015) proposed to obtain the alignment information of target unknown words, after which simple word dictionary lookup or identity copy can be performed to replace the unknown words in translation. However, these approaches ignore several important properties of languages such as monolinguality and crosslinguality as pointed out by Luong and
Manning (2016). Thus, Luong and Manning (2016) proposed a hybrid neural machine translation model which leverages the power of both words and characters to achieve the goal of open vocabulary neural machine translation.
Intuitively, it is elegant to directly model pure characters. However, as the length of sequence grows significantly, character-level translation models have failed to produce competitive results compared with word-based models. In addition, they require more memory and computation resource. Especially, it is much difficult to train the attention component. For example, Ling et al. (2015a) proposed a compositional character to word (C2W) model and applied it to machine translation (Ling et al., 2015b). They also used a hierarchical decoder which has been explored before in other context (Serban et al., 2015). However, they found it slow and difficult to train the character-level models, and one has to resort to layer-wise training the neural network and applying supervision for the attention component. In fact, such RNNs often struggle with separating words that have similar morphologies but very different meanings.
In order to address the issues mentioned earlier, we introduce a novel architecture by exploiting the structure of words. It is built on two recurrent neural networks: one for learning the representation of preceding characters and another for learning the weight of this representation of the whole word. Unlike subword-level model based on the byte pair encoding (BPE) algorithm (Sennrich et al., 2016), we learn the subword unit automatically. Compared with CNN word encoder (Kim et al., 2016; Lee et al., 2016), our model is able to generate a meaningful representation of the word. To decode at character level, we devise a hierarchical decoder which sets the state of the second-level RNN (character-level decoder) to the output of the first-level RNN (word-level decoder), which will generate a character sequence until generating a delimiter. In this way, our model almost keeps the same encoding length for encoder as word-based models but eliminates the use of a large vocabulary. Furthermore, we are able to efficiently train the deep model which consists of six recurrent networks, achieving higher performance.
In summary, we propose a hierarchical architecture (character -> subword -> word -> source sentence -> target word -> target character) to train a deep character-level neural machine translator. We show that the model achieves a high translation performance which is comparable to the state-of-the-art neural machine translation model on the task of En-Fr, En-Cs and Cs-En translation. The experiments and analyses further support the statement that our model is able to learn the morphology.
2 NEURAL MACHINE TRANSLATION
Neural machine translation is often implemented as an encoder-decoder architecture. The encoder usually uses a recurrent neural network (RNN) or a bidirectional recurrent neural network (BiRNN) (Schuster and Paliwal, 1997) to encode the input sentence x = {x1, . . . , xTx} into a sequence of hidden states h = {h1, . . . ,hTx}:
ht = f1(e(xt),ht−1),
where e(xt) ∈ Rm is an m-dimensional embedding of xt. The decoder, another RNN, is often trained to predict next word yt given previous predicted words {y1, . . . , yt−1} and the context vector ct; that is, p(yt | {y1, . . . , yt−1}) = g(e(yt−1), st, ct), where
st = f2(e(yt−1), st−1, ct) (1) and g is a nonlinear and potentially multi-layered function that computes the probability of yt. The context ct depends on the sequence of {h1, . . . ,hTx}. Sutskever et al. (2014) encoded all information in the source sentence into a fixed-length vector, i.e., ct = hTx . Bahdanau et al. (2015) computed ct by the alignment model which handles the bottleneck that the former approach meets.
The whole model is jointly trained by maximizing the conditional log-probability of the correct translation given a source sentence with respect to the parameters of the model θ:
θ∗ = argmax θ Ty∑ t=1 log p(yt | {y1, . . . , yt−1},x,θ).
For the detailed description of the implementation, we refer the reader to the papers (Sutskever et al., 2014; Bahdanau et al., 2015).
3 DEEP CHARACTER-LEVEL NEURAL MACHINE TRANSLATION
We consider two problems in the word-level neural machine translation models. First, how can we map a word to a vector? It is usually done by a lookup table (embedding matrix) where the size of vocabulary is limited. Second, how do we map a vector to a word when predicting? It is usually done via a softmax function. However, the large vocabulary will make the softmax intractable computationally.
We correspondingly devise two novel architectures, a word encoder which utilizes the morphology and a hierarchical decoder which decodes at character level. Accordingly, we propose a deep character-level neural machine translation model (DCNMT).
3.1 LEARNING MORPHOLOGY IN A WORD ENCODER
Many words can be subdivided into smaller meaningful units called morphemes, such as “any-one”, “any-thing” and “every-one.” At the basic level, words are made of morphemes which are recognized as grammatically significant or meaningful. Different combinations of morphemes lead to different meanings. Based on these facts, we introduce a word encoder to learn the morphemes and the rules of how they are combined. Even if the word encoder had never seen “everything” before, with a understanding of English morphology, the word encoder could gather the meaning easily. Thus learning morphology in a word encoder might speedup training.
The word encoder is based on two recurrent neural networks, as illustrated in Figure 1. We compute the representation of the word ‘anyone’ as
ranyone = tanh( 6∑ t=1 wtrt),
where rt is an RNN hidden state at time t, computed by
rt = f(e(xt), rt−1).
Each rt contains information about the preceding characters. The weight wt of each representation rt is computed by
wt = exp(aff(ht)),
where ht is another RNN hidden state at time t and aff() is an affine function which maps ht to a scalar. Here, we use a BiRNN to compute ht as shown in Figure 1. Instead of normalizing it by ∑ t exp(aff(ht)), we use an activation function tanh as it performs best in experiments.
We can regard the weight wi as the energy that determines whether ri is a representation of a morpheme and how it contributes to the representation of the word. Compared with an embedding lookup table, the decoupled RNNs learn the representation of morphemes and the rules of how they are combined respectively, which may be viewed as learning distributed representations of words explicitly. For example, we are able to translate “convenienter” correctly which validates our idea.
After obtaining the representation of the word, we could encode the sentence using a bidirectional RNN as RNNsearch (Bahdanau et al., 2015). The detailed architecture is shown in Figure 2.
3.2 HIERARCHICAL DECODER
To decode at the character level, we introduce a hierarchical decoder. The first-level decoder is similar to RNNsearch which contains the information of the target word. Specifically, st in Eqn. (1) contains the information of target word at time t. Instead of using a multi-layer network following a softmax function to compute the probability of each target word using st, we employ a second-level decoder which generates a character sequence based on st.
We proposed a variant of the gate recurrent unit (GRU) (Cho et al., 2014; Chung et al., 2014) that used in the second-level decoder and we denote it as HGRU (It is possible to use the LSTM (Hochreiter
and Schmidhuber, 1997) units instead of the GRU described here). HGRU has a settable state and generates character sequence based on the given state until generating a delimiter. In our model, the state is initialized by the output of the first-level decoder. Once HGRU generates a delimiter, it will set the state to the next output of the first-level decoder. Given the previous output character sequence {y0, y1, . . . , yt−1} where y0 is a token representing the start of sentence, and the auxiliary sequence {a0, a1, . . . , at−1} which only contains 0 and 1 to indicate whether yi is a delimiter (a0 is set to 1), HGRU updates the state as follows:
gt−1 = (1− at−1)gt−1 + at−1sit , (2) qjt = σ([Wqe(yt−1)] j + [Uqgt−1] j), (3)
zjt = σ([Wze(yt−1)] j + [Uzgt−1] j), (4)
g̃jt = φ([We(yt−1)] j + [U(qt gt−1)]j), (5)
gjt = z j tg j t−1 + (1− z j t )g̃ j t , (6)
where sit is the output of the first-level decoder which calculated as Eqn. (8). We can compute the probability of each target character yt based on gt with a softmax function:
p(yt | {y1, . . . , yt−1},x) = softmax(gt). (7)
The current problem is that the number of outputs of the first-level decoder is much fewer than the target character sequence. It will be intractable to conditionally pick outputs from the the first-level decoder when training in batch manner (at least intractable for Theano (Bastien et al., 2012) and other symbolic deep learning frameworks to build symbolic expressions). Luong and Manning (2016) uses two forward passes (one for word-level and another for character-level) in batch training which is less efficient. However, in our model, we use a matrix to unfold the outputs of the first-level decoder, which makes the batch training process more efficient. It is a Ty × T matrix R, where Ty is the number of delimiter (number of words) in the target character sequence and T is the length of the target character sequence. R[i, j1 + 1] to R[i, j2] are set as 1 if j1 is the index of the (i−1)-th delimiter and j2 is the index of the i-th delimiter in the target character sequence. The index of the 0-th delimiter is set as 0. For example, when the target output is “g o ! ” and the output of the first-level decoder is [s1, s2], the unfolding step will be:
[s1, s2] [ 1 1 1 0 0 0 0 0 1 1 ] = [s1, s1, s1, s2, s2],
therefore {si1 , si2 , si3 , si4 , si5} is correspondingly set to {s1, s1, s1, s2, s2} in HGRU iterations. After this procedure, we can compute the probability of each target character by the second-level decoder according to Eqns. (2) to (7).
3.3 MODEL ARCHITECTURES
There are totally six recurrent neural networks in our model, which can be divided into four layers as shown in Figure 2. Figure 2 illustrates the training procedure of a basic deep character-level neural machine translation. It is possible to use multi-layer recurrent neural networks to make the model deeper. The first layer is a source word encoder which contains two RNNs as shown in Figure 1. The second layer is a bidirectional RNN sentence encoder which is identical to that of (Bahdanau et al., 2015). The third layer is the first-level decoder. It takes the representation of previous target word as a feedback, which is produced by the target word encoder in our model. As the feedback is less important, we use an ordinary RNN to encode the target word. The feedback rYt−1 then combines the previous hidden state ut−1 and the context ct from the sentence encoder to generate the vector st:
st = W1ct +W2rYt−1 +W3ut−1 + b. (8)
With the state of HGRU in the second-level decoder setting to st and the information of previous generated character, the second-level decoder generates the next character until generating an end of sentence token (denoted as </s> in Figure 2). With such a hierarchical architecture, we can train our character-level neural translation model perfectly well in an end-to-end fashion.
3.4 GENERATION PROCEDURE
We first encode the source sequence as in the training procedure, then we generate the target sequence character by character based on the output st of the first-level decoder. Once we generate a delimiter, we should compute next vector st+1 according to Eqn. (8) by combining feedback rYt from the target word encoder, the context ct+1 from the sentence encoder and the hidden state ut. The generation procedure will terminate once an end of sentence (EOS) token is produced.
4 EXPERIMENTS
We implement the model using Theano (Bergstra et al., 2010; Bastien et al., 2012) and Blocks (van Merriënboer et al., 2015), the source code and the trained models are available at github 1. We train our model on a single GTX Titan X with 12GB RAM. First we evaluate our model on English-toFrench translation task where the languages are morphologically poor. For fair comparison, we use the same dataset as in RNNsearch which is the bilingual, parallel corpora provided by ACL WMT’14. In order to show the strengths of our model, we conduct on the English-to-Czech and Czech-to-English translation tasks where Czech is a morphologically rich language. We use the same dataset as (Chung et al., 2016a; Lee et al., 2016) which is provided by ACL WMT’152.
4.1 DATASET
We use the parallel corpora for two language pairs from WMT: En-Cs and En-Fr. They consist of 15.8M and 12.1M sentence pairs, respectively. In terms of preprocessing, we only apply the usual tokenization. We choose a list of 120 most frequent characters for each language which coveres nearly 100% of the training data. Those characters not included in the list are mapped to a special token
1https://github.com/SwordYork/DCNMT 2http://www.statmt.org/wmt15/translation-task.html
(<unk>). We use newstest2013(Dev) as the development set and evaluate the models on newstest2015 (Test). We do not use any monolingual corpus.
4.2 TRAINING DETAILS
We follow (Bahdanau et al., 2015) to use similar hyperparameters. The bidirectional RNN sentence encoder and the hierarchical decoder both consists of two-layer RNNs, each has 1024 hidden units; We choose 120 most frequent characters for DCNMT and the character embedding dimensionality is 64. The source word is encoded into a 600-dimensional vector. The other GRUs in our model have 512 hidden units.
We use the ADAM optimizer (Kingma and Ba, 2015) with minibatch of 56 sentences to train each model (for En-Fr we use a minibatch of 72 examples). The learning rate is first set to 10−3 and then annealed to 10−4.
We use a beam search to find a translation that approximately maximizes the conditional logprobability which is a commonly used approach in neural machine translation (Sutskever et al., 2014; Bahdanau et al., 2015). In our DCNMT model, it is reasonable to search directly on character level to generate a translation.
5 RESULT AND ANALYSIS
We conduct comparison of quantitative results on the En-Fr, En-Cs and Cs-En translation tasks in Section 5.1. Apart from measuring translation quality, we analyze the efficiency of our model and effects of character-level modeling in more details.
5.1 QUANTITATIVE RESULTS
We illustrate the efficiency of the deep character-level neural machine translation by comparing with the bpe-based subword model (Sennrich et al., 2016) and other character-level models. We measure the performance by BLEU score (Papineni et al., 2002).
In Table 1, “Length” indicates the maximum sentence length in training (based on the number of words or characters), “Size” is the total number of parameters in the models. We report the BLEU
scores of DCNMT when trained after one epoch in the above line and the final scores in the following line. The results of other models are taken from (1)Firat et al. (2016), (3)Chung et al. (2016a), (4)Lee et al. (2016) and (5)Luong and Manning (2016) respectively, except (2) is trained according to Ling et al. (2015b). The only difference between CNMT and DCNMT is CNMT uses an ordinary RNN to encode source words (takes the last hidden state). The training time for (3) and (4) is calculated based on the training speed in (Lee et al., 2016). For each test set, the best scores among the models per language pair are bold-faced. Obviously, character-level models are better than the subword-level models, and our model is comparable to the start-of-the-art character-level models. Note that, the purely character model of (5)(Luong and Manning, 2016) took 3 months to train and yielded +0.5 BLEU points compared to our result. We have analyzed the efficiency of our decoder in Section 3.2. Besides, our model is the simplest and the smallest one in terms of the model size.
5.2 LEARNING MORPHOLOGY
In this section, we investigate whether our model could learn morphology. First we want to figure out the difference between an ordinary RNN word encoder and our word encoder. We choose some words with similar meaning but different in morphology as shown in Figure 3. We could find in Figure 3(a) that the words ending with “ability”, which are encoded by the ordinary RNN word encoder, are jammed together. In contrast, the representations produced by our encoder are more reasonable and the words with similar meaning are closer.
Then we analyze how our word encoder learns morphemes and the rules of how they are combined. We demonstrate the encoding details on “any*” and “every*”. Figure 4(a) shows the energy of each character, more precisely, the energy of preceding characters. We could see that the last character of a morpheme will result a relative large energy (weight) like “any” and “every” in these words. Moreover, even the preceding characters are different, it will produce a similar weight for the same morpheme like “way” in “anyway” and “everyway”. The two-dimensional PCA projection in Figure
4(b) further validates our idea. The word encoder may be able to guess the meaning of “everything” even it had never seen “everything” before, thus speedup learning. More interestingly, we find that not only the ending letter has high energy, but also the beginning letter is important. It matches the behavior of human perception (White et al., 2008).
Moreover, we apply our trained word encoder to Penn Treebank Line 1. Unlike Chung et al. (2016b), we are able to detect the boundary of the subword units. As shown in Figure 5, “consumers”, “monday”, “football” and “greatest” are segmented into “consum-er-s”,“mon-day”, “foot-ball” and “great-est” respectively. Since there are no explicit delimiters, it may be more difficult to detect the subword units.
5.3 BENEFITING FROM LEARNING MORPHOLOGY
As analyzed in Section 5.2, learning morphology could speedup learning. This has also been shown in Table 1 (En-Fr and En-Cs task) from which we see that when we train our model just for one epoch, the obtained result even outperforms the final result with bpe baseline.
Another advantage of our model is the ability to translate the misspelled words or the nonce words. The character-level model has a much better chance recovering the original word or sentence. In Table 2, we list some examples where the source sentences are taken from newstest2013 but we change some words to misspelled words or nonce words. We also list the translations from Google translate 3 and online demo of neural machine translation by LISA.
As listed in Table 2(a), DCNMT is able to translate out the misspelled words correctly. For a word-based translator, it is never possible because the misspelled words are mapped into <unk>
3The translations by Google translate were made on Nov 4, 2016.
token before translating. Thus, it will produce an <unk> token or just take the word from source sentence (Gulcehre et al., 2016; Luong et al., 2015). More interestingly, DCNMT could translate “convenienter” correctly as shown in Table 2(b). By concatenating “convenient” and “er”, we get the comparative adjective form of “convenient” which never appears in the training set; however, our model guessed it correctly based on the morphemes and the rules.
6 CONCLUSION
In this paper we have proposed an hierarchical architecture to train the deep character-level neural machine translation model by introducing a novel word encoder and a multi-leveled decoder. We have demonstrated the efficiency of the training process and the effectiveness of the model in comparison with the word-level and other character-level models. The BLEU score implies that our deep characterlevel neural machine translation model likely outperforms the word-level models and is competitive with the state-of-the-art character-based models. It is possible to further improve performance by using deeper recurrent networks (Wu et al., 2016), training for more epochs and training with longer sentence pairs.
As a result of the character-level modeling, we have solved the out-of-vocabulary (OOV) issue that word-level models suffer from, and we have obtained a new functionality to translate the misspelled or the nonce words. More importantly, the deep character-level is able to learn the similar embedding of the words with similar meanings like the word-level models. Finally, it would be potentially possible that the idea behind our approach could be applied to many other tasks such as speech recognition and text summarization.
A DETAILED DESCRIPTION OF THE MODEL
Here we describe the implementation using Theano, it should be applicable to other symbolic deep learning frameworks. We use f to denote the transition of the recurrent network.
A.1 SOURCE WORD ENCODER
As illustrated in Section 3.1, the word encoder is based on two recurrent neural networks. We compute the representation of the word ‘anyone’ as
ranyone = tanh( 6∑ t=1 wtrt),
where rt ∈ Rn is an RNN hidden state at time t, computed by
rt = f(e(xt), rt−1).
Each rt contains information about the preceding characters. The weight wt of each representation rt is computed by
wt = exp(Wwht + bw),
where Ww ∈ R1×2l maps the vector ht ∈ R2l to a scalar and ht is the state of the BiRNN at time t:
ht = [−→ h t←− h t ] . (9)
−→ h t ∈ Rl is the forward state of the BiRNN which is computed by
−→ h t = f(e(xt), −→ h t−1). (10)
The backward state ←− h t ∈ Rl is computed similarly, however in a reverse order.
A.2 SOURCE SENTENCE ENCODER
After encoding the words by the source word encoder, we feed the representations to the source sentence encoder. For example, the source “Hello world </s>” is encoded into a vector [rHello, rworld, r</s>], then the BiRNN sentence encoder encodes this vector into [v1,v2,v3]. The computation is the same as Eqn. (9) and Eqn. (10), however the input now changes to the representation of the words.
A.3 FIRST-LEVEL DECODER
The first-level decoder is similar to Bahdanau et al. (2015) which utilizes the attention mechanism. Given the context vector ct from encoder, the hidden state ut ∈ Rm of the GRU is computed by
ut = (1− zt) ◦ ut−1 + zt ◦ ũt,
where
ũt = tanh(WrYt−1 +U[qt ◦ ut−1] +Cct) zt = σ(WzrYt−1 +Uzut−1 +Czct)
qt = σ(WqrYt−1 +Uqut−1 +Cqct).
rYt−1 is the representation of the target word which is produced by an ordinary RNN (take the last state). The context vector ct is computed by the attention mechanism at each step:
ct = Tx∑ j=1 αtjvj ,
where
αtj = exp(etj)∑Tx k=1 exp(etk)
etj = E tanh(Weut−1 +Hehj).
E ∈ R1×m which maps the vector into a scalar. Then the hidden state ut is further processed as Eqn. (8) before feeding to the second-level decoder:
st+1 = W1ct+1 +W2rYt +W3ut + b.
A.4 SECOND-LEVEL DECODER
As described in Section 3.2, the number of outputs of the first-level decoder is much fewer than the target character sequence. It will be intractable to conditionally pick outputs from the the first-level decoder when training in batch manner (at least intractable for Theano (Bastien et al., 2012) and other symbolic deep learning frameworks to build symbolic expressions). We use a matrix R ∈ RTy×T to unfold the outputs [s1, . . . , sTy ] of the first-level decoder (Ty is the number of words in the target sentence and T is the number of characters). R is a symbolic matrix in the final loss, it is constructed according the delimiters in the target sentences when training (see Section 3.2 for the detailed construction, note that R is a tensor in batch training. ). After unfolding, the input of HGRU becomes [si1 , . . . , siT ], that is
[si1 , . . . , siT ] = [s1, . . . , sTy ]R.
According to Eqns.(2) to (7), we can compute the probability of each target character :
p(yt | {y1, . . . , yt−1},x) = softmax(gt).
Finally, we could compute the cross-entroy loss and train with SGD algorithm.
B SAMPLE TRANSLATIONS
We show additional sample translations in the following Tables.

Update after reading the authors' responses & the paper revision dated Dec 21:
I have removed the comment "insufficient comparison to past work" in the title & update the score from 3 -> 5.
The main reason for the score is on novelty. The proposal of HGRU & the use of the R matrix are basically just to achieve the effect of "whether to continue from character-level states or using word-level states". It seems that these solutions are specific to symbolic frameworks like Theano (which the authors used) and TensorFlow. This, however, is not a problem for languages like Matlab (which Luong & Manning used) or Torch.
-----
This is a well-written paper with good analysis in which I especially like Figure 5. However I think there is little novelty in this work. The title is about learning morphology but there is nothing specifically enforced in the model to learn morphemes or subword units. For example, maybe some constraints can be put on the weights in w_i in Figure 1 to detect morpheme boundaries or some additional objective like MDL can be used (though it's not clear how these constraints can be incorporated cleanly).
Moreover, I'm very surprised that litte comparison (only a brief mention) was given to the work of (Luong & Manning, 2016) [1], which trains deep 8-layer word-character models and achieves much better results on English-Czech, e.g., 19.6 BLEU compared to 17.0 BLEU achieved in the paper. I think the HGRU thing is over-complicated in terms of presentation. If I read correctly, what HGRU does is basically either continue the character decoder or reset using word-level states at boundaries, which is what was done in [1]. Luong & Manning (2016) even make it more efficient by not having to decode all target words at the morpheme level & it would be good to know the speed of the model proposed in this ICLR submission. What end up new in this paper are perhaps different analyses on what a character-based model learns & adding an additional RNN layer in the encoder.
One minor comment: annotate h_t in Figure 1.
[1] Minh-Thang Luong and Christopher D. Manning. 2016. Achieving Open Vocabulary Neural Machine Translation
with Hybrid Word-Character Models. ACL.


In this paper we propose a scalable version of a state-of-the-art deterministic timeinvariant feature extraction approach based on consecutive changes of basis and nonlinearities, namely, the scattering network. The first focus of the paper is to extend the scattering network to allow the use of higher order nonlinearities as well as extracting nonlinear and Fourier based statistics leading to the required invariants of any inherently structured input. In order to reach fast convolutions and to leverage the intrinsic structure of wavelets, we derive our complete model in the Fourier domain. In addition of providing fast computations, we are now able to exploit sparse matrices due to extremely high sparsity well localized in the Fourier domain. As a result, we are able to reach a true linear time complexity with inputs in the Fourier domain allowing fast and energy efficient solutions to machine learning tasks. Validation of the features and computational results will be presented through the use of these invariant coefficients to perform classification on audio recordings of bird songs captured in multiple different soundscapes. In the end, the applicability of the presented solutions to deep artificial neural networks is discussed.
1 INTRODUCTION AND SCATTERING NETWORK
1.1 BACKGROUND
Invariants are the gems of machine learning enabling key latent space representations of given inputs. Following this analogy, precious invariants shine out by being discriminative enough to detect changes in the underlying data distribution yet with bounded variations to ensure stable and robust representations. The motivation to find informative invariants as latent representations is becoming the principal focus from deep learning to signal processing communities aiming to tackle most machine learning tasks. Undoubtedly, given infinite datasets and computational power, learning invariants will lead to the fittest descriptors. However, nowadays problems do not fit this situation forcing the use of nested architectures and supercomputers to reach, in the limit, these utopian descriptors. As an alternative, the scattering network (Mallat, 2012; Bruna & Mallat, 2013; Andén & Mallat, 2014) provides a deterministic transformation of a given input signal x through a cascade of linear and nonlinear operators which do not commute. The linear operator is able via a dimensional increase to linearize the representation in the sense that x can be expressed as a linear combination of basic yet fundamental structures. This linear transformation is in practice a wavelet transform but can be generalized to any complete or over-complete change of basis. Originally, these wavelet
transforms were used with an over-complete basis derived from Morlet and Gabor wavelets (Mallat, 1989). Recently, a discrete wavelet transform scheme (Mallat, 1999) and specifically a Haar transform (Chen et al., 2014) has been used instead to reduce the computational overload of the scattering transform. This framework, however, is not suited for general tasks due to poor frequency resolution of one wavelet per octave and the not continuously differentiable Haar wavelet (Graps, 1995) making it unsuitable for biological and natural waveforms detection. Following the change of basis, a k-Lipschitz nonlinear operator is applied which must also be contractive to enforce space contraction and thus bound the output variations (Mallat, 2016). The nonlinearity used in the scattering network is the complex modulus which is piecewise linear. This surjection aims to map the transformation into a subspace of smaller radius {|x| | x ∈ Ω} ⊂ Ω where Ω is the space of studied signals. As a result, one can see these successions of transforms as a suite of expansion and contraction of a deeper and deeper signal representation in the hope to decode, detect and separate all the underlying energy sources. These layered representations however still contain the time dimension and are thus overall extremely sparse and not translation invariant. This time sensitivity motivates the aggregation of the time dimension. This led to the scattering coefficients per se which are computed through the application of the operator S applied on each previously computed representation and each frequency band. It is defined as an order one statistic, the arithmetic mean, over the time dimension leading to a time-invariant central tendency description of the layered representation of x. The resulting scattering coefficients, when used as features in machine learning tasks, led to state-of-the-art results in music genre classification (Chen & Ramadge, 2013), texture classification (Sifre & Mallat, 2013; Bruna & Mallat, 2013) and object classification (Oyallon & Mallat, 2015). In this paper, we present a modification of the standard scattering network by replacing the complex modulus nonlinearity with a quadratic nonlinearity in order to increase the SNR while allowing to compute the complete scattering network without leaving the Fourier domain, which was before necessary after each level of decomposition.
1.2 SCATTERING NETWORK
We now present formally all the steps involved in the scattering network in order to clarify notations and concepts while making it as explicit as possible to easily develop our extensions. For readers more familiar with neural networks, it is first important to note that this framework can be seen as a restricted case of a Convolutional Neural Network (LeCun & Bengio, 1995) where the filters are fixed wavelets and the nonlinearity is the complex modulus as well as some topological differences such as depicted in Fig.1 . The scattering coefficients are then computed through time averaging of each representation.
1.2.1 HIERARCHICAL REPRESENTATION
By definition a scattering network can have any fixed number of layers L defined a priori. These layers are ordered in a hierarchical fashion so that the output of layer l is the input of layer l + 1. In the following, many presented properties and definitions hold for all l ∈ {1, ..., L}. Each layer l uses a specific filter-bank made of band-pass filters ψ(l)λ derived by scaling the mother wavelet of layer l denoted as ψ(l)0 in the time domain and ψ̂ (l) 0 in the Fourier domain. The dilation factors are denoted by the subscript λ leading to
ψ (l) λ =
1 λ ψ (l) 0 ( t λ ) ⇐⇒ ψ̂(l)λ = ψ̂ (l) 0 (λω) (1)
The collection of scaling factors λ for layer l is denoted by Λ(l). The only admissibility condition that each filter must satisfy is to have zero mean:∫
ψ (l) λ (t)dt = 0 ⇐⇒ ψ̂ (l) λ (0) = 0,∀λ ∈ Λ (l), (2)
which has the following equivalent sufficient condition on each mother wavelet∫ ψ
(l) 0 (t)dt = 0 ⇐⇒ ψ̂ (l) 0 (0) = 0. (3)
The finite set of continuous scale factors needed to derive the filer-bank is given as a geometric progression governed by two hyper-parameters, the number of wavelets per octave Q and the number
of octave to decompose J . The Q parameter, also called quality criteria, defines the frequency resolution, the greater it is the finer the resolution is but the more redundant will be the representation. The J parameter defines the number of octave to decompose. Since these parameters can be layer specific we now denote them as Q(l) and J (l). We thus have
Λ(l) = {2i/Q (l)
|i = 0, ..., J (l) ×Q(l)}. (4) When the L filter-banks are generated, it is possible to compute the L representations by iteratively applying the filter-banks and the nonlinearity. As a result, the lth representation indexed by the time dimension t with the l first scales as hyper-parameters is given by:
X(0)[x](t) := x(t)
X (1) λ1 [x](t) := |(X(0)[x] ∗ ψ(1)λ1 )(t)|,∀λ1 ∈ Λ1 X
(l) λ1,...,λl [x](t) = |(X(l−1)λ1,...,λl−1 [x] ∗ ψ (l) λl
)(t)|, ∀λ1 ∈ Λ(1), ..., λl ∈ Λ(l)
(5)
One can notice that X(1)λ1 [x] coefficients form the well known wavelet transform or scalogram. We now denote by X(l)[x] the complete time-frequency representation for layer l if the scales are not necessary in the context.
Thinking of deeper layers as representations of more abstract concepts is inappropriate and thus not analogous to deep neural networks representations simply because deeper layer filters are not linear combination of the first layer filters. Since the used filters are renormalized to satisfy the LittlewoodPaley condition, the energy contained in each layer decays exponentially (Waldspurger, 2016). As a result, deeper layer will contain less and less energy until all events have been captured and all the next layers are zeros. With this renormalization, inverting one change of basis is instantaneous, simply add up together all the coefficients obtained from the filters application:
x(t) = ∑ λ1∈Λ1 (X(0)[x] ∗ ψ(1)λ1 )(t). (6)
This last property highlights one motivation of dimensional increase, event or structure separation. It is now possible to rewrite the treated signal as a combination of fundamental structures, namely, the responses of the signal with the filters linearizing the events w.r.t the new λ dimension.
1.2.2 SCATTERING COEFFICIENTS
For each of the L representations, one can extract the scattering coefficients by applying a scaling function φ(l) on X(l)[x] leading to the time invariant representation S(l)[x]. The scaling function acts as a smoothing function on a given time support and satisfies∫
φ(l)(t)dt = 1 ⇐⇒ φ̂(l)(0) = 1,∀l. (7)
The scaling function is usually a Gaussian filter with layer dependent standard deviations 1/σ(l) in the time domain and σ(l) in the frequency domain defined as
φ̂(l)(ω) = e − ω2 2σ(l)2 . (8)
The greater the standard deviation is in the physical domain the more time invariant are the scattering coefficients. Ultimately, we reach global time-invariance and the scattering operator S[x] reduces to an arithmetic mean over the input support. Since only the standard deviation of the scaling function is layer dependent, we denote by φ(l) the lth scaling function generated using σ(l). We can thus define the scattering operators as
S(0)[x](t) := (X(0)[x] ∗ φ(0))(t), S
(1) λ1 [x](t) := (X (1) λ1 [x] ∗ φ(1))(t),∀λ1 ∈ Λ(1)
S (l) λ1,...,λl [x](t) := (X (l) λ1,...,λl [x] ∗ φ(l))(t) ∀λ1 ∈ Λ(1), ..., λl ∈ Λ(l)
(9)
For machine learning tasks, using global time-invariance yield robust yet biased time invariant descriptors due to too much many-to-one possible mappings. As a result, a local or windowed scattering transform has been used (Bruna & Mallat, 2013) leading to only local time-invariance through a smaller time support for the scaling function. This tweak is possible in computer vision tasks where each input is of the same size and the role of φ is to bring local diffeomorphism invariance which has been shown to smooth the underlying manifold (Zoran & Weiss, 2011; 2012). However, for audio tasks and more general problems, this constant input size is rare forcing the use of φ for completely aggregating the time dimension.
2 EXTENSIONS
2.1 HIGHER ORDER NONLINEARITY
The usual nonlinearity applied in a scattering network is the complex modulus. This nonlinearity is not everywhere differentiable but is contractive leading to an exponential decay in the energy distribution over the layers. However, as pointed out in (Waldspurger, 2016), higher order nonlinearity might be beneficial sparsity-wise and to increase the SNR. As a result, we chose to use a continuously differentiable second order nonlinearity which will have the beneficial property of adapting its contractive property for irrelevant inputs while maintaining bounded variations. This nonlinearity is defined as
P[c] = |c|2, ∀c ∈ C. (10)
Proof. We now prove the adaptive k-Lipschitz property of our nonlinearity
||P[a]− P[b]|| =|||a|2 − |b|2|| =||(|a| − |b|)(|a|+ |b|)|| =(|a|+ |b|)|||a| − |b||| ≤(|a|+ |b|)||a− b|| =K(a, b)||a− b||
Since the input signal is renormalized so that ||x||1 = 1, we have that |a|+ |b| ∈ [0, 1[. As a result, given the inputs constraints, P is a contractive operator with bounded variations. Yet, the degree of contraction will vary given the input amplitudes leading to a better SNR. This means that high amplitudes resulting from close match between the filter and the signal will be efficiently represented whereas small amplitude coefficients resulting from noise filtering and mismatches between the filter and the signal will be highly contracted. Since in practice wavelet filters catch the relevant events, this property allows high quality representations. This change will not only increase the relative sparsity of the representations but also allow us to perform some major computational tricks as describe in the following section. As a result we define the new representations as
X0[x](t) := x(t) X (1)λ1 [x](t) := P [ (X (0)[x] ∗ ψ(1)λ1 )(t) ] ,∀λ1 ∈ Λ(1)
X (l)λ1,...,λl [x](t) = P [ (X (l−1)λ1,...,λl [x] ∗ ψ (l) λl )(t) ] ,
∀λ1 ∈ Λ(1), ..., λl ∈ Λ(l)
(11)
as well as the new scattering coefficients as
S(0)[x](t) := (X (0)[x] ∗ φ(0))(t), S(1)λ1 [x](t) := (X (1) λ1 [x] ∗ φ(1))(t),∀λ1 ∈ Λ(1)
S(l)λ1,...,λl [x](t) := (X (l) λ1,...,λl [x] ∗ φ(l))(t), ∀λ1 ∈ Λ(1), ..., λl ∈ Λ(l)
(12)
2.2 INVARIANT DISPERSION COEFFICIENTS
The scattering coefficients used to characterize the signal of interest are known to be efficient for stationary inputs but not descriptive enough otherwise. We thus propose to generate complementary invariant coefficients based on a dispersion measure, the variance. As a result, these complementary coefficients derived from the second order moment will help to characterize the input leading to more discriminative features while maintaining global time invariance. We now define these invariant dispersion coefficients as
V(0)[x] := ||X (0)[x]− S(0)[x]||22, V(1)λ1 [x] := ||X (1) λ1 [x]− S(1)λ1 [x]|| 2 2,∀λ1 ∈ Λ(1) V(l)λ1,...,λl [x] := ||X (l) λ1,...,λl [x]− S(l)λ1,...,λl [x]|| 2 2.
∀λ1 ∈ Λ(1), ..., λl ∈ Λ(l).
(13)
The resulting V(l)[x] coefficients are thus globally time invariant whatever scaling function was used to compute S(l)[x]. In fact, these invariant dispersion coefficients represent the variance between X (l)[x] and S(l)[x] representations whether S(l)[x] was globally time invariant or a smoothed version ofX (l)[x]. In order for V(l)[x] to be invariant to random permutations as well, S(l)[x] should be globally translation invariant and thus also globally invariant to random permutations. In addition, regarding the discriminative ability gained through the use of these second order statistic, we have that
card ( {s ∈ L2(C)|S = (k1, ..., kn)} ) ≥
card ( {s ∈ L2(C)|S = (k1, ..., kn) and V = (p1, ..., pn)} ) ,
(14)
where S represents a realization of the scattering coefficients for all layers, all frequency bands, and V a realization of the dispersion coefficients again for all layers and all frequency bands. From this, it follows that the set of invariant coefficients (S[x],V[x]) is more discriminative leading to more precise data description than when using (S[x]) only. The development of these presented invariant dispersion coefficients opened the door to the development of uncountably many new invariant coefficients. We now present the elaboration of the scheme in the Fourier domain and the computational tricks involved in order to reach linear complexity.
3 FAST IMPLEMENTATION, FOURIER DOMAIN AND LINEAR COMPLEXITY
3.1 INTRODUCTION AND SPARSE STORAGE
One of the great benefits of the wavelet transform is the induced sparsity in the representation for certain class of signals (Elad & Aharon, 2006; Starck et al., 2010) which is seen as a quality criteria of the representation (Coifman et al., 1992). In addition of providing sparse representations, wavelets are localized filters in time and frequency domain. However, the idea to exploit this known sparsity in order to reduce the computational time of performing a transformation has not been leveraged yet. When dealing with the standard time domain, one can not know a priori where the filter with match or not the signal and thus where are the nonzeros coefficients leading to no way to have computational gains. On the other hand, applying the filter in the Fourier domain reduces to an Hadamard product and thus the resulting support is deduced from the filter support which is known to be localized. As a result, it is now possible to know a priori most of the zero coefficients positions since in the Fourier domain the filter is well localized. Also, the Fourier domain, the wavelet support is convex and compact but most importantly it can be computed a priori given the scale parameter and the mother wavelet. This motivates our choice to perform our framework including the wavelet transform, the nonlinearity P and the invariant features extraction in the Fourier domain leading to linear complexity. Furthermore, using the Fourier domain allows us to efficiently leverage sparse matrices leading to efficient storage and memory management on energy efficient platforms such as presented in (Esser et al., 2015). We will first present the computation of the filters in the Fourier domain as well as their convex compact support derivation. From that we present the sparse application of the filters and how to compute the nonlinearity in Fourier. Finally, we will see that extracting the invariant features can be done efficiently leading to our main result which is a linear complexity overall framework. Concerning the Fourier transform, the Danielson-Lanczos lemma (Flannery et al., 1992) will be used in order to provide a true O(N log(N)) complexity for an input of size N which is a power of 2. As we will see, this requirement will always be fulfilled without any additional cost.
3.2 SPARSE FOURIER FILTERS
One particularity of the continuous wavelets such as DoG, Morlet wavelets reside in their localized compact support in the Fourier domain. In our description the used wavelet will be a Morlet wavelet but this analysis can be extended to any continuous wavelet with analytical form. We define the support of the filter ψ(l)λ given the threshold as
supp [ψ (l) λ ] := {ω|ψ (l) λ (ω) > , ω ∈ [0, 2π]} (15)
As presented in (Balestriero et al., 2015) the scales define entirely the support of each wavelet. In order to develop synergistic computational tricks, we derive our framework in the Fourier domain. Let define the Morlet wavelet as
ψ̂µ0,σ0(ω) = H(ω)e − (ω−µ0)
2
2σ20 , (16)
where the parameters µ0 and σ0 represent respectively the center frequency and bandwidth of the mother wavelet and H is the step-wise function. The ratio between these two quantities will remain the same among all the filters, in fact, wavelets have a constant ratio of bandwidth to center frequency. These two mother hyper-parameters are taken as
µ0 = π 2 (2 −1/Q + 1)
σ0 = √ 3(1− 2−1/Q). (17)
Yet, instead of using the definition of scaling as defined in section 1.2.1 we will use these two parameters as follows
ψ̂µ0,σ0(λω) = ψ̂µ0λ , σ0 λ (ω) := ψ̂λ(ω). (18)
In fact, we have the following relation between the scale and the mother hyper-parameters
ψ̂µ0,σ0(λω) =H(λω)e − (λω−µ0)
2
2σ20
=H(ω)e − λ2(ω−µ0 λ )2 2σ20
=H(ω)e −
(ω−µ0 λ )2
2( σ0 λ )2 .
=ψ̂µ0 λ , σ0 λ (ω)
Given this, we can compute explicitly the support of every filter ψ(l)λ . As one can notice these filters have a convex compact support around their center frequencies:
supp [ψ (l) λ ] = [ µ0 λ − σ0 λ √ −2 log( ),
µ0 λ + σ0 λ
√ −2 log( ) ] .
(19)
In Fig. 2 one can see a filter-bank example where all the filters are presented in one plot demonstrating the important sparsity inherent to wavelets. Varying the parameter affects directly the number of nonzero coefficients and we thus also present in Table 1 the exact sparsity with different input sizes and parameter. Since the support is known a priori, it is straightforward to optimize their computation and allocation through sparse vectors leading to fast filter-bank generation as presented in Table 2 with large input sizes. In fact, the input length defines the size of the generated filter since we now perform the convolution in the Fourier domain.
Concerning the φ(l) filter, given its bandwidth σ(l), its support is given by:
supp [φ (l)] = [ −σ(l) √ −2 log( ), σ(l) √ −2 log( ) ] . (20)
Some examples are shown in Fig. 8 where different σ(l) are selected representing different time supports. For each of the filters and each of the layers, the application is done through element-wise multiplication in the Fourier domain as explained in the next section where the nonlinearity will be defined.
3.3 NONLINEARITY AND FILTERING IN FOURIER
The nonlinearity used in this framework defined in section 2.1 is efficiently done in the Fourier domain through the following property
F [|x|2] = F [x] ∗ F [x]∗ (21)
If done directly, this operation would be slower in the Fourier domain since we jump from a linear complexity to a quadratic complexity. However, one should notice from section 3.2 that we are dealing with F [x] which are extremely sparse but most importantly with convex compact support of size M << N . Exploiting this sparsity could lead to a faster convolution which would still be of quadratic complexity w.r.t the support size. However, using the convolution theorem it is possible to perform this convolution in M log(M) complexity by applying again a Fourier transform now only on the convex compact support of F [x]. In order to have proper boundary condition and not the periodic assumption of the Fourier transform we use a zero-padded version of size2M instead of M leading to exact computation of the convolution. In addition, the support size of 2M is the minimum required size. For a fast Fourier transform algorithm, this has to be a power of 2. As a result, in practice, the zero padding is done to reach the size which is the smallest power of 2 greater than 2M defined as
2dlog2(2M)e, (22)
where dlog2(2M)e denotes the smallest of the greater integers. As a result in the Fourier domain we will apply another Fourier transform in order to compute this auto-correlation which will correspond to the desired nonlinearity in the time domain.
F [|x|2] = F−1 [ F [F [x]] ⊙ F [F [x]]∗ ] , (23)
where ⊙
is the Hadamard product, F is the Discrete Fourier Transform and F−1 its inverse operator. In addition of the second Fourier transform being applied on a really small support, it is also important to note that after application of the nonlinearity the output is conjugate symmetric in the Fourier domain but since the filter-banks are always applied on [0, π] we can store only this part for further computation and re-generate the conjugate symmetric part when applying φ(l). We present this operation in the Fourier domain in Fig. 7.
In order to highlight the high sparsity encountered in the Fourier domain when dealing with this filter application, we present in Fig. 3 an example where the nonzero elements are shown. This corresponds to the first representation namely X (1)[x]. For the second representation, the input support will not be over the whole [0, 2π[ domain but around 0 and thus implies increased sparsity as demonstrated in Fig. 9. Given these two descriptions, one is able to computeX (l)[x] for any l. We thus now present how to compute the scattering and dispersion coefficients given this representations in the Fourier domain.
3.4 SCATTERING COEFFICIENTS EXTRACTION
The scattering coefficients S(l)[x] result from the application of a Gaussian filter parameterized by its standard deviation. In the general case where global time invariance is required, this standard deviation is taken to be infinite in the time domain resulting in
S(l)λ1,...,λl [x] = 1
N N∑ t=1 X (l)λ1,...,λl [x](t). (24)
In this case, the corresponding result in Fourier is given by S(l)[x] = F [ X (l)[x] ] (ω = 0). (25)
The invariant dispersion coefficients are extracted from the Fourier transform in a straightforward manner as shown in the Appendix which results in
||X (l)[x]− S(l)[x]||22 = ||F [ X (l)[x] ]⊙ (1−F [ φ(l) ] )||22. (26)
Thus (1−F [ φ(l) ] ) acts as a mask to reduce the norm computation by the amount of energy captured through the scaling function application. For the case where we have global time invariance or infinite standard deviation, this mask reduces to
(1−F [ φ(l) ] )(ω) = δ(ω) (27)
where δ denotes the Dirac function. As a result, the dispersion coefficients can be calculated as
V(l)[x] = 2 π∑
ω=1/N
( F [ X (l)[x] ] (ω) )2 , (28)
which is the L2 norm computed without taking into account the coefficient at ω = 0 exploiting the conjugate symmetry structure for the real input signal x. Conceptually, the V coefficients capture the remaining energy and thus ensures that for any depth of the scattering network, all the energy of the input is contained inside the computed invariants. In fact, one can see that V(l)[x] = ∑∞ i=l+1 S(i)[x].
3.5 SCALABILITY
We now present some results and figures in order to highlight the high scalability of our framework with respect to the input size. Note that the current implementation is done in Python. Implementing this toolbox in C is a future work which will lead to even better results than the ones displayed below which are nevertheless already astonishing. First of all, one can see in Fig. 4 that the number of nonzero coefficients increase linearly with the input size. This result is important in nowadays
paradigm where technologies allow extreme frequency sampling and thus input signals with high dimensions yet we aim to save as much memory and storage as possible. If we put this nonzero coefficients in perspective with the total possible number of coefficients we obtain our sparsity coefficient which grows logarithmically with the input size as shown in Fig. 4. This result shows the advantage of using sparse matrices which increases as the input size increases. The sparsity is thus in our case a justification to exploit the Fourier domain.
Finally, in Fig. 5 are presented some computational time for different input signals. We can see in this figure the high efficiency of our approach put in perspective of an existing C implementation of the scattering network. In fact, in this latter, one had to perform multiple inverse Fourier transforms in order to apply the nonlinearity and in order to compute the second layer for example apply again a Fourier transform and this for all the frequency bands. As a result the previously fastest known algorithm was of asymptotic complexity O(N log(N)) even with a Fourier input. In addition, it did not leverage the sparsity of the representation leading to poor memory management and storing. Not however that for all the existing implementations, the complexity is linear with respect to the J and Q parameters. Finally, with our framework, one can directly store the sparse matrices of the
representations leading to space saving on the hard drive in addition of the actual Random Access Memory (RAM) saving during the computation.
4 VALIDATION ON BIRD CHALLENGE
4.1 DATASET PRESENTATION
We now validate the use of the scattering coefficients as features for signal characterization through a supervised problem of audio recordings classification. The bird song classification challenge is made of 50 classes and correspond to a small version of the BirdCLEF Challenge (Joly et al., 2015). The recordings come from the Xeno-Canto database and mainly focus on species form South America. For our task, the dataset used for training is composed of 924 files sampled at 44100 Hz. The validation set used to present our classification accuracy contains about 400 files. Computing the S[x] and V[x] features on the training and validation set takes between 2 to 3 hours depending on the set of parameters used with a 2-layer architecture on 1 CPU. The files add up to a disk usage of 4.2Go, the computed set of features however represent 450Mo. As a result, we are able to encode and extract important characteristics of the signals while reducing the amount of redundant information. We present in Fig. 101112 examples of the dataset with the waveform as well as the representation X (1)λ1 [x]. The aim is to first demonstrate the sparsity or high SNR in the physical domain involved by using a second order nonlinearity. In addition, one can see the different frequency modulated responses that could characterize a bird song. Overall, there are some fundamental difficulties in this task. The first challenge is to deal with translation invariance. In fact, the bird songs can be captured anywhere inside each files which themselves are of many different durations, from seconds to minutes. The second difficulty resides in characterizing well enough the time-frequency patterns of each specie without being altered by the ambient noise or possible presence of other species including human voices. Finally, difficulties also arise from the machine learning point of view with large class imbalance in the dataset.
4.2 RESULTS
We now present the classification results obtained via our developed framework. First of all, no additional features have been engineered and thus only the features developed in the paper are used. For the classification part, we decided to use a fast algorithm in accordance with the whole scheme developed earlier and thus used random forests (Liaw & Wiener, 2002). In short, random forests
are using bagging of decision trees (Breiman, 1996) and thus are able to aggregate multiple weak classifiers to end up with efficient class boundaries. One of its drawback resides in the fact that it can only create decision rule on each feature dimension without combining them as could do a logistic regression for example. In addition, we used a weighted loss function in order to deal with the imbalanced dataset (Van Hulse et al., 2007). Finally, no additional pre-processing/denoising has been used and no feature extraction/selection technique has been piped in. Yet, with this basic approach, we were able to reach an accuracy of 47.6% and a Mean Average Precision (MAP) of 52.4%. The state-of-the-art technique for this problem reached a MAP of 53% (Cha, 2016). We present in Fig.6 some accuracy results where two sets of parameters have been used for the second layer of the scattering network. In addition, we show the classification results when using each features independently and combination of the two in order to highlight their complementarity. Given the deterministic transformation used and the lack of cross-validation and fine tuning, we think of these results as promising overall while being state-of-the-art if considering solutions where no learning was involved outside of the classifier. For example, one extension on the classifier could be to use boosting algorithms (Schapire et al., 1998) or neural networks. Concerning the representation, performing cross-validation on the parameters could lead to great improvements as finally a third scattering layered could also be considered.
5 CONCLUSION
We presented an extension of the scattering network in order to provide more discriminative time invariant features which are complementary to each others. The derivation of a second order invariant operator as well as the use of a second order nonlinearity in the layered representation computation led to efficient characterization of audio signals opening the door of many more possible time invariant features derivation. The whole framework has been derived in the Fourier domain in order to reach linear complexity in the input size as it is now possible to compute all the layer representations and feature without leaving the Fourier domain. Sparse storage is also a milestone of our algorithm leading to not only efficient computation but smart memory management allowing this framework to be applied online on energy efficient laptops and chips. In addition, only simple arithmetic operations are used and parallel implementation can be done easily as well as GPU portage. This framework can be applied without any assumption on the input signal and thus aims to be as general as possible as a unsupervised invariant feature extraction. Finally, we hope to bring the consideration of sparse filters and Fourier based computation for deep convolutional networks. In fact, as the datasets get larger and larger, the complexity of the networks increase and convolutions might not be efficiently computed in the physical domain anymore. Since the convergence of the filter ensure their sparsity and smoothness, this consideration might help to bring deep learning to the family of scalable algorithms with the development of Fourier networks as a whole.
ACKNOWLEDGEMENT
We thank Institut Universitaire de France for the Glotin’s Chair in ’Scene Analysis’. We thank SABIOD.ORG Mission Interdisciplinaire of the CNRS and Alexis Joly for co-organisation of the LifeClef Bird Challenge. We also want to thank Mr. Romain Cosentino for his reviewing work and his help in bringing back in the physical domain some of our original sentences.
A NONLINEAR INVARIANT IN THE FOURIER DOMAIN
||X (l)[x]− S(l)[x]||22 = ∫ ( X (l)[x](t)− S(l)[x](t) ) ( X (l)[x](t)− S(l)[x](t) )∗ dt
= ∫ g(t)g(t)∗dt g(t) = X (l)[x](t)− S(l)[x](t)
= ∫ F [g](ω)F [g∗](ω)dω Plancherel Theorem
=||F [g]||22 =||F [X (l)[x]− S(l)[x]]||22 =||F [ X (l)[x] ] −F [ S(l)[x] ] ||22 Linear Operator
=||F [ X (l)[x] ] −F [ X (l)[x] ∗ φ(l) ] ||22
=||F [ X (l)[x] ] −
F [ F−1 [ F [X (l)[x]] ⊙ F [φ(l)] ]] ||22
=||F [ X (l)[x] ] −F [ X (l)[x] ]⊙ F [ φ(l) ] ||22
=||F [ X (l)[x] ]⊙ (1−F [ φ(l) ] )||22.
B ADDITIONAL MATERIAL AND BIRD SONG REPRESENTATIONS
Using these three examples, we also present in Fig. 13 the resulting features computed on the first two layers of the scattering network in order to highlight the possibly linear hyperplanes separating these 3 species in this new feature space.

I find the general direction of the work is promising but, in my opinion, the paper has three main drawback. While the motivation and overall idea seem very reasonable, the derivation is not convincing mathematically. The experiments are limited and the presentation needs significant improvement.  The writing and wording are in general poorly structured to the point that it is sometimes difficult to follow the proposed ideas. The overall organization needs improvement and the connection between sections is not properly established. The paper could be significantly improved by simply re-writing it.
I'm not fully convinced by the motivation for the proposed non-linearity (|c|^2), as described on page 5. The authors argue that  (Waldspurger, 2016) suggests that higher order nonlinearities might be  beneficial for sparsity. But unless I'm missing something, that work seems  to suggest that in the general case higher order nonlinearities can be neglected. Could you please comment on this?
On the other hand, adding a second order term to the descriptor seems
an interesting direction, as long as stability to small variations is preserved (which should be shown experimentally)
The experimental section is rather limited. The paper would be stronger with a thorough numerical evaluation. The presented results, in my opinion, do not show convincingly a clear advantage of the proposed method over a standard implementation of the scattering transform. In order to show the merits of the proposed approach, it would be really helpful to directly compare running times and compression rates.
Questions:
- Can you show empirically that the proposed higher order nonlinearity
produces sparser representations than the complex modulus?
Other minor issues:
- The proof of Section 2.1, should be preceded by a clear statement in the form of a proposition
- "Hadamart" -> Hadamard
- "Valid set" -> Validation set
- "nonzeros coefficients" -> nonzero coefficients
- Figure 3 is difficult to understand. Please provide more details.
- Figure 5 is supposed to show a comparison to a standard implementation of the Scattering network, but it doesn't seem to be such comparison in that figure. Please explain.
- Please verify the references. The first reference states "MALLAT".


A new model for video captioning is developed, using a deep three-dimensional Convolutional Neural Network (C3D) as an encoder for videos and a Recurrent Neural Network (RNN) as a decoder for captions. A novel attention mechanism with spatiotemporal alignment is employed to adaptively and sequentially focus on different layers of CNN features (levels of feature “abstraction”), as well as local spatiotemporal regions of the feature maps at each layer. The proposed approach is evaluated on the YouTube2Text benchmark. Experimental results demonstrate quantitatively the effectiveness of our proposed adaptive spatiotemporal feature abstraction for translating videos to sentences with rich semantic structures.
1 INTRODUCTION
Accurately understanding the fast-growing number of videos poses a significant challenge for computer vision and machine learning. An important component of video analyasis involves generating natural-language video descriptions, i.e., video captioning. Inspired by the successful deployment of the encoder-decoder framework used in machine translation (Cho et al., 2014) and image caption generation (Vinyals et al., 2015; Pu et al., 2016; Gan et al., 2017), most recent work on video captioning (Venugopalan et al., 2015; Yu et al., 2016) employs a 2-dimentional (2D) or 3-dimentional (3D) Convolutional Neural Network (CNN) as an encoder, mapping an input video to a compact feature vector representation; a Recurrent Neural Network (RNN) is typically employed as a decoder, unrolling this feature vector to generate a sequence of words of arbitrary length.
Despite achieving encouraging successes in video captioning, previous models suffer from important limitations. First, the rich contents in an input video is often compressed to a single compact feature vector for caption generation; this approach is prone to miss detailed spatiotemporal information. Secondly, the video feature representations are typically extracted from the output of a CNN at a manually-selected fixed layer, which is incapable of modeling rich context-aware semantics that requires focusing on different abstraction levels of features. As investigated in Zeiler & Fergus (2014); Simonyan et al. (2014), the features from layers at or near the top of a CNN tends to focus on global semantic discriminative visual percepts, while low-layer feature provides more local, fine-grained information. It is desirable to select/weight features from different CNN layers
∗Most of this work was done when the author was an intern at NEC Labs America.
adaptively when decoding a caption, selecting different levels of feature abstraction by sequentially emphasizing features from different CNN layers. In addition to focusing on features from different CNN layers, it is also desirable to emphasize local spatiotemporal regions in feature maps at particular layers.
To realize these desiderata, our proposed decoding process for generating a sequence of words dynamically emphasizes different levels (CNN layers) of 3D convolutional features, to model important coarse or fine-grained spatiotemporal structure. Additionally, the model employs different contexts and adaptively attends to different spatiotemporal locations of an input video. While some previous models use 2D CNN features to generate video representations, our model adopts the features from a pre-trained deep 3D convolutional neural network (C3D); such features have been shown to be natural and effective for video representations, action recognition and scene understanding (Tran et al., 2015) by learning the spatiotemporal features that can provide better appearance and motion information. In addition, the proposed model is inspired by the recent success of attention-based models that mimic human perception (Mnih et al., 2014; Xu et al., 2015).
The principal contributions of this paper are as follows: (i) A new video-caption-generation model is developed by dynamically modeling context-dependent feature abstractions; (ii) New attention mechanisms to adaptively and sequentially emphasize different levels of feature abstraction (CNN layers), while also imposing attention within local spatiotemporal regions of the feature maps at each layer are employed; (iii) 3D convolutional transformations are introduced to achieve spatiotemporal and semantic feature consistency across different layers; (iv) The proposed model achieves state-ofthe-art performance on Youtube2Text benchmark. We call the proposed algorithm Adaptive SpatioTemporal representation with dynAmic abstRaction (ASTAR).
2 METHOD
Consider N training videos, the nth of which is denoted X(n), with associated caption Y(n). The length-Tn caption is represented Y(n) = (y (n) 1 , . . . ,y (n) Tn
), with y(n)t a 1-of-V (“one hot”) encoding vector, with V the size of the vocabulary.
For each video, the C3D feature extractor (Tran et al., 2015) produces a set of features A(n) = {a(n)1 , . . . ,a (n) L ,a (n) L+1}, where {a (n) 1 , . . . ,a (n) L } are feature maps extracted from L convolutional layers, and the fully connected layer at the top, responsible for a(n)L+1, assumes that the input video is of the same size for all videos. To account for variable-length videos, we employ mean pooling to the video clips, based on a window of length 16 (as in (Tran et al., 2015)) with an overlap of 8 frames.
2.1 CAPTION MODEL
For notational simplicity, henceforth we omit superscript n. The t-th word in a caption, yt, is mapped to an M -dimensional vector wt = Weyt, where We ∈ RM×V is a learned wordembedding matrix, i.e., wt is a column of We chosen by the one-hot yt. The probability of caption Y = {yt}t=1,T is defined as
p(Y|A) = p(y1|A) ∏T t=2 p(yt|y<t,A) . (1)
Specifically, the first word y1 is drawn from p(y1|A) = softmax(Vh1), where h1 = tanh(CaL+1). Bias terms are omitted for simplicity throughout the paper. All the other words in the caption are then sequentially generated using an RNN, until the end-sentence symbol is generated. Conditional distribution p(yt|y<t,A) is specified as softmax(Vht), where ht is recursively updated as ht = H(wt−1,ht−1, zt). V is a matrix connecting the RNN hidden state to a softmax, for computing a distribution over words. zt = φ(ht−1,a1, . . . ,aL) is the context vector used in the attention mechanism, capturing the relevant visual features associated with the spatiotemporal attention (also weighting level of feature abstraction), as detailed in Sec. 2.2. The transition function H(·) is implemented with Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997). Given the video X (with features A) and associated caption Y, the objective function is the sum of the log-likelihood of the caption conditioned on the video representation:
log p(Y|A) = log p(y1|A) + ∑T t=2 log p(yt|y<t,A) , (2)
Equation (2) is a function of all model parameters to be learned; they are not explicitly depicted in (2) for notational simplicity. Further, (2) corresponds to a single video-caption pair, and when training we sum over all such training pairs.
2.2 ATTENTION MECHANISM
We introduce two attention mechanisms when predicting word yt: (i) spatiotemporal-localization attention, and (ii) abstraction-level attention; these, respectively, measure the relative importance of a particular spatiotemporal location and a particular CNN layer (feature abstraction) for producing yt, based on the word-history information y<t.
To achieve this, we seek to map al → âl, where 4D tensors âl all have the same dimensions, are embedded into same semantic spaces, and are aligned spatialtemporally. Specifically, âl, l = 1, . . . , L−1 are aligned in the above ways with aL. To achieve this, we filter each al, l = 1, . . . , L− 1, and then apply max-pooling; the filters seek semantic alignment of the features (including feature dimension), and the pooling is used to spatiotemporally align the features with aL. Specifically, consider
âl = f( ∑nlF k=1 al(k) ∗Uk,l), (3)
for l = 1, . . . , L − 1, and with âL = aL. al(k) is the 3D feature map (tensor) for dictionary k ∈ {1, . . . , nlF } at layer l, and Uk,l is a 4D tensor. The convolution ∗ in (3) operates in the three shift dimensions, and al(k)∗Uk,l manifests a 4D tensor. Function f(·) is an element-wise nonlinear activation function, followed by max pooling, with the pooling dimensions meant to realize final dimensions consistent with aL. Consequently, âi,l ∈ Rn L F is a feature vector.
With {âl}l=1,L semantically and spatiotemporally aligned, we now seek to jointly quantify the value of a particular spatiotemporal region and a particular feature layer (“abstraction”) for prediction of the next word. For each âi,l, the attention mechanism generates two positive weights, αti and βtl, which measure the relative importance of location i and layer l for producing yt based y<t. Attention weights αti and βtl and context vector zt are computed as
eti = w T α tanh(Waαâi +Whαht−1), αti = softmax({eti}), st = ∑L l=1 αtiâi, (4)
btl = w T β tanh(Wsβstl +Whβht−1), βtl = softmax({btl}), zt = ∑L l=1 βtlstl, (5)
where âi is a vector composed by stacking {âi,l}l=1,L (all features at position i). eti and btl are scalars reflecting the importance of spatiotemporal region i and layer t to predicting yt, while αti and βtl are relative weights of this importance, reflected by the softmax output. In (4) we provide attention in the spatiotemporal dimensions, with that spatiotemporal attention shared across all L (now aligned) CNN layers. In (5) the attention is further refined, focusing attention in the layer dimension.
3 EXPERIMENTS
We present results on Microsoft Research Video Description Corpus (YouTube2Text) (Chen & Dolan, 2011). The Youtube2Text contains 1970 Youtube clips, and each video is annotated with around 40 sentences. For fair comparison, we used the same splits as provided in Yu et al. (2016), with 1200 videos for training, 100 videos for validation, and 670 videos for testing. We convert all captions to lower case and remove the punctuation, yielding vocabulary sizes V = 12594.
We consider the RGB frames of videos as input, and all videos are resized to 112×112 spatially, with 2 frames per second. The C3D (Tran et al., 2015) is pretrained on Sports-1M dataset Karpathy et al. (2014), consisting of 1.1 million sports videos belonging to 487 categories. We extract the features from four convolutional layers and one fully connected layer, named as pool2,
pool3, pool4, pool5 and fc-7 in the C3D (Tran et al., 2015), respectively.
The widely used BLEU (Papineni et al., 2002), METEOR (Banerjee & Lavie, 2005) and CIDEr (Vedantam et al., 2015) metrics are employed to quantitatively evaluate the performance of our video caption generation model, and other models in the literature.
Results are summarized in Tables 1, and we outperform the previous state-of-the-art result on Youtube2Text. This demonstrates the importance of leveraging intermediate convolutional layer features. In addition, we achieve these results using a single model, without averaging over an ensemble of such models.
4 CONCLUSION AND FUTURE WORK
We have proposed a novel video captioning model, that adaptively selects/weights the feature abstraction (CNN layer), as well as the location within a layer-dependent feature map. Our model achieves state-of-the-art video caption generation performance on Youtube2Text benchmark.

The authors apply the image captioning architecture of Xu et al. 2015 to video captioning. The model is extended to have attention over multiple layers of the ConvNet instead of just a single layer. Experiments on YouTube2Text, M-VAD and MSR-VTT show that this works better than only using one of the layers at a time.
I think this is solid work on the level of a well-executed course project or a workshop paper. The model makes sense, it is adequately described, and the experiments show that attending over multiple layers works better than attending over any one layer in isolation. Unfortunately, I don't think there is enough to get excited about here from a technical perspective and it's not clear what value the paper brings to the community. Other aspects of the paper, such as including the hard attention component, don't seem to add to the paper but take up space.
If the authors want to contribute a detailed, focused exploration of multi-level features this could become a more valuable paper, but in that case I would expect a much more thorough exploration of the choices and tradeoffs of different schemes without too many spurious aspects such as video features, hard attention, etc.