{'fraction_non_alphanumeric': 0.02455641603764337, 'fraction_numerical': 0.013724144691696893, 'mean_word_length': 4.924216027874564, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Room adaptive conditioning method for sound event classification in reverberant environments

Ensuring performance robustness for a variety of situations that can occur in real-world environments is one of the challenging tasks in sound event classification. One of the unpredictable and detrimental factors in performance, especially in indoor environments, is reverberation. To alleviate this problem, we propose a conditioning method that provides room impulse response (RIR) information to help the network become less sensitive to environmental information and focus on classifying the desired sound. Experimental results show that the proposed method successfully reduced performance degradation caused by the reverberation of the room. In particular, our proposed method works even with similar RIR that can be inferred from the room type rather than the exact one, which has the advantage of potentially being used in real-world applications.


INTRODUCTION
Sound event classification (SEC) is a task that automatically categorizes audio clips into labels that match their acoustic content. The SEC system is being studied on a variety of topics with the aim of application in real-world, such as abnormal event detection [1,2], urban sound recognition [3], or domestic sound recognition [4]. However, the application of the SEC system is difficult due to the various acoustic distortions that occur when applied to a real-world environment. For example, background noise other than the desired event obscures important sounds, and various sounds overlap due to reverberation effects.
Unfortunately, the effort to apply the SEC system to a real-world environment is still focused on securing noise robustness against noise [5,6,7]. One of the major reasons for this is the complexity of the reverberation properties. In particular, a simple mathematical operation can produce a sound with a specific reverberation applied using its characteristics, but the opposite is difficult without knowing the same reverberation information. To overcome this, in the field of speech recognition, studies have suggested methods that directly model complex reverberations through neural networks. The representative examples are dereverberation methods that remove reverberation characteristics from speech signals [8,9]. However, in the case of SEC, it is difficult to directly apply the dereverberation method because the target event sound is ambiguous and more diverse than the voice.
Meanwhile, recent studies have suggested various ways of using the encoded information in neural networks. It starts with simply using the high-level information of the pre-trained network [10,11], and is also used as a way to give the desired direction for network training while simultaneously learning various information from multiple inputs [12,13,14]. In particular, applying this method as a feature level has the advantage of being able to intentionally train the network by blocking and passing specific information through the gate.
In this study, we propose a novel method that suppresses the effect of reverb motivated by recent network conditioning methods. Our proposed method simultaneously takes the audio input used in a typical SEC and an additional reverberation characteristic, the room impulse response (RIR), of the target room environment. It differs from previous studies is that these additional inputs were not used to focus on specific information, but to lessen concentration on specific information. The proposed method has the advantage of potentially being used in real-world applications since RIR is relatively easy to acquire and for a given SEC service, the location rarely changes.
Our contributions are followings: First, we suggest a test environment to evaluate the performance degradation caused by reverberation. We then present a network training method that suppresses specific environmental factors. Our proposed method can be modularized so that it can be additionally trained from the existing network, and that it works even by using only similar RIRs that can be estimated in the environment as revealed in the experiment.

Room Impulse Response
Under a linear time-invariant condition, room impulse response (RIR) completely describes the acoustic path including source sound propagation and room reflections [15]. It means sound distorted by reverberation can be modeled by the convolution operation of exact RIR and source audio. Even in the same room, RIR varies depending on the location of the source audio and the interference of objects. It makes non-availability of deconvolution which is inverse transformation of convolution, because the result of deconvolution without exact RIR is significantly distorted from source audio.
Reverberation time (T60) and direct-to-reverberant ratio (DRR) are well-known representative measures that show characteristics of the RIR. T60 is defined as the time it takes for the source level to decay 60 dB after the source has ceased. The DRR is the energy ratio between sound come from the direct path of source audio and other reflected paths of it. As the distance to the source increases, reverberant energy remains constant, but the direct path energy decays by 6 dB per doubling the source distance, results in DRR is inversely proportional to source distance [16]. Note that source audio is distorted more as T60 increases and DRR decreases.

Feature-wise Transformation
In machine learning, conditioning means context-based processing that processes source information in the context of another. The test sets are renamed with the notation using its T60.
wise transformation is one of the conditioning methods which is simply done by element-wise affine transformations between source information and auxiliary information [12]. Also, such the transformation with non-linear activation operates like a gating mechanism that allows the conditioning information to select which features are passed forward and which are not. In the previous study [13], the network that trained with the image (source information) and the text (auxiliary information) tended to focus more on the object related to the text and zeroed out the rest of the image. Despite the simplicity of its structure, the feature-wise transformation has proven its effectiveness in previous studies using various modalities such as image, audio, and text [13,11,14].

PROPOSED METHOD
The proposed method is a conditioning network using the room impulse response (RIR) of the target room. The source audio which is distorted by the room reverberation is transformed by the RIR of that room. For the conditioning method, feature-wise transformation including scaling and biasing operation is used, because it is assumed that if it is possible to make the network focus on the information of input related to another input, the opposite would also be possible. This means that it will be possible to make the network focus on the information that is not related to another input which is the reverberation characteristic of the target room. The RIR is given so that the network concentrates more on sound event characteristics only, ignoring obstruction of room reverberation. Concretely, the proposed conditioning network consists of three embedding blocks. One for source audio, and two for the RIR of scaling and biasing operation each. With the input source audio x and the RIR of that room r, the transformed embedding output y is defined as, where H, Rs, and R b are the embedding block of x, the embedding block for scaling and it for biasing, respectively. Also, * and σ are element-wise multiplication and non-linear operation such as ReLU, respectively. Then y is provided for classification network after another non-linear activation. The proposed method has the advantage of being a separable module that can be attached to the conventional deep learning-based SEC models.

Dataset
Our experiments focus on how a classification model trained in a clean environment works in real-world reverberant rooms. In this context, we used Real World Computing Partnership (RWCP), a dataset containing various kinds of sound events recorded in an anechoic chamber. The test set consists of a clean room, simulated reverberation rooms, and recorded reverberation rooms. Clean test set The clean test set is test set of the entire data from RWCP, 50 classes with 80 clips were used in this experiment following previous studies [6,7,17]. The clean test set consists of 20 clips assigned to each class, and the rest are used for training.
Simulated test set Simulated test sets are made by convolving real-world impulse response (IR) into the test data of SEC dataset. As a real-world IR, Aachen impulse response (AIR) [18], multichannel acoustic reverberation database at York (MARDY) [19], Queen Mary University of London (QMUL) [20], and Westdeutscher Rundfunk (WDR) [21] are used. A brief summarization for each simulated test set is provided in Table 1.
Recorded test set The clean test set is re-recorded by playing in a fixed location in two separate environments. The first is a twowalled corridor and the second is a four-walled boardroom. Brief reverberation information for each room is summarized in Table 1. The sound source audio was played from the speaker rather than the real sound source, but the reverberation was generated in the realworld environment, so we assumed it was closer to the real-world environment compared to the simulated test sets.

Network architecture
The network architecture is based on the VGGish network [22], which is known to be effective for extracting audio features. We used four convolution blocks structure of VGGish for the embedding block of our network. Since all the inputs have the same modality which is audio, the same structure is used for the embedding block of the input source audio and the two embedding blocks of the RIR for scaling and biasing, but the parameters are not shared. Details of the embedding block structure are given in Figure 1. All convolution layers have a filter size (3x3) and (1,1) strides with padding for the same output size. Batch normalization and ReLU activation were applied after every convolution layer. All max-pooling layers have a pooling size (2x2) and (2,2) strides with padding for the same output size. Scaling and biasing layers with ReLU activation are provided for conditioning, and followed by a two fully connected (FC) layers with the 512 units. It is then connected to the output layer.
The raw audio input is converted to mel spectrogram with 32 ms window length, 10 ms hop length, 125 Hz the lowest frequency, and 7,500 Hz the highest frequency. The input of the network has the shape of (64, 100) corresponding to the number of frequency bands and frames.

Implementation details
The dataset has an audio length of about 1 second with short silence before and after the sound. We only used the first 1 second of audio and zero-padded if it is shorter than 1 second. All audio was resampled to 16 KHz and subjected to maximum normalization.
The performance of the proposed method was evaluated as an average of 10 trials and the validation set was randomly selected with 20% of the training set in each trial. For training, was used a batch size of 64 and the maximum number of epochs were set to 100. Adam [23] optimizer with a learning rate of 0.0001 were used, and we chose the model which has the lowest loss in the validation set. The experiment is implemented in Tensorflow [24].

Training strategies
In the experiments, we compare four different training strategies which are Base, Deconv, Aug, and Cndt. The Base is trained using only the original train set with 3,000 data.
The Deconv has the same training strategy as Base, but at the inference time, it has the RIR deconvolution operation at the front of the network. Since the exact RIR cannot be obtained in the realworld target environments, at the inference time, we randomly selected the RIR at different points within the same room rather than the exact RIR.
The Aug is trained using an augmented train set that convolved random virtual RIR with the original train set for every epoch. The reason for using virtual RIR is that the real-world RIR is not diverse enough to apply the augmentation method, on the other hand, the virtual RIR has the advantage that can be created indefinitely with various reverberation characteristics. The virtual RIR is generated using the image method [25] and its implementation 1 . We set up nine virtual rooms, each with a different size and different reverberation 1 https://github.com/ehabets/RIR-Generator time between 0.15 and 0.7 seconds to cover various room conditions. We generated 100 RIRs at random points in each room, resulting in a total of 900 virtual RIRs.
Cndt is trained using an augmented train set and applied the proposed conditioning method. The exact virtual RIR that convolved with the input audio is given as a RIR input pair. For the RIR pair of the original clean train data, an unit impulse signal (discrete delta function) that does not change the signal after convolution is provided. Also, similar to Deconv, at the inference time, we randomly selected the RIR at different points within the same room rather than the exact RIR. Figure 2(a) shows performance on the four different training strategies on the original clean test set (Clean) and the simulated test sets (R027∼R134). Base shows over 98% accuracy on the Clean which has about 0 seconds T60. However, performance degrades in simulated test sets that are distorted by reverberation. For the rooms that have over 0.6 seconds T60, accuracy is degraded under 50%. It is observed that reverberation affects SEC performance significantly and the degradation is intensified as the T60 increases.

Non-availability of the deconvolution algorithm
Deconv in Figure 2(a) shows a significance performance drop as T60 increases. As mentioned in Section 4.4, we used the RIR of a different point in the same room, which is similar to the exact one, but not precisely the same. The results show that performance is worse than the Base model and it implies that in the real-world, even if we can get a RIR of the target room, the deconvolution algorithm is non-available.

Proposed conditioning method
Aug in Figure 2(a) shows over 98% accuracy on the test sets with short T60 (Clean, R027, R029). However, as the T60 increases, the performance decreases. Especially test sets that have T60 over 0.7 second, which is the maximum T60 value of the augmented train set, Fig. 3. The results of the fake conditioning experiment with Cndt in three rooms R027, R055, and R134. Each dot point represents the performance conditioned with each fake room for the fake conditioning, and the dot point with a yellow circle represents the performance of the true conditioning.
show an intensified performance drop. The result indicates that it is difficult to achieve stable performance only using the augmentation technique, especially when the T60 of the target room is long.
Comparing with Aug, Cndt shows statistically significant performance improvement in four test sets with long T60 (R055, R068, R077, R134) (p < 0.01). It suggests that the proposed conditioning method complements the performance of the Aug, and the longer the reverberation time of the test set, the greater the effect. The results of the R055, R068 indicate that the proposed conditioning method gives an additional enhancing effect even if the reverberation time of the target rooms is considered in the train set by augmentation technique. Also, the results of the R077, R134 indicate that with the unknown target rooms in the training phase, the proposed method can improve performance using non-training information of target rooms. It means that it does not need to re-train the classifier, so it can reduce the amount of data required for training by alleviating the need to force the model to have the generalized performance to all rooms. For scaling and biasing operation for conditioning, similar to [13], using only the scaling layer showed more performance gain than using only the biasing layer, but using both layers achieved better results. An extensive analysis of what information each operation is conditioning is left as future work. Figure 2(b) shows the performance of the chosen six rooms related to the direct-to-reverberant ratio (DRR) of each room. We divided the RIRs of each room into three groups (Low, Medium, High) related to the DRR value and evaluated performance using the simulated test set per room and per DRR group.

Performance related to the DRR
Base in Figure 2(b) shows that performance increases as DRR increases and it implies that if the distance to source audio increases, the performance will decreases. Similar to the results of Figure 2(a), comparing with Aug, Cndt shows statistically significant performance improvement in all three DRR groups in four test sets with long T60 (R055, R068, R077, R134) (p < 0.01). It implies that the proposed conditioning method can improve performance not only in various T60 room environments but also in various DRR points.  Table 2. Classification accuracy (%) on the recorded test sets.

Fake conditioning experiment
We conducted the fake conditioning experiment that conditions using the RIR of rooms different from the room of the source audio, which means a pair of inputs is mismatched intendedly. Figure 3 shows its results on three test sets that are chosen in consideration with a variety of T60 lengths. According to the results of R027, the performance degradation is minimal when conditioning with RIR of rooms having T60 similar to R027, which is relatively short, but the performance decreases as the T60 increases. On the other hand, the results of R134 show a relatively slight performance degradation when conditioned with the RIR in rooms with long T60 similar to R134, but with shorter T60, the degradation is intensified. In the case of R055, the degradation is minimal when conditioning with the RIR of rooms having an intermediate T60 similar to R055, but is intensified when conditioning with RIR of rooms having a relatively short or long T60. The results of the fake conditioning experiments show that the proposed conditioning network tends to improve performance with RIR that has a similar reverberation time of the target room, and it suggests that with only the reverberation time information, it can be used to improve the SEC performance in that room, even if the exact RIRs of the target room are unknown. Table 2 shows the results on the recorded test sets which is closer to real-world reverberant environments. The RIR for each test set was simply acquired by recording impulse sound at a random point in each room. We found that the results show the same tendency as the simulated test sets. Base shows a significant performance drop in each real-world reverberant room, and Aug mitigates the degradation to some extent. The results of the proposed Cndt shows significant performance enhancement compared to other models. It suggests that our proposed method works not only in the simulated environments but also in the real-world reverberant environments.

CONCLUSION
In this study, we proposed a performance enhancement method for the SEC system applicable to real-world room environments. Evaluations using test data modeled the real-world reverberant rooms confirmed that the performance degradation worsened with increasing the reverberation time and decreasing the direct-to-reverberant ratio. To address this issue, we proposed a conditioning network using the room impulse response (RIR) of the target room. Experimental results show that the proposed method mitigates the performance degradation under various reverberation characteristic conditions. Moreover, the proposed conditioning method tends to improve performance even with the approximate RIR that have a similar reverberation time of the target room. It means that even if the exact RIR of the target room is unknown, our proposed method is still beneficial. Since the effectiveness of the method of adaptively utilizing the reverberation information of the target environment has been verified, a real-time calibration of the SEC system using more various adaptive information such as noise is left as future work.