Garcia Fernandez
email: guglielmofernandez@gmail.com

Guglielmo

Martignac François

Nevoux Marie

Corpetti Thomas

A deep neural network for multi-species fish detection using multiple acoustic cameras

Keywords: ARIS, artificial intelligence, convolutional neural network, DIDSON, fisheries management, sonar camera

Underwater acoustic cameras are high potential devices for many applications in ecology, notably for fisheries management and monitoring. However how to extract such data into high value information without a time-consuming entire dataset reading by an operator is still a challenge. Moreover the analysis of acoustic imaging, due to its low signal-to-noise ratio, is a perfect training ground for experimenting with new approaches, especially concerning Deep Learning techniques. We present hereby a novel approach that takes advantage of both CNN (Convolutional Neural Network) and classical CV (Computer Vision) techniques, able to detect a generic class "fish" in acoustic video streams. The pipeline pre-treats the acoustic images to extract 2 features, in order to localise the signals and improve the detection performances. To ensure the performances from an ecological point of view, we propose also a two-step validation, one to validate the results of the trainings and one to test the method on a real-world scenario. The YOLOv3-based model was trained with data of fish from multiple species recorded by the two common acoustic cameras, DIDSON and ARIS, including species of high ecological interest, as Atlantic salmon or European eels. The model we developed provides satisfying results detecting almost 80% of fish and minimizing the false positive rate, however the model is much less efficient for eel detections on ARIS videos. The first CNN pipeline for fish monitoring exploiting video data from two models of acoustic cameras satisfies most of the required features. Many challenges are still present, such as the automation of fish species identification through a multiclass model. 1 However the results point a new solution for dealing with complex data, such as sonar data, which can also be reapplied in other cases where the signal-to-noise ratio is a challenge.

Recent technological innovations largely increase the capacities for scientists to collect at high frequency in situ data. Consequently, ecology, like other branches of the biological and Earth sciences, has entered a world of big data, and is confronting the attendant opportunities and challenges [START_REF] Farley | Situating Ecology as a Big-Data Science : Current Advances, Challenges, and Solutions[END_REF][START_REF] Guo | Big Earth data : A new frontier in Earth and information sciences[END_REF]. To convert high-resolution data into high-value data, the development of optimized methodological approaches to extract relevant information in a timeand cost-effective way is a key step. This main challenge is common to all new numerical devices, in all ecosystems [START_REF] Valdenegro-Toro | Submerged Marine Debris Detection with Autonomous Underwater Vehicles[END_REF]. In aquatic environments, multi-beam high frequency acoustic or sonar cameras belong to the newest generation of hydroacoustic devices used for fish monitoring and species identification thanks to their high frequency and large detection beam [START_REF] Foote | Acoustic Methods : Brief Review and Prospects for Advancing Fisheries Research[END_REF][START_REF] Martignac | The use of acoustic cameras in shallow waters : New hydroacoustic tools for monitoring migratory fish population. A review of DIDSON technology[END_REF]. These sonars record continuously data at very high frequency (e.g. up to 10 frames per second), leading to data storage issues and substantial time dedicated to data analysis [START_REF] Martignac | The use of acoustic cameras in shallow waters : New hydroacoustic tools for monitoring migratory fish population. A review of DIDSON technology[END_REF], but they can overcome many unsolvable operational limits of optical video-counting methods: the presence of a solid structure restricting the fish passages and an imperative light source, consequences of a very limited detection range. Acoustic cameras are relevant alternatives but the nature of the images is remarkably different from common underwater optical imaging [START_REF] Kocak | A Focus on Recent Developments and Trends in Underwater Imaging[END_REF][START_REF] Lu | Underwater Optical Image Processing : A Comprehensive Review[END_REF][START_REF] Wang | An Experimental-Based Review of Image Enhancement and Image Restoration Methods for Underwater Imaging[END_REF]. Although acoustic camera is efficient and high potential device to diverse applications in ecology science, the lack of solution for automatic analysis of the data [START_REF] Helminen | Object and behavior differentiation for improved automated counts of migrating river fish using imaging sonar data[END_REF][START_REF] Shahrestani | Detecting a nearshore fish parade using the adaptive resolution imaging sonar (ARIS) : An automated procedure for data analysis[END_REF], greatly limits its deployment.

Computer Vision (CV) techniques, ranging from classical image analysis and machine learning (as Support Vector Machine, SVM, or Random Forests, RF) to deep learning techniques, have opened the possibility to automatically identify and classify objects of interest, offering tools that have displayed high efficiency and repeatability [START_REF] Lecun | Deep learning[END_REF]. Such methods can answer the challenge of extracting valuables informations from big data also in ecology. Indeed, in recent years there has been a remarkable growth of the using of such methods for image data analysis [START_REF] Christin | Applications for deep learning in ecology[END_REF][START_REF] Kwok | Deep learning powers a motion-tracking revolution[END_REF]: from camera-trap species detection [START_REF] Beery | Recognition in Terra Incognita[END_REF][START_REF] Norouzzadeh | Automatically identifying, counting, and describing wild animals in camera-trap images with deep learning[END_REF][START_REF] Schneider | Deep Learning Object Detection Methods for Ecological Camera Trap Data[END_REF][START_REF] Weinstein | A computer vision for animal ecology[END_REF] and photo-identification of individuals [START_REF] Miele | Revisiting giraffe photo-identification using deep learning and network analysis[END_REF] to video tracking [START_REF] Bonneau | Outdoor animal tracking combining neural network and time-lapse cameras[END_REF], these methods are paving the way to automation also in the wide range of conditions that are of interest in ecology, such as night/day cycle, partial exposition of the object, different meteorological conditions. Most of these methods are developed on optical data [START_REF] Weinstein | A computer vision for animal ecology[END_REF], while sonar imaging possess several different features [START_REF] Lankowicz | Sonar imaging surveys fill data gaps in forage fish populations in shallow estuarine tributaries[END_REF] that makes the direct application of these models impossible and the development of an analysis tool a more challenging task: for examples low signal-to-noise ratio, a large spectrum of noise frequencies and a low resolution of the objects of interest. These characteristics already make sonar imaging challenging for automatic analysis, but each camera model exhibit slightly different features, adding the feat of creating multi-camera models. It has to be stressed that answering to these challenges might also lead to new insights on how to solve similar complex problems in ecology (e.g. noisy data). First experiments to automate the analysis have been conducted in other water-related fields such as AUV guidance systems [START_REF] Zacchini | Forward-Looking Sonar CNN-based Automatic Target Recognition : An experimental campaign with FeelHippo AUV[END_REF] or underwater litter object detection [START_REF] Valdenegro-Toro | Submerged Marine Debris Detection with Autonomous Underwater Vehicles[END_REF]. Concerning fisheries management a few attempts have emerged recently [START_REF] Christensen | Deep Learning based Segmentation of Fish in Noisy Forward Looking MBES Images[END_REF][START_REF] Lee | Deep Learning from Shallow Dives : Sonar Image Generation and Training for Underwater Object Detection[END_REF][START_REF] Tarling | Deep learning with self-supervision and uncertainty regularization to count fish in underwater images[END_REF]. However the latter are limited or to single camera studies, or to synthetic data or to fish counting (without explicit detection): as we will see, this work represents therefore a first multi-camera, multi-species study, based on a large dataset (with a high variability data recorded on a long period of time), that poses a first step towards the development of general methods for acoustic cameras.

Machine learning algorithms require the calculation of some measurable property or characteristic of the images (so called "features") handly designed in advance, making the choice of the "good features" complicated (Jianbo [START_REF] Shi | Good features to track[END_REF][START_REF] Nixon | Feature Extraction and Image Processing for Computer Vision[END_REF]. On the contrary, deep learning algorithms are capable of calculating such "features" without any human intervention. Indeed, in recent years, important gains in performances have appeared in the community of image processing with the use of deep neural networks, whose objective is to construct a neural network composed of a large number of layers composed of elementary functions (neurons that model a simple relation between input/output). The concatenation of layers enables to model potentially very complex relations between inputs (noisy videos in our case) and outputs (detection of fish). Though the idea of combining several layers of neurons is old (H. [START_REF] Wang | On the Origin of Deep Learning[END_REF], the progresses in the recent years come from the fact that we have now enough data and associated computational resources to train such complex networks. In addition, some theoretical progresses on the definition and optimization of such networks have opened a wide range of applications. The reader can find in [START_REF] Lecun | Deep learning[END_REF] a general introduction to deep learning.

As for the processing of spatial data, the state of the art network for assigning a label to an image is the well-known CNN (Convolutional Neural Network). With this family of networks, a series of convolution and pooling layers jointly acts as automatic feature extractors that represent in a very relevant way the information contained in raw data. These features are so informative that complex computer vision tasks (classification, object detection, etc) become simpler. In recent years many architectures, either adapted to assign a label to each pixel (Fully Convolutional Networks and variants [START_REF] Long | Fully convolutional networks for semantic segmentation[END_REF]), to deal with unstructured data [START_REF] Qi | PointNet : Deep Learning on Point Sets for 3D Classification and Segmentation[END_REF] or to time series [START_REF] Karim | LSTM Fully Convolutional Networks for Time Series Classification[END_REF] for example have been proposed. More recently, the community is also focusing on the fusion of complex data, as for example in the context of satellite images [START_REF] Audebert | Deep Learning for Classification of Hyperspectral Data : A Comparative Review[END_REF].

In the context of acoustic imaging, because of the particular noise, the complexity of such data and their limited spatio-temporal variability, the feature extractor part of deep networks is still limited to distinguish fishes from noise, leading thus to poor performances. As a solution, we propose here to pre-process the data in a specific pipeline, based on Computer Vision, to help the optimization of the network to converge to a better minimum. The preprocessed data are then combined with the original one to provide "multichannel-layers", highlighting the interesting signal. This strategy, that is in general not common in deep learning, has already proven its results on optical underwater imaging [START_REF] Salman | Automatic fish detection in underwater videos by a deep neural network-based hybrid motion learning system[END_REF] and should constitute an original but simple solution to the acoustic imaging problems.

Apart from showing the potential of the developed model, we aim also to provide recommendations for the implementation of this kind of approaches. Particular attention will also be given to the possibility for a technology transfer to users, by testing the model on an ecologically relevant dataset from different types of acoustic cameras. Reaching the goal of automatic data analysis will make possible in the future to count fish passage in real time, which will be an important tool for biodiversity protection and management structures to better understand the interactions between aquatic ecosystems and the human sphere.

. Materials and Methods

1 Deep Learning Approach

We propose a hybrid method that embeds hand-crafted features in addition with raw images, to reduce the signal-to-noise ratio of the sonar data. By doing so, we inform the algorithm on interesting areas and therefore help the optimization on the network. Indeed, as it will be shown in Section 3.1, using raw images only leads to poor results. In practice we compute common CV features used in various domains such as image processing [START_REF] Nixon | Feature Extraction and Image Processing for Computer Vision[END_REF], physics [START_REF] Raissi | Physics-informed neural networks : A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations[END_REF][START_REF] Zdeborová | Understanding deep learning is also a job for physicists[END_REF] or geography [START_REF] Chen | Handbook Of Pattern Recognition And Computer Vision[END_REF][START_REF] Ma | Deep learning in remote sensing applications : A meta-analysis and review[END_REF]. As for the network, we choose an architecture devoted to "object detection", that localises a bounding box and assigns a label to it. In this context the R-CNN [START_REF] Girshick | Rich feature hierarchies for accurate object detection and semantic segmentation[END_REF], that combines several CNN with selective search, enables to isolate regions of interest. In this work, we used the You Only Look Once (YOLO v3) developed by [START_REF] Redmon | You Only Look Once : Unified, Real-Time Object Detection[END_REF][START_REF] Redmon | YOLOv3 : An Incremental Improvement[END_REF]. While other common architectures use a sliding trained classifier to detect object (as Faster R-CNN [START_REF] Ren | Faster R-CNN : Towards Real-Time Object Detection with Region Proposal Networks[END_REF]), YOLO simultaneously predicts the position, the size and the probability for the object to belong to one class, leading to fast performances without losing accuracy.

Among the objectives of this work, we also aim at testing the feasibility of using well known neural networks, keep the model simple, and help detection by adding information about the image through pretreatment. Reasons why we choose to employ a well-known CNN in our pipeline. Our model should not be understood only as an efficient model for the automation of acoustic camera analysis, but also as an important step before the application of more complex architectures on this type of signal, such as LSTM+CNNs (Long short-term memory) [START_REF] Ning | Spatially supervised recurrent convolutional neural networks for visual object tracking[END_REF][START_REF] Xia | LSTM-CNN Architecture for Human Activity Recognition[END_REF].

Hydroacoustic methods: acoustic cameras

An acoustic camera is a multi-beam high-frequency sonar designed to create high-resolution images. Unlike common hydroacoustic methods, fish's skin and fins are better perceived by acoustic camera's very high frequencies, making centimetric fish measurement possible from the images [START_REF] Martignac | The use of acoustic cameras in shallow waters : New hydroacoustic tools for monitoring migratory fish population. A review of DIDSON technology[END_REF]. According to their intrinsic characteristics (Table S.1), and being the first acoustic cameras available for ecological study purposes, DIDSON (Dual-frequency IDentification SONar; Sound Metrics Corp.) and ARIS (Adaptive Resolution Imaging Sonar; Sound Metrics Corp) are the most commonly used cameras to monitor fish in the wild [START_REF] Cook | Validation of fish length estimations from a high frequency multi-beam sonar (ARIS) and its utilisation as a fieldbased measurement technique[END_REF][START_REF] Helminen | Object and behavior differentiation for improved automated counts of migrating river fish using imaging sonar data[END_REF][START_REF] Keeken | Migration of silver eel, Anguilla anguilla, through three water pumping stations in The Netherlands[END_REF][START_REF] Lagarde | In situ evaluation of European eel counts and length estimates accuracy from an acoustic camera (ARIS)[END_REF][START_REF] Lenihan | Assessment of silver eel (Anguilla anguilla) route selection at a water-regulating weir using an acoustic camera[END_REF][START_REF] Shahrestani | Detecting a nearshore fish parade using the adaptive resolution imaging sonar (ARIS) : An automated procedure for data analysis[END_REF][START_REF] Yang | Fish Monitoring through a Fish Run on the Nakdong River using an Acoustic Camera System[END_REF]. In the context of fish population monitoring in rivers, acoustic camera are horizontally oriented, set on one riverbank looking the other [START_REF] Daum | Use of Fixed-Location, Split-Beam Sonar to Describe Temporal and Spatial Patterns of Adult Fall Chum Salmon Migration in the Chandalar River, Alaska[END_REF][START_REF] Maxwell | The Feasability of Estimating Migrating Salmon Passage Rates in Turbid Rivers using a Dual Frequency Identification Sonar (DIDSON)[END_REF].

The acoustic datasets employed in this study have been recorded on monitoring sites during longterm and continuous surveys. Thus, the datasets include all the aquatic fauna activity in a multispecific population with several species of interest in term of conservation and management of populations, such as diadromous or invasive fish species. DIDSON videos have been recorded on the Sélune River (Normandy, France) and ARIS videos on both Sélune and Touques rivers (Normandy, France). Examples of DIDSON and ARIS images are reported in Figure 1, panel a. The acoustic videos are sequences of contiguous images of more than 15 minutes. For both cameras, fish passages have been recorded at distances ranging from 1 to 17 meters, at a 1.8 MHz frequency (HF for DIDSON; LF for ARIS) at 5 frames per second. The fish species have been identified by an experienced operator on the video datasets, interpreting behavioural and morphological fish characteristics, adding biological expertise such as diadromous fish phenology or trophic behaviours [START_REF] Martignac | The use of acoustic cameras in shallow waters : New hydroacoustic tools for monitoring migratory fish population. A review of DIDSON technology[END_REF]. These videos were used as a basis to elaborate both datasets.

3 Datasets

Two datasets have been used in this study: the "Training Dataset" (TD) to train, evaluate and test the deep learning model on a dataset of images and the "Validation Dataset" (VD), to test the full pipeline on videos with a high abundance of fish passages (more details on the datasets are given in SI).

The TD is composed of 4 817 images, 1 612 from ARIS camera's clips (short sequences where only the images with fishes have been chosen) and 3 205 from DIDSON camera' clips. The clips have been carefully chosen to integrate variability in the TD: different species, thus individual with large ranges of morphology (body shape, undulation, lengths) and behaviour (i.e. swimming pattern), different environmental conditions (i.e. river flow) and extracted from two monitoring sites, different recording window lengths and ranges, different times of year. We ensured that passages of fish species of interest were recorded in the TD: diadromous species, such as the Atlantic salmon (Salmo salar), the European eel (Anguilla anguilla), the sea lamprey (Petromyzon marinus), the Allis shad (Alosa alosa) and an opportunistic predator, the European catfish (Silurus glanis). In the TD, all the images have been annotated with a bounding box and a label corresponding to the species, even if all the labels coalesce during the treatment in a unique "fish" label (see Table S.2 for the distribution of each species in the TD). In order to ensure the accuracy of the model also on sequences where no passage are present, 1 196 images where no fish are present have been added to the test set (428 for the ARIS camera, 768 for the DIDSON camera).

The VD is composed of 184 videos (sequences of more than 15 minutes), 80 for ARIS camera and 104 for DIDSON camera, for a total of around 40 hours of recording. The videos of the VD integrate the same variability as the TD. Each fish larger than 20 cm have been counted and described with the passage hour (20 cm been, according our experience, the minimum size limit to efficiently see and track a fish), the fish size range (four classes: 20-40 cm, 40-60 cm, 60-80 cm and larger than 80 cm), its position in the detection beam, its swimming direction and its fish species if an undoubted identification was possible according its morphology and behaviour (otherwise a "generic fish" label was used), no bounding boxes were saved (see Table S.3 for the distribution of each species in the VD). In 33 clips (6 for ARIS camera and 27 for DIDSON camera), not a single fish passage is present, for a total of around 6 hours. More details on the datasets are given in S.1.

4 Deep Learning Model and Validation

During the training, the whole set of weights was optimised, starting from the pre-trained Darknet's weights of the original YOLO [START_REF] Redmon | You Only Look Once : Unified, Real-Time Object Detection[END_REF]. All training were performed with the same hyperparameters: learning rate of 0.001, decay of 0.0005 and momentum of 0.9. The network resolution was set to 608 x 608 pixels. For more details on the optimization of neural networks, we refer the reader to (R. [START_REF] Sun | Optimization for deep learning : Theory and algorithms[END_REF].

We defined two levels of validation: a "model validation", with a set of metrics commonly used to evaluate CNN models and calculated on the TD dataset, and an "ecological validation", in which the CNN model is tested on the VD dataset to assess the efficiency of the model in the frame of ecological studies and to conclude about the real-applicability on monitoring sites data. positives and TN true negative. The confusion matrix is normalised by column, so TP+FN=1 and FP+TN=1. We expect a confusion matrix that presents at least a TP rate greater than 70%-75% and a FP rate as low as possible, to avoid the operator spending too much time verifying the detections found. As mentioned in Section 2.2, a large part of the video stream consists of images with no fish (TN). Apart from the confusion matrix, to evaluate the equilibrium between TN and TP we have included in the metrics the Cohen's kappa coefficient, κ [START_REF] Cohen | A Coefficient of Agreement for Nominal Scales[END_REF][START_REF] Landis | The Measurement of Observer Agreement for Categorical Data[END_REF]. The latter already provides an interpretative framework, with a value considered "good" starting in general from 0.60-0.80.

Concerning the "ecological validation", the model is applied on the entire VD to assess its efficiency to detect fish larger than 20 cm. The entire reading of the VD videos' by an operator are compared to the model outputs to validate if the model detects efficiently the passage of one fish described by an operator. Even if the classifier is single-class, the results have been evaluated in terms of all species of interest. The comparison aims to assess the possible effects of biological and environmental variables on the model efficiency, such as the fish species (by their morphological and behavioural differences), the fish size range, distance to the camera, or the seasonal environmental conditions. When evaluating the VD, a filter has been added at the end of the pipeline, to avoid flash detections: all detections that do not have a subsequent detection in the next image with an overlapping bounding box are automatically rejected. Since this validation deals with sequences, we defined as a TP each passage of a fish for which the neural network have found the fish on at least two consecutive images, to avoid counting flash detections (detection on a single image). Indeed a fish passage can be identified by the detection on only a few consecutive images, so TP and FN can be easily defined in function of detected fishes. Such reasoning cannot be applied for the calculation of TN, expressed in number of images where no fish is found compared to the total number of images without any fish. This limitation of our approach makes impossible to write a confusion matrix where all elements are expressed in function of the same quantity. To evaluate the TN%, we took into account only the 33 clips without any individual present. Finally the FP are defined as each false detection of a fish consecutive on at least two images. We compared the FP number with the entire number of passages in the ground truth on the same clip. Such estimation gives an idea of how many detections an operator have to manually verify for each clip and consequently appear as a proxy of the operator time spending. In general, we aimed to maximize the TN% (to sort the empty sequences), but also to minimize the undetected fish passages, meaning a high TP% (larger than ~75%) and a rate between FP/TP as low as possible.

5 Data preprocessing

The first preprocessing step was the background segmentation of each clip, using the Gaussian Mixture-based Background/Foreground Segmentation Algorithm as implemented by Zivkovic et al. [START_REF] Zivkovic | Efficient adaptive density estimation per image pixel for the task of background subtraction[END_REF], to generate the "background masks", "b". The variance threshold for the pixel-model match depends on the camera type and were set to 130 for DIDSON clips and 10 for ARIS clips. Due to the noisy nature of the signal, the parameters were chosen to optimise noise reduction limiting meaningful loss of the signals. In order to further reduce the saltand-pepper noise in the "b" masks, each one has been smoothed using a median filter with a 3x3 aperture [START_REF] Huang | A fast two-dimensional median filtering algorithm[END_REF]. The resulting images were further processed with an opening operator [START_REF] Dougherty | Hands-on Morphological Image Processing[END_REF], with a structuring element of dimensions 3x3 and a cross-hair shape.

The resulting masks are named "background filtered masks", "bf" (see Figure 1). The two masks and the raw images (called "r") are used to compose the processed RGB images "rbbf". All the information "r" images are in the blue channel, therefore only this channel was used. The green channel was assigned to the "b" mask and the red channel to the "bf" masks. To demonstrate the influence of each mask, we tested also the 2-channel images "rb" and "rbf". During in the training, for all the models (with exception of the raw's one), colour data augmentation was disabled. The choice of these masks was driven by a "best performance" principle: several other sets of masks have been tested, ranging from temporal median filters to optical flow maps, with some of them converging to the same type of results (not presented). However a specific discussion of these sets of masks is beyond the scope of this paper. As this is the first work datasets, multiple cameras and approach, it was necessary to assess the Deep Learning architecture on the different level of preprocessing. Amongst the different performance measures, we choose to compare the models using the AP@0.50 metric evaluated on the "val" set (see SI for details on the dataset splitting). As shown in Figure 2, the models trained on the unprocessed images and in combination of a single mask present an oscillating behaviour of the AP@0.50, suggesting an overfitting, and stabilise only at the end of the training. The model with unprocessed images ("r") reaches an AP@0.50 of 53%: this data constitutes, so, the "null model" for the others. Both the "rb" images and "rbf" images exhibit a similar behaviour, showing an improvement in the evaluation metric that reaches 69% for the "rb" model. This data suggest that both the "b" mask or the "bf", separately, improve the performance of the detection, but also that these masks individually are not a viable alternative to the original images (see Figure S.1). Finally the model trained on the "rbb f " images shows stable convergence and is able to reach 72% of AP@0.50. In order to verify which model is able to well generalise (being able to classify data of the same kind of images as the training ones, but that the CNN has never seen before), we compared the evaluation metrics (precision, recall, F 1 -score and AP@0.50) for the different models on the "test" set of the TD dataset (see Table 1 and Figures S.1 and S.2). The AP@0.50 presents lower values for all the models, as expected, but surprisingly the "rb" model exhibits metrics similar to the "rbbf", thus suggesting that in the latter the "b" feature is the most important one. The highest F 1score is found for the "rbbf" model: this, added to the well-behaved training showed in Figure 2, leaded to the choice of the "rbbf" model (a scheme of this model is given in Figure 3). 1. Validation metrics for the various models calculated on the "test" set of the TD dataset. 13

. Results

Influence of the data treatment

Model validation

As mentioned in Section 2.4, the focus of this work is not only on the detection of TP (of which some examples are showed in Figure 4), but also to reach good performances on TN/FN detections. The Cohen's kappa coefficient, κ, was calculated for the model trained on the "rbbf" images on the "test" set of the TD dataset, leading to a κ = 0.73: for similar tasks [START_REF] Fleiss | Large sample standard errors of kappa and weighted kappa[END_REF] such score is largely above the threshold of the "good" score. This suggest that the detector is able to discriminate between TP and TN. To confirm this, we calculated the confusion matrix: as showed in Table 2, the detector is performing very well (87%) on the TN, while keeping good results (61%) for TP. Such result suggests that our detector is able to sort out efficiently all the sequences without any passage of fish, while maintaining a high probability to identify the sequences with the presence of an individual, even looking at the single image and not to a sequence. The confusion matrices of each camera (Table S.5) show different performances: while for DIDSON we reach optimal scores (larger than ~70%) for both TP% and TN%, for ARIS the TP% is too low, at least for such test based on single images.

Ground truth

Fish No Fish Predicted Fish 0.61 0.13 No Fish 0.39 0.87 Table 2. Confusion matrix for the "rbbf" model, normalised by column, calculated on the "test" set of the TD dataset.

Ecological validation

As shown in Table 3, the total recall, or TP%, for the DIDSON camera exhibit an increasing trend with the fish size, with the best results starting from the 40-60 cm class and reaching more than 90% for large size fish. The same trend is present for the ARIS camera, but with lower results, with a maximum around 80% for large size fish. For small and medium-sized fish and for fish detected on the ARIS camera, the results are below the threshold of ~70-75%, for which the signal can be confused with the noise of sonar signal. Even if these results outline the general efficiency of our method, a detailed analysis of the main species of interest (Atlantic salmon and European eel) reveals some differences in the performances. For the Atlantic salmon, the results are remarkably high with both cameras and for all fish sizes, even if for the ARIS camera no large dataset is available. On the contrary, for the European eel the DIDSON camera offers satisfactory results

(with TP larger than ~70%) only for 60-80 cm size. For the ARIS camera, none of the values exceed 75%. The FN% is simply 1-TP%, therefore the same observations apply: higher values of FN% are concentrated on small sizes, meaning that small individuals will not be efficiently detected by our automatic analysis.

Recall (%TP) in function of fish size For both cameras TN%, calculated on a set of empty long clips as explained in 2.4, is very high (around 99%), hinting that the method is capable to identify the sequences where an individual is probably present, discarding those where only sonar noise is present.

The average FP% on all the long clips is 0.67% for the DIDSON camera and 0.48% for the ARIS camera, meaning that an operator can expect a small rate of detections that are not fish. A more detailed analysis of the FP% reveals a large variance, especially for the DIDSON camera: the value, when calculated on the individual long clip, oscillates between 0.30 and 30, depending on the environmental conditions and/or the state of cleanliness of the lenses (on which the noise level depends). A more interesting indicator is therefore the median of the FP/TP rate. For the DIDSON data this metric is 0.83, while it is 0.40 for ARIS data (see Figure S.2 and S.3 for the distributions of the FT/TP rate). In both cases the median is below 1, suggesting that for most of the clips the number of FP will be smaller than the TP: with our model it is necessary a check of the detections by an operator, but in many cases it is a trivial operation.

. Discussion

In a context of big data acquirement in ecological studies, such as camera trap data, the automation of the data extraction for analysis is one main issue that tends to be solved by the Convolutional Neural Networks (CNN) [START_REF] Valdenegro-Toro | Submerged Marine Debris Detection with Autonomous Underwater Vehicles[END_REF]. Indeed, those models are seeing a growing interest for their capacity to calculate the "good features" without any pre-treatment, but in case of complex data, such as sonar imaging, it yields to poor performances. A common route to solve this is to design or to modify an existing CNN architecture, for example adding more deep layers that are able to extract the peculiarity of the data as for noise treatment. However, this increases the number of parameters to optimize and yields to minimization difficulties. As a less common process, we suggest to pre-treat the data in order to elaborate an image composed by different masks, enhancing the signal. The advantages of this route are that it is easier to compare performances with existing ones developed in other fields, it can be based on the parameters and weights of other models even in complex situations and it is conceptually straightforward (opposed to over-complexed neural networks [START_REF] Belkin | Reconciling modern machine-learning practice and the classical bias-variance trade-off[END_REF]).

The protocol of validation must take into account the metrics used in deep learning to assess the performances of the algorithm. However real life application may deal with an amount of data with high levels of variability that might not be fully taken into account by standard deep learning validation protocols. Increasing the training dataset does not necessarily guarantee better results and requires considerable operator effort [START_REF] Cho | How much data is needed to train a medical image deep learning system to achieve necessary high accuracy[END_REF][START_REF] Sun | Revisiting Unreasonable Effectiveness of Data in Deep Learning Era[END_REF]: the two-step validation that we proposed here can be considered as a viable strategy in order to limit the effort of labelling and validate the method on real-life scenarios. When the above conditions are met, we can therefore recommend trying the method outlined here at least as a first approach to exploring the limits of the most current CNNs.

The presented model itself exhibit interesting results. Looking at the TP% in function of fish size, we can affirm that the method is more than satisfactory (with values larger than ~75%) for all fish with size > 40 cm moving on DIDSON camera videos and > 60 cm for fish on ARIS. Despite the poor resolution of the acoustic camera images resolution face to optical images [START_REF] Martignac | The use of acoustic cameras in shallow waters : New hydroacoustic tools for monitoring migratory fish population. A review of DIDSON technology[END_REF], our method offers the possibility to optimize the detection of fish corresponding to these size thresholds without interfering with their behaviour with a transposable device on until 15meters wide river sections, a clear advantage compared to the common monitoring devices such as video-counting.

Since we expect to apply such model to monitor fish populations in rivers where most of the recorded images will be of True Negative type (images where no a single fish is present) to reduce drastically the time an operator spend to search for a fish passage. With this in mind, our method proved to be remarkably efficient with both acoustic cameras, despite the differences in image quality and resolution. In parallel, we desired also a model able to minimize the FP rate, so that less time possible is spent in checking the correctness of the detections. Overall, the average FP% is low enough to reach our operational objectives, when compared to the total number of fish passages.

However some flaws are identified. The model show some difference in performances between DIDSON and ARIS cameras: for example, the ARIS TP% are always lower than DIDSON's (between ~5% and ~25% lower, see Table 3), for all fish sizes and species. This might be due a number of different aspects that differentiate the ARIS camera: a lower noise but higher image resolution, deeper record window resulting in smaller objects but also fewer images in the training set. A first possibility for improvement may be to increase the amount of ARIS data in the TD dataset, before moving on to develop two different models for the cameras. A second flaw is given by the different performances in function of the species of interest as, for example, for the European eel: the TP% is not optimal (below ~70% for 40-60 cm) neither with the DIDSON camera, nor with the ARIS (none of the values exceeds 70%). Indeed, the eels have a particular body shape and swimming behaviour, with a serpentine undulation [START_REF] Webb | Locomotor Patterns in the Evolution of Actinopterygian Fishes[END_REF] that make them less visible on the sonar images than the other fish species [START_REF] Lagarde | In situ evaluation of European eel counts and length estimates accuracy from an acoustic camera (ARIS)[END_REF]. Furthermore, European eel adults can be shorter than adults from another serpentine shape aquatic species like the Sea lamprey. Solving this requires to take into account explicitly the temporal correlation between images in which the same species is present. For example developing a LSTM-CNN based video object trackers as the ROLO architecture [START_REF] Ning | Spatially supervised recurrent convolutional neural networks for visual object tracking[END_REF]. Such kind of neural networks might help also to improve another characteristic: the low rate detections on small sized fishes, lower than 40 cm. The difficulty of some neural networks in detecting small objects is a well-known problem [START_REF] Tong | Recent advances in small object detection based on deep learning : A review[END_REF]: an alternative method can be to test a CNN designed specifically for this kind of problem.

Beyond the performances, our model is characterized to have only one class "fish". This feature should not be considered a pitfall if the goal is a global monitoring of fish biological activity. Even if the datasets are elaborated from videos that were recorded on two sites, it has not to be excluded a certain degree of transferability of the model. In order to expand the method to more specifics uses (such as study of a single species), one of the most important steps in the future is, indeed, to improve this first version to increase the general efficiency and add multi-class identification.

To summarise, we developed a multi-camera and multi-species CNN-based neural network pipeline to automate fish recognition in a sonar video flux. We tried also to propose some check the metrics during the optimisation and "test" data to calculate the metrics once the optimisation is over.

In the VD dataset, the total dataset correspond to around 660 000 images. FN is the total number of False Negative. R is a measure of how many relevant data are found, compared to the whole relevant data.

F1-score

F 1 =2 PxR P+ R
F1 is a mean between P and R. Its are between 0 and 1 (perfect recall and precision).

Intersection over Union (IoU)

IoU= area( bb p ∩bb g -t ) area( bb p ∪bb g-t )

bbp is a predicted bounding box and bbg-t is a ground-truth box. The IoU, used in the calculation of the AP@0.50, is a measure of the spatial agreement between the ground-truth and predicted boxes.

Average Precision (AP@0.50)

AP= ∑ i n-1 (r i +1 -r i ) p (r i+1 )
ri are the recall levels and p(ri) is the interpolated precision. See PASCAL development kit for more details. Only the detections with an IoU ≥ 0.50 are counted in the calculation of the AP. This metric, commonly used in deep learning, is the average precision between different recall levels.

Cohen's kappa (κ) κ= p 0 -p e 1-p e κ is a measure of the inter-rater reliability. In our case the first rater is the neural network and the second is the operator that annotated the ground-truth. p0 is the observed agreement between raters. Pe is the probability of a random agreement.

Table S.4: Metrics used for the model validation.

Figure 1 .

 1 Figure 1. Examples of images (ARIS on top, DIDSON on bottom); raw images (a), background mask (b) and background filtered mask (c); the red arrow points to the fish position.

Equation 1 .Confusion

 1 Confusion matrix; TP is the number of true positives, FP of false positives, FN of False positives and TN of True NegativeConcerning the model validation, we adopted six metrics: precision, recall, F 1 -score, AP@0.50, Cohen's kappa coefficient (explained in TableS.4) and confusion matrix. The latter is defined in Equation1, where TP is the number of true positives images, FP false positives, FN False 9

Figure 2 .

 2 Figure 2. Loss (dotted line) and AP (solid line) for different models: r (blue), rb (green), rbf (violet) and rbbf (red).

Figure 3 .

 3 Figure 3. Scheme of the "rbbf" model's pipeline, from raw data ("r") to the detections, through the background segmentation ("b" mask), the denoising step ("b f " mask) and the CNN network.

Figure 4 :

 4 Figure 4: example of detections on the rbbf images from the test set of the TD dataset; ARIS images on top (a) with the detection of (from left to right) an Atlantic Salmon, a Sea Lamprey and a Giant catfish; DIDSON images on bottom (b) with the detection of (from left to right) a Sea Lamprey, Atlantic Salmon and a European catfish.

  recommendations in order to put to good use our experience such as the importance of preprocessing to keep models simple, the importance of a double validation or how to tackle cases of abundant TN data. Our model satisfy most of the required features, but this study only started exploring the potential of deep learning on such complex imaging and many challenges are still present. In a more general manner, the possibility to extract an accurate monitoring of fish populations from video-like analysis might answer to long-standing questions in aquatic ecology and open new ones, not only for researchers but also for biodiversity protection and management structures. G.F.G. developed the model, based on ideas developed with T.C.. M.M., F.M. and L.B. guided the development of the model concerning the ecological applications. F.M. collected the data and created the datasets along with G.F.G.. G.F.G. and F.M. wrote the first drafts and all authors discussed the results, implications and edited the manuscript.

Figure

  Figure S.1: training run with only the 'b' mask (violet) and only the 'b f ' mask (green). In dark colors the loss function and in light colors the AP@0.50 as a validation metric.

Figure S. 2 :

 2 Figure S.2 : FT/TP histogram for ARIS camera on the VD dataset ; to highlight the data, the scale has increments of 0.1 between 0.0 and 1.0, 1.5 between 1.0 and 10, 5 between 10 and 100.

Figure

  Figure S.3 : FT/TP histogram for DIDSON camera on the VD dataset ; to highlight the data, the scale has increments of 0.1 between 0.0 and 1.0, 1.5 between 1.0 and 10, 5 between 10 and 50.

Table of Content

 of

	Introduction
	Materials and Methods
	Deep Learning Approach
	Hydroacoustic methods: acoustic cameras
	Datasets
	Deep Learning Model and Validation
	Data preprocessing
	Results
	Influence of the data treatment
	Model validation
	Ecological validation
	Discussion 1. Introduction

Table 3 .

 3 Recall (%TP) for the rbb f model, calculated on the VD dataset (dataset of videos).

	Species	Camera	20-40	40-60	60-80	> 80	Total
	All species	DIDSON	57.62	76.22	90.00	93.33	67.91
		ARIS	52.87	55.39	83.72	88.89	55.13
	Atlantic salmon	DIDSON ARIS	NA NA	92.86 100.00	96.97 100,00	100.00 NA	96.23 100.00
	European eel	DIDSON	NA	57.14	93.33	66.67	75.00
		ARIS	7.69	25.00	66.67	50.00	30.49
	Other species of interest	DIDSON ARIS	0 NA	100.00 NA	100.00 NA	83.33 71.43	94.44 71.43

Table S .

 S 2 : distribution of each species of interest in the 50 clips of the TD. Each clip may contain more than one species and more than one passage. Table S.3: Number of clips for the species of interest by size in the VD dataset. TP is the total number of True Positive and FP of False Positive. P is a measure of how many relevant data are found, compared to the whole found data.

	Recall (R)		R=	TP TP +FN
	Species	Total clips	Total	ARIS clips	ARIS	DIDSON	DIDSON
			annotations			annotations	clips	annotations
	Atlantic salmon	20	1117		6	268	14	849
	European eel	12	1161		8	568	4	593
	Sea lamprey	9	324		1	22	8	324
	Allis shad	11	718		1	290	10	428
	Giant catfish	10	633		7	418	3	152
	Total	62	3953		23	1566	39	2346
						Fish size
	Species	Camera	20-40	40-60	60-80	> 80	Total
			Fish species of main interest
	Atlantic salmon	DIDSON ARIS	0 0		14 2	33 10	6 0	53 12
	European eel	DIDSON	0		14	15	3	32
		ARIS	13		52	15	2	82
			Other fish species, included
	Generic Fish (unidentified)	DIDSON ARIS	315 248		505 419	30 18	2 0	852 685
	Sea lamprey	DIDSON	0		0	2	2	4
		ARIS	0		0	0	1	1
	Allis shad	DIDSON	0		1	0	0	1
		ARIS	0		0	0	0	0
	European catfish	DIDSON ARIS	0 0		0 0	0 0	2 6	2 6
	Metric		Equation		Notes
	Precision (P)		P=	TP TP +FP

Acknowledgements Authors' contributions Data Availability References

Acknowledgements

We gratefully thank the OFB (Office Français de la Biodiversité -French Office for Biodiversity) for the foundings.

Authors' contributions

Data Availability

The TD and VD datasets are available, respectively, at doi:10.5281/zenodo.5046708 and doi:10.5281/zenodo.5092010. The code is available at the following GitLab: https://forgemia.inra.fr/pole-migrateurs/Acoustic/acoustique.

In the TD dataset, all the images are extracted from 23 ARIS clips and 39 DIDSON clips. The TD is divided into a training set (60% of the images), an evaluation set (19%) and a test set (21%): in this scheme, typical in deep learning, "train" data is used to optimise the CNN parameters, "val" data to


G Bourguin
email: gregory.bourguin@univ-littoral.fr

A Lewandowski

M Bouneffa

A Ahmad

Towards Ontologically Explainable Classifiers

Keywords: machine learning, ontology, explainability, classifier

In order to meet the explainability requirement of AI using Deep Learning (DL), this paper explores the contributions and feasibility of a process designed to create ontologically explainable classifiers while using domain ontologies. The approach is illustrated with the help of the Pizzas ontology that is used to create a synthetic image classifier that is able to provide visual explanations concerning a selection of ontological features. The approach is implemented by completing a DL model with ontological tensors that are generated from the ontology expressed in Description Logic.

Introduction

The last years have been characterized by a large democratization of solutions using Machine Learning (ML), and particularly Deep Learning (DL). This wide spread has been accompanied by questions regarding their trustworthiness. Many research papers have recently underlined the problem of the opacity of DL algorithms. This issue is at the heart of the XAI [START_REF] Arrieta | Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AI[END_REF] initiative.

As stated in [START_REF] Hendricks | Generating visual explanations[END_REF], "clearly explaining a rationale for a classification decision to an end-user can be as important as the decision itself". It is thus necessary to create AI solutions that are able to provide explanations regarding their decisions, but moreover, these explanations also need to be understandable by the users, i.e. while using the adequate abstraction level. The users' abstraction level mainly depends on their knowledge, their expertise, or even their viewpoint.

Widely used in the Knowledge Management and Engineering research domains, the ontologies aim at reifying the knowledge of users involved in specific domains, thus allowing algorithms to use it. Taking note of the crucial need for explainable AI, the purpose of this paper is to explore a process for creating automatic classifiers that are able to provide explanations founded on an ontology. We do not focus here on new means for improving classification, but on the contributions of ontologies for explainable AI. We also explore the feasibility of such an approach while using the classical ML tools, and propose a solution that allows to complement a DL model with a graph of tensors that is automatically generated from description logic assertions coming from the targeted ontology.

The 2nd part of the paper proposes a state of the art concerning solutions for providing explainable AI. The 3rd part of the paper illustrates the benefits expected from a process involving ontological reasoning for explainability, and introduces the generic approach we propose. The 4th part presents its application through the implementation of an ontologically explainable image classifier. The 5th part presents our conclusions resulting from this experiment.

Explainability

The systems using ML are more and more efficient, but also more and more complex and opaque. They appear as black-boxes [START_REF] Dosilovic | Explainable artificial intelligence: A survey[END_REF] making problematic for human to step in and understand their decisions, and to control their deployment, execution, and evolution [START_REF] Lipton | The mythos of model interpretability[END_REF][START_REF] Arrieta | Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AI[END_REF]. As a consequence, the need for transparency, and moreover, AI explainability has been revealed crucial.

Post-hoc model explanation

The tools for explaining decisions of DL systems mainly follow post-hoc approaches designed to provide explanations about pre-existing models. Most of theses methods are also called agnostic because they can be applied to any DL algorithm.

Most explanation techniques rely on the idea of associating each input feature with a value representing its importance for highlighting the key factors participating in the final prediction. It is thus possible to get explanations concerning a particular prediction, or more global ones represented with different graphics associating features, importance factors and predictions. One of the domains where this type of works is the best represented is Computer Vision (CV). In CV, the raw input features correspond to the image's pixels. The propositions consist in making a correspondence between the predictions and the pixels that leaded to a classification. Diverse approaches have been adopted and one of the most representative is the Grad-CAM [START_REF] Zhang | Interpretable convolutional neural networks[END_REF] method (and derivatives) that uses the gradient of a targeted class to produce a heatmap highlighting the image's regions that most participated to its prediction. The techniques using input features to explain a model are not limited to CV. Tools like LIME [START_REF] Ribeiro | Explaining the predictions of any classifier[END_REF] allow to identify some pixels in an image in a CV problem, but also to highlight the terms most participating in a prediction in a NLP (Natural Language Processing) model. In the same idea, while using different methods, we can also cite SHAP (SHapely Additive exPlanation) [START_REF] Lundberg | A unified approach to interpreting model predictions[END_REF], or What-If [START_REF] Martens | Explaining data-driven document classifications[END_REF].

All these techniques and tools have already proved to be really useful for explaining AI models. However, as it was underlined by [START_REF] Losch | Interpretability beyond classification output: Semantic bottleneck networks[END_REF], and as we will show in part 3.2, these approaches do not guarantee that the provided explanations are in fact understandable by the users.

Explainablity, Semantics and Ontologies

As recalled by [START_REF] Bahadori | Debiasing concept bottleneck models with a causal analysis technique[END_REF]: "Concept-based explanation approach is a popular model interpertability tool because it expresses the reasons for a model's predictions in terms of concepts that are meaningful for the domain experts". The benefits from ontologies for providing explanations have already been proven. For many authors, it is obvious that ontologies can help in providing adequate explanations about the decision process of DL models [START_REF] Confalonieri | Trepan reloaded: A knowledge-driven approach to explaining black-box models[END_REF].

Following this idea, the concept of semantic bottleneck has recently been formalized in [START_REF] Losch | Interpretability beyond classification output: Semantic bottleneck networks[END_REF] and further developed in [START_REF] Marcos | Semantically interpretable activation maps: whatwhere-how explanations within cnns[END_REF]: a classifier is built while integrating semantic layers in its very conception in order to extract semantic features. These latter are then used to compute the final classification. The pondered contribution of each semantic feature helps in providing explanations regarding a prediction, and in understanding misclassification errors. However, it should be noted that even if these interesting works speak about semantics, none of them use an ontological approach.

Research works like [START_REF] Conigliaro | Integrating computer vision algorithms and ontologies for spectator crowd behavior analysis[END_REF] are dedicated to image interpretations while using ontologies. A DL process (e.g. object detection) is used to extract features corresponding to ontological concepts. These features are then used to infer predictions at a higher abstraction level. Such approach implies reasoning while using description logic for enabling complex classification tasks. Even if they do not explicitly focus on the explainability issue, such reasoning is intrinsically explainable, and these solutions should indeed be able to provide explanations at the users' ontological abstraction level.

Positioning

As in Grad-CAM or LIME, our goal is to provide explanations while highlighting in the raw data the features that leaded to a classification. However, our approach is not agnostic: the explanations we want to provide are intimately bound to the targeted domain, and the features we want to highlight need to be at the user's abstraction level, i.e., from our viewpoint, ontological features.

Our approach is neither post-hoc because we need the ontology to be directly involved in the very process of the classifier creation. We follow a semantic bottleneck approach, with the difference that the semantics is here provided by an ontology which moreover is itself directly used to compute the predictions.

From this viewpoint, we are inspired by the research works implying ontologies for high abstraction level image interpretation. Our approach is however somehow different while definitely focusing on the explainability issue, and by advocating for explainable classifiers that involve ontologies in classification tasks that would a priori not need it.

Ontological Explainability Approach

Illustration Domain: Pizzas

To illustrate our approach, we choose to reuse the Pizzas ontology (Manchester University). The reasons are multiple, but the main one is the fact that this ontology is accessible and really famous, and thus already known by many researchers.

The Pizzas ontology defines a set of pizzas classes (e.g. Napoletana), that are subclasses of the NamedPizza class (being itself a subclass of Pizza). The pizzas definitions mainly involve the hasTopping object property whose domain is the Pizza class, and whose range is the PizzaTopping class which is the superclass of diverse toppings concepts like anchovies (AnchoviesTopping), etc. We will then for example find the Napoletana pizza defined by: Napoletana ≡ Pizza (∃ hasTopping . AnchoviesTopping) (∃ hasTopping . OliveTopping) (∀ hasTopping . (AnchoviesTopping OliveTopping)) As our aim is to link the results of an image classifier with the ontological definitions, we built a dataset in which the samples are labeled with the subclasses of NamedPizza. Other searchers have already created some pizzas images datasets [START_REF] Papadopoulos | How to make a pizza: Learning a compositional layer-based gan model[END_REF]: to our knowledge, none of them corresponds to the definitions of the Pizzas ontology. Moreover, our goal in this experiment is not to enhance the classification performance (in terms of accuracy, etc.), but rather to study the benefits and the feasibility of an approach that implies an ontology for enhancing a classifier's explainability. Inspired by [START_REF] Papadopoulos | How to make a pizza: Learning a compositional layer-based gan model[END_REF] in which the authors generate synthetic pizzas images to constitute a controlled dataset, we generated synthetic images of ontological pizzas by combining toppings cliparts (cf. Figure 1).

The Pizza ontology defines 22 subclasses of NamedPizza while using 36 subclasses of PizzaTopping. To simplify the construction of our dataset, we decided to focus on 14 subclasses of NamedPizza involving 16 subclasses of PizzaTopping, thus keeping diversity while removing the pizzas made of toppings like TobascoPepperSauce that are hard do illustrate with cliparts, and that are not essential to our demonstration.

The generated images voluntary use the same "pizza base" : only the toppings distribution is varying in number, position and orientation, in order to force any (non-ontological) classifier to focus on the toppings for classifying the pizzas. The classification task for these synthetic pizza images being relatively simple, we only generated a "small" and totally balanced dataset containing 200 pizzas per each of the 14 NamedPizza subclasses.

Problems of a non-ontological approach

To illustrate our thoughts about the problems of post-hoc tools for explainability, we built and trained a "classical" image classifier based on a VGG19 [START_REF] Simonyan | Very deep convolutional networks for large-scale image recognition[END_REF] CNN architecture, we used transfer learning by reusing the weights of VGG19 pretrained on Imagenet, and complemented it by a Dense (256) and a SoftMax (14 pizzas classes) layers. The images data being simple, we were able to train this classifier while achieving 100% accuracy on a test set constituted by 20% of our samples.

We then used tools implementing the LIME [START_REF] Ribeiro | Explaining the predictions of any classifier[END_REF] and Grad-CAM [START_REF] Selvaraju | Gradcam: Visual explanations from deep networks via gradient-based localization[END_REF] methods which both explain a specific prediction by generating a heatmap highlighting the image's pixels that most participated to the classification. As our images were generated in a way to let the toppings being the sole elements that can help in differentiating the pizzas classes, we can expect the heatmaps to focus on the toppings' corresponding pixels. The Figure 2 shows the explanations provided by Grad-CAM for a pizza predicted as Napoletana, i.e. a pizza only containing olive and anchovies toppings (cf. definition in part 3.1). We only show Grad-CAM's results here, but the explanations provided by LIME and Grad-CAM are similar. We can notice that the CNN focuses well on the anchovies. However, it ignores the olives while also focusing on a part of the pizza base (empty of toppings). We can thus consider that for this DL model, this pizza is a Napoletana because it has some anchovies and some void: this of course does not correspond to the definition we expected.

Nevertheless, the Pizzas ontology can help in explaining this phenomenon if it is used to generate an ontological correlation matrix regarding the toppings. This matrix reveals to what extent the toppings are correlated in the pizzas definitions: we can notice that the anchovies (AnchoviesTopping) always appear with olives (OliveTopping). On the other hand, the olives frequently appear with other toppings. As a result, for the CNN, on a Napolitana only made of anchovies and olives, the discriminant is the presence of anchovies.

The purpose of these remarks is not to discredit tools like Grad-CAM and LIME at all. As we just showed it, they are truly useful for explaining a classifier. However, these explanations can generally only be interpreted by an AI specialist and, as in works trying to associate some semantics to CNN filters [START_REF] Gonzalez-Garcia | Do semantic parts emerge in convolutional neural networks?[END_REF], this example demonstrates that the abstraction level of the discriminants emerging from the training of a CNN does not coincide with the abstraction level of a pizza specialist. As a result, these tools do not seem to be the most adequate for providing explanations that are easily understandable by domain experts.

Proposed Approach

Our proposition aims at creating classifiers that are able to provide explanations at the domain experts' abstraction level, i.e. using the terms of their ontology. The steps for this realization are: One can note that the (b) and (c) steps are tightly linked because it would be useless to build F with ontological features that cannot be extracted from the data. In our example, we focus on the hasTopping object property because it defines the pizzas, but also because the presence of toppings (elements of R) can be deduced from the image.

We also want to underline that the abstraction level of the explanations is intrinsically linked to the abstraction level of the ontological features. Indeed, if in our example it will be possible to explain that an image represents a Napoletana because it contains anchovies and olives, the classifier will not be able to explain how it decided that an image region corresponds to a specific topping. We need to recall that any approach for explainability is facing the fact that, at some abstraction level, one considers not having to provide deeper explanations. We for example can cite [START_REF] Hendricks | Generating visual explanations[END_REF] that proposes a birds species classifier while marrying a CNN and NLP for providing explanations: the system can explain that an image represents an Albatross because it contains a yellow beak, etc., but it does not try to demonstrate what is a yellow beak.

Ontological Classifier

This section presents the implementation of our approach with the pizzas example. This implementation is mainly constituted by 2 modules (Figure 3): a semantic segmentation (DL) module designed to extract the ontological features from an image, and an ontological reasoning module called OntoClassifier designed to compute the CI classes that can be deduced from FI, while being able to provide explanations. These 2 modules are implemented in Tensorflow 2.

DL Module: Semantic Segmentation

The first part of our classification pipeline aims at extracting the ontological features from an image, i.e. the satisfiability of the assertions corresponding to the triplets of F, considering that here: F = {(c Pizza, hasTopping, r PizzaTopping)} We choose to use a semantic segmentation technique whose purpose is to label each pixel of an image with the classes from R = {r PizzaTopping}. We use a model architecture based on U-Net [START_REF] Ronneberger | U-net: Convolutional networks for biomedical image segmentation[END_REF] and, as our dataset is fully controlled, we generate the segmentation masks (that are necessary to train the model) during the image generation process.

This U-Net implementation (based on MobileNetV2 [START_REF] Sandler | Mobilenetv2: Inverted residuals and linear bottlenecks[END_REF] with the Imagenet weights) has for input 3 channels (RGB) pizzas images (224x224x3), and for output an image segmentation with 17 channels (224x224x17): each channel corresponds to one of the 16 PizzaTopping subclasses, excepted for 1 channel that is intended to receive the pixels not corresponding to any topping.

The central part of Figure 3 shows how an image sent to the DL module is segmented: to represent this segmentation here, we have overlaid the different channels while associating each of them with a different color.

Ontological Module: OntoClassifier

The presence of pixels in a segmentation layer can be interpreted as the presence of an ontological feature (∃ hasTopping . topping), topping ∈ R, thus letting to deduce the set FI of the satisfied assertions for each image treated by this model. It then remains to reason from FI while using the set of definitions D to deduce the set of classes CI that can label the image.

This reasoning process using properties extracted from an image is similar to those that can be found in diverse works merging DL and ontologies to propose interpretations at high abstraction level. A classical approach would be to populate the ontology with instances representing the samples to be classified (using their identified ontological features), and then to start an ontological reasoner like Jena, Hermit or Pellet to obtain a classification. However, as it was underlined in [START_REF] Ding | Review of the application of ontology in the field of image object recognition[END_REF], this process is costly because it needs to complement the DL model with external tools, and these tools that are designed to reason in globality about an ontology are much slower that the DL pipelines nowadays used to create classifiers. In our proposed approach, we do not need the full power of a classic ontological reasoner to deduce CI from FI and D. We thus created the OntoClassifier module whose constructor generates a set of tensors directly from the ontology, and in particular from C, D and F. This process is illustrated in Figure 4: after the selection of the targeted classes and definitions constituting C and D (1), and of the ontological features constituting F (2), a graph of tensors is automatically generated (3): these tensors are typed and interconnected thanks to the decomposition of the OWL (Web Ontology Language) definitions found in D. The resulting OntoClassifier is then ready to complement the classification pipeline directly after the output of the DL module (right part of Figure 3). This assemblage is able to compute the satisfiability of ontological assertions like the definition of a Napoletana (cf. 3.1), or more complex assertions for example implying toppings' superclasses (using inheritance) like in:

CheesyPizza ≡ ∃ hasTopping . CheeseTopping VegetarianPizza ≡ ¬ (∃ hasTopping . FishTopping) ¬ (∃ hasTopping . MeatTopping)

Moreover, the OntoClassifier being implemented as a graph of tensors that represents the decomposition of the elements of D, this module allows to trace back the graph to identify the elements of FI that satisfied each assertion for a given data.

Results

Generating the OntoClassifier under the form of tensors allows the integration of the ontological dimension directly inside the classification pipeline. The resulting global model is then truly faster than in the case where the ontological reasoning is delegated to an external "classic" inference engine. For instance, using our semantic segmentation (DL) module combined with the Hermit reasoner on our computers (I9-10850K 3.6 GHz, 32 Go DDR4 3200MHz, GPU RTX 3080), the classification of 100 pizzas images takes on average 130s. With the OntoClassifier, on the same computers, this classification only takes on average 1,6s. As in 3.2, we were able to train this pipeline to achieve 100% accuracy on the test set. The Figure 5 shows the example of an image of Fiorentina. The classifier predicts the set of classes that can label this image (Fiorentina, Vegetarian, Cheesy). The segmentation mask highlights the set of identified toppings. One can notice that in contrast to the example presented in 3.2, the abstraction level of this heatmap is in line with the ontology: no topping is ignored by the classifier, the highlighted entities correspond to the class definitions, and each topping is differentiated and identifiable thanks to a color code. The Figure 6 illustrates the fact that this system also allows to focus on a specific identified class (here focusing on the Cheesy class identified for the image classified in Figure 5), and to use the OntoClassifier's introspection mechanism to explain this classification. This focus reuses the ontological segmentation mask, and adds (in the right part), an explanation that binds the OWL definition of the targeted class with the parts of the image that satisfied the (sub-)assertions.

Here, the binding is represented using a heatmap color code, but we can imagine more interactive means like dynamically highlighting the original image while moving the cursor over parts of the definition. The Figure 7 shows that the OntoClassifier can focus on an identified class and also explain a classification due to the absence of elements.

Conclusion

Accounting the need for explainable AI, we explored the benefits and the feasibility of a process for creating classifiers that are ontologically explainable, i.e. providing explanations at the abstraction level for their domain users. We proposed a generic approach that results in an architecture mainly constituted by 2 modules: a DL module dedicated to the ontological features extraction, and another module named OntoClassifier and dedicated to ontological reasoning. In order to integrate the ontological dimension in the very heart of the classifier without burdening the resulting classification pipeline, we have introduced a tool for automatically generating the OntoClassifier as a graph of tensors directly built from the class definitions provided in the ontology. We have exemplified our approach by creating an image classifier and have illustrated the possibilities for ontological classification, as well as for visual explanation.

It is true that this approach involves additional work around the creation of an ontology that reifies the users' abstraction level, the construction of the sets C, D, and F, and also the use of a DL technique that is more complex than for a "simple" classification. One can however also notice that this approach not only results in an ontologically explainable classifier, but also presents other benefits. As long as the set of ontological features (F ) does not change, it is easily possible to evolve the classifier, for example by adding new classes/definitions, and to integrate this evolution into the pipeline without having to retrain the DL model. The sole thing to do is to automatically re-generate the OntoClassifier. As underlined in [START_REF] Zhitomirsky-Geffet | Toward multiviewpoint ontology construction by collaboration of non-experts and crowdsourcing: The case of the effect of diet on health[END_REF], the notion of viewpoint is important too, even while considering ontologies. Our proposed approach and tools can offer a solution to the need for multi-viewpoints because it is easily possible to generate different OntoClassifier modules, each one dedicated to a specific viewpoint on the same domain. Our approach also allows to introduce the notion of viewpoints in the explanations themselves. Indeed, for the same C set, it is possible to build different D sets, and then to generate different explainable classifiers focusing on different ontological definitions for the same classes. For example, in the Pizza ontology, a Vegetarian pizza can be defined as:

(1) VegetarianPizza ≡ ¬ (∃ hasTopping . FishTopping) ¬ (∃ hasTopping . MeatTopping) (2) VegetarianPizza ≡ ∀ hasTopping . VegetarianTopping If these 2 definitions lead to the same classification, the associated visual explanations correspond to different viewpoints focusing on (or highlighting) (1) the fish or meat toppings (cf. Figure 7), or (2) the vegetarian toppings.

These approach and tools are still in development. In this paper, the visual explanations directly use the OWL expressions: this representation needs to be improved, and then evaluated through experiments while involving end-users. We also are working on the human-machine interfaces that will allow end-users to manipulate and explore the provided explanations. The presented elements however already let imagine functionalities that are promising, and even necessary in the frame of projects involving actors with different cultures and viewpoints.

Fig. 1 .

 1 Fig. 1. Generating synthetic images of ontological pizzas.

Fig. 2 .

 2 Fig. 2. Grad-CAM explanations for a specific pizza classification.

  (a) Build a set C of the classes from the ontology that will be predicted as output of the classifier. (b) Consider D: the set of definitions in the ontology such as D = {d | ∃ c ∈ C, d ≡ c is an axiom of the ontology}. Consider P : the set of properties in the ontology involved in D. Consider R: the set of ranges such as R = {r | r =range(p), p ∈ P } Build the set F of the ontological features f ∈ F, i.e. the triplets (c, p, r ) involved in D and that will be used while explaining the predictions. (c) Implement a DL technique to build the set FI ⊆ F of the identified ontological features (satisfied assertions) in a data sent to the classifier such as FI = {fi ∈ F | fi ≡ ∃ p.r } (d) Implement an ontological reasoning using D and FI for calculating CI ⊆ C, the set of the ci classes predicted for a data. (e) Use the set DI ⊆ D such as DI = {di ≡ ci } and the set FI for explaining the CI classification.

Fig. 3 .

 3 Fig. 3. Architecture of the ontologically explainable classifier.

Fig. 4 .

 4 Fig. 4. Generating an OntoClassifier.

Fig. 5 .

 5 Fig. 5. Classification and ontological segmentation.

Fig. 6 .

 6 Fig. 6. Classification and visual ontological explanations.

Fig. 7 .

 7 Fig. 7. Explanations for classification due to missing features.