**Application of Artificial Neural Networks for the Monitoring of Episodes of High Toxicity by DSP in Mussel Production Areas in Galicia †**

#### **Andrés Molares \*, Enrique Fernandez-Blanco and Daniel Rivero**

CITIC, Faculty of Computer Science, Campus de Elviña, University of A Coruña, 15006 A Coruña, Spain; enrique.fernandez@udc.es (E.F.-B.); daniel.rivero@udc.es (D.R.)

**\*** Correspondence: andres.molares@udc.es

† Presented at the 3rd XoveTIC Conference, A Coruña, Spain, 8–9 October 2020.

Published: 19 August 2020

**Abstract:** This study seeks to support, through the use of Artificial Neural Networks (ANN), the decision to perform closings after days without sampling in the Vigo estuary. The opening and closing of the mussel production areas are based on the toxicity analysis of this bivalve's meat. Sometimes it is not possible to obtain the necessary data for effective closing. If there is evidence of an increase in toxicity levels, "Precautionary Closings" on mussel extraction is done. A small error in the forecast of the state of the areas could mean serious losses for the mussel industry and a huge risk for public health. Unlike in previous studies, this study aims to manage the state of the mussel production areas, whilst the others focused on predicting the harmful algae blooms. Having achieved test sensitivity values of 67.40% and test accuracy of 83.00%, these results may lead to new research that involves obtaining more accurate models that can be integrated into a support system.

**Keywords:** machine learning; harmful algae blooms; artificial neural networks

#### **1. Introduction**

Since 1995, a governmental monitoring program has managed the mussel production areas in Galicia. The creation of this program was necessary because of the high frequency of a phenomenon called Harmful Algal Blooms (HAB), which implies a temporary cessation in the extraction and commercialization of the mussels. The HAB are episodes of a high concentration of algae potentially toxic to humans through mussel consumption. In the Vigo estuary, the most common toxin-producing species are the DSP type, such as the *Dinophysis acuminata* dinoflagellate [1].

A weak point of this process is the absence of sampling during weekends or inclement weather, which sometimes makes it impossible to collect the data to support an effective closing. If there is an indication of an increase in levels of toxicity, the competent authority is legally empowered to proceed to the "Precautionary Closings" on the extraction of bivalve molluscs. Nowadays, the performance of this kind of closing is based on the expertise of government agents. A mathematical model to support the making of these decisions could help experts in complex situations that may cause errors in the decisions made.

Although the previously described situation is focused on the Galician Coast, this scenario is replicated in other major producers around the globe. That is why other works have tried to monitor the HAB episodes using different techniques. To date, those previous works have focused their efforts on predicting biomarkers, such as the concentration of toxic phytoplankton or chlorophyll "a". These studies, although of high scientific interest, do not give concrete support when it comes to monitoring the state of the production areas. The toxicity levels present in mussel meat depend on additional factors, such as retention of toxicity or the relationship between toxic versus non-toxic phytoplankton present in the medium. These factors, and some others, will be considered in conducting this study to achieve a more practical approach. To do that, a classifier based on Artificial Neural Networks (ANN) [2] is going to be defined to assess the state of the production areas affected by DSP-type toxins, on days with the absence of previous samplings.

#### **2. Results**

A summary of the obtained results can be seen in Figure 1. Each row of this table represents a tested model, where the first and second columns define the filters of characteristics used. These filters are represented with the value of the quartile selected for training. The third column shows the architecture of the networks by showing the number of hidden neurons per layer. The fourth column contains the p-value obtained from a Tukey–Kramer paired analysis, after previously performing a ANOVA analysis. Additionally, the remaining columns show the performance measures obtained in the test, that is, the average accuracy, average sensitivity, average kappa coefficient, minimum accuracy, minimum sensitivity, and minimum kappa coefficient.


**Figure 1.** Statistics of the best models applied in the Vigo. A production area, ordered by descending sensibility. Access to the full table can be obtained here: https://github.com/AndresMolares/ XoveTIC2020.git.

#### **3. Discussion**

After carrying out the study, it can be seen how ANN works better with a large number of characteristics to solve this problem. Although the works carried out to date obtain good results when making HAB predictions on the Galician coast (an overall accuracy between 78.53–82.18% using vector support machines to predict HAB of *Pseudo-nitzschia spp.* [3]), the control of the state of the production areas is conditioned by other external factors, so the definition of the problem changes. As this is the first study that seeks to provide support when estimating the state of the mussel production areas affected by DSP-type toxins, the results are promising (accuracy of 83%). However, to develop models that are precise enough to be integrated into support tools, it would be necessary to develop models with better sensitivity and accuracy values. For this, new machine learning algorithms could be studied, as well as a more exhaustive exploration of the hyperparameter space of the ANN.

#### **4. Materials and Methods**

Data from different sources were combined to create the dataset used in this experiment. Those sources contained different values sampled weekly between 2004 and 2018. The result is a dataset with the following variables: seasonality, concentration of chlorophyll "a", *Dinophysis acuminata*, ammonium, phosphate, nitrite, nitrate, water temperature, oxygen in water, salinity, solar irradiation, upwelling index, and the previous state of the production area. These data have been provided by the INTECMAR [4], METEOGALICIA [5], and IEO [6].

From raw data, two types of filtering were applied to choose the most significant features: (a) Applying a correlation matrix of the input variables with the state of the zone (variable objective); and (b) using a Random Forest algorithm as a discriminator. The Random Forest algorithm calculates the importance of a variable, taking into account how much the prediction error increases when the data for that variable is permuted, while all others remain unchanged.

With these methods, blocks of characteristics of quartiles 25, 50, and 75 were obtained. Different experiments have been defined based on the application of each one, another, both, or none of the previously mentioned filtering methods and the architecture of the ANN model. To ensure reliable results, the tests were performed with a 10-fold cross-validation strategy, which was repeated 50 times for each combination of filter methods and classification techniques. The reason for repeating this process is due to the non-deterministic nature of the backpropagation [7] used to train the ANN of each fold. To perform the training, each ANN model was set to use Dense Hidden layers, with the ADAM algorithm as an optimizer and binary cross-entropy as the loss function. Finally, the transfer function of the output layer is a sigmoid function in all cases exposed, while on the contrary, the activation function of the hidden layers is a Relu function.

With that configuration and data in common and having the same input and desired output, five models were tested by changing the number of hidden layers and the number of elements in these. More specifically, the trained and tested models were: One hidden layer with 2, 8, or 14 neurons; and two hidden layers with 10 neurons each and 10 and 20 neurons, respectively.

**Author Contributions:** Conceptualization, A.M.; methodology, E.F.-B.; software, A.M.; validation, A.M., E.F.-B. and D.R.; formal analysis, A.M. and D.R.; investigation, A.M.; resources, A.M.; data curation, A.M.; writing–original draft preparation, A.M.; writing–review and editing, E.F.-B.; visualization, A.M.; supervision, D.R.; project administration, D.R.; funding acquisition, A.M., E.F.-B. and D.R. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work has been partially supported by different grants and projects from the Xunta de Galicia [ED431D 2017/23; ED431D 2017/16; ED431G/01; ED431C 2018/49].

**Acknowledgments:** The authors want to acknowledge the support from INTECMAR [4], who have provide the data for this work and CESGA [8], who allows to conduct the tests on their installations.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

#### **Abbreviations**

The following abbreviations are used in this manuscript:

ANN Artificial Neural Network

DSP Diarrheal Shellfish Poisoning

#### **References**


c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).


### *Proceedings* **Numerical Simulation of a Nonlinear Problem Arising in Heat Transfer and Magnetostatics †**

#### **María González \* and Hiram Varela**

M2NICA Research Group, CITIC, Universidade da Coruña, 15071 A Coruña, Spain; hiram.varela@udc.es **\*** Correspondence: maria.gonzalez.taboada@udc.es

† Presented at the 3rd XoveTIC Conference, A Coruña, Spain, 8–9 October 2020.

Published: 19 August 2020

**Abstract:** We present a numerical model that comprises a nonlinear partial differential equation. We apply an adaptive stabilised mixed finite element method based on an a posteriori error indicator derived for this particular problem. We describe the numerical algorithm and some numerical results.

**Keywords:** nonlinear boundary value problem; finite element analysis; adaptivity

#### **1. Introduction**

We consider the mathematical model from [1]. The model comprises a second order nonlinear elliptic partial differential equation over a bounded domain Ω in R2, provided with Dirichlet boundary conditions over the contour Γ:

$$\begin{cases} \begin{array}{rcl} -\nabla \cdot (k(\cdot, |\nabla u|) \nabla u) &=& f \quad \text{in } \Omega, \\\\ u &=& g \quad \text{on } \Gamma. \end{array} \end{cases} \tag{1}$$

The unknown *u* can be temperature, magnetic potential, etc., |·| denotes the Euclidean norm and ∇ and ∇· denote, respectively, the usual gradient and divergence operators. The functions *k*, *f* and *<sup>g</sup>* are data, and we assume that *<sup>k</sup>* : <sup>Ω</sup> <sup>×</sup> [0, <sup>+</sup>∞) <sup>→</sup> <sup>R</sup> satisfies the following bound, for two positive constants *<sup>k</sup>*<sup>1</sup> and *<sup>k</sup>*2: *<sup>k</sup>*<sup>1</sup> <sup>≤</sup> *<sup>k</sup>*(**x**,*s*) + *<sup>s</sup> <sup>∂</sup> <sup>∂</sup><sup>s</sup> k*(**x**,*s*) ≤ *k*2, ∀(**x**,*s*) ∈ Ω × [0, +∞).

Problem (1) allows to predict a wide range of physical phenomena, such as magnetostatics and heat transfer. Due to the nonlinearity, we need to resort to numerical methods. We apply an adaptive stabilized mixed finite element method and present some results from our numerical experiments.

#### **2. Adaptive Augmented Mixed Finite Element Method**

We introduce two additional unknowns, **t** = ∇*u* and *σ* = *k*(·, |**t**|)**t**, and define the function space *<sup>X</sup>* := [*L*2(Ω)]<sup>2</sup> <sup>×</sup> *<sup>H</sup>*(∇·, <sup>Ω</sup>) <sup>×</sup> *<sup>L</sup>*2(Ω), where *<sup>L</sup>*2(Ω) is the space of square integrable functions and *<sup>H</sup>*(∇·, <sup>Ω</sup>) :<sup>=</sup> {**<sup>v</sup>** <sup>∈</sup> [*L*2(Ω)]2; ∇ · **<sup>v</sup>** <sup>∈</sup> *<sup>L</sup>*2(Ω)}. In order to approximate the triplet (**t**, *<sup>σ</sup>*, *<sup>u</sup>*), the domain is divided into triangular cells that conform a mesh (see Figure 1a). In each of those cells an approximation of the unknowns is calculated. The corresponding function space is *Xh* := P<sup>0</sup> × RT <sup>0</sup> × P1, with P*<sup>k</sup>* being the space of polynomials of degree ≤ *k* and RT <sup>0</sup> is the lowest order Raviart Thomas space. We consider the following discrete problem: find (**t***h*, *σh*, *uh*) ∈ *Xh* such that

$$A\left(\left(\mathbf{t}\_{\hbar\prime}\sigma\_{\hbar\prime}\boldsymbol{u}\_{\hbar\prime}\right), \left(\mathbf{s}\_{\hbar\prime}\boldsymbol{\tau}\_{\hbar\prime}\boldsymbol{v}\_{\hbar}\right)\right) = F(\mathbf{s}\_{\hbar\prime}\boldsymbol{\tau}\_{\hbar\prime}\boldsymbol{v}\_{\hbar}), \quad \forall \left(\mathbf{s}\_{\hbar\prime}\boldsymbol{\tau}\_{\hbar\prime}\boldsymbol{v}\_{\hbar}\right) \in X\_{\hbar} \tag{2}$$

where

*A*((**t**, *σ*, *u*),(**s**, *τ*, *v*)) := Ω *k*(·, |**t**|)**t** · **s** − Ω *σ* · **s** + Ω *τ* · **t** + Ω *u* ∇ · *τ* − Ω *v* ∇ · *σ* + *κ*1 Ω (*σ* − *k*(·, |**t**|)**t**) · *τ* + *κ*<sup>2</sup> Ω ∇ · *σ* ∇ · *τ* + *κ*<sup>3</sup> Ω (∇*u* − **t**) · (∇*v* + **s**) + *κ*<sup>4</sup> Γ *u v* (3) *F*(**s**, *τ*, *v*) := *τ* · **n** *g* + *f v* − *κ*<sup>2</sup> *f* ∇ · *τ* + *κ*<sup>4</sup> *g v* (4)

Γ Ω Ω Γ with *κ<sup>i</sup>* being positive constants. The nonlinear form *A*(·, ·) is strongly monotone, Lipschitz-continuous and bounded for appropriate values of the parameters *κ<sup>i</sup>* so that problem (2) has a unique solution.

**Figure 1.** Some meshes, and error and indicator for the uniform and adaptive refinements vs. dof.

We consider an adaptive algorithm, which estimates the local error in each cell, and refines the mesh over those regions with the highest error. On each triangle, we introduce the following novel error indicator, which is reliable and locally efficient [2]:

$$\begin{split} \theta\_T^2 &:= \quad \|\nabla \boldsymbol{\mu}\_h - \mathbf{t}\_h\|\_{[L^2(T)]^2}^2 + \|\boldsymbol{f} + \nabla \cdot \boldsymbol{\sigma}\_h\|\_{L^2(T)}^2 + \|\boldsymbol{\sigma}\_h - k(\cdot, |\mathbf{t}\_h|) \mathbf{t}\_h\|\_{[L^2(T)]^2}^2 \\ &+ \sum\_{\boldsymbol{\varepsilon} \in \mathcal{E}(T) \cap \mathcal{E}(\Gamma)} h\_\boldsymbol{\varepsilon} (\|\boldsymbol{g} - \boldsymbol{\mu}\_h\|\_{L^2(\boldsymbol{\varepsilon})}^2 + \|\frac{d}{ds} (\boldsymbol{g} - \boldsymbol{\mu}\_h)\|\_{L^2(\boldsymbol{\varepsilon})}^2) \end{split} \tag{5}$$

where *E*(*T*) denotes the set of edges of *T* and *E*(Γ) the set of edges in the boundary.

#### **3. Results and Discussion**

The adaptive algorithm was tested on a singular example over the unit square with a singularity in its upper right corner. The exact solution is *<sup>u</sup>*(*x*, *<sup>y</sup>*)=(2.1 <sup>−</sup> *<sup>x</sup>* <sup>−</sup> *<sup>y</sup>*)−1/3. In Figure 1b, we can see that the algorithm refines the mesh near the singularity. Figure 1c shows a graph that compares, for both uniform and adaptive refinements, the exact error and the defined indicator vs. degrees of freedom (dof). With the adaptive algorithm the total error is lower, and a good agreement between error and indicator is seen. In fact, the efficiency index, which is the quotient between indicator and total error, tends to one as the mesh size decreases.

These simulations were carried out in FreeFEM++, following the mesh refinement algorithm proposed in [3], and the nonlinear system was solved with Newton's method with a tolerance of 10−9, needing four iterations.

**Author Contributions:** Theoretical analysis, M.G.; numerical experiments, H.V. All authors have read and agreed to the published version of the manuscript.

**Funding:** The authors acknowledge the support of CITIC (FEDER Program and grant ED431G 2019/01). The research of M.G. is partially supported by the Spanish Ministerio de Economía y Competitividad Grant MTM2016-76497-R, and by Xunta de Galicia Grant GRC ED431C 2018-033. The research of H.V. is partially supported by Xunta de Galicia grant ED481A-2019/413170 and Ministerio de Educación grant FPU18/06125.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
