Sylvain Chabanet
email: sylvain.chabanet@univ-lorraine.fr

Bril Hind

El-Haouzi
email: hind.el-haouzi@univ-lorraine.fr

Philippe Thomas
email: philippe.thomas@univ-lorraine.fr

Coupling digital simulation and Machine Learning metamodel through an Active Learning approach in Industry4.0 context

Keywords: Stream based Active Learning, K-Nearest Neighbors, simulation metamodel, Sawmill, Smart Data, Artificial Intelligence

Although digital simulations are becoming increasingly important in the industrial world owing to the transition toward Industry 4.0, as well as the development of digital twin technologies, they have become increasingly computationally intensive. Many authors have proposed the use of Machine Learning (ML) metamodels to alleviate this cost and take advantage of the enormous amount of data that are currently available in industry. In an industrial context, it is necessary to continuously train predictive models integrated into decision support systems to ensure the consistency of their prediction quality over time. This led the authors to investigate Active Learning (AL) concepts in the particular context of the sawmilling industry. In this paper, a method based on AL is proposed to combine simulation and an ML metamodel that is trained incrementally using only selected data (smart data). A case study based on the sawmilling industry and experiments are shown, the results of which prove the possible advantages of this approach.

Introduction

The use of simulation and digital prediction tools to sustain both the integrated design of production systems and factory management is of crucial importance when planning to transition toward an industry of the future framework (European Factories of the Future Research Association and others (2012)). On the one hand, market constraints and a highly competitive commercial environment increase the need for such tools, whereas on the other hand, the increased complexity of the production system induced by the development of Industry 4.0 makes it necessary for the production facility to stay predictable, analyzable, able to be simulated at all times, flexible and adaptable (figure 1). This should [START_REF] Monostori | Cyber-physical production systems: Roots, expectations and r&d challenges[END_REF]) and more generally by modular manufacturing systems [START_REF] Rossgoderer | Industrie 4.0-digitalization strategy[END_REF]). In addition to modularity, these systems introduce notions of connectivity, autonomy, and a dual view (physical and virtual).

Owing to these properties, as well as to the variety of virtual representations used in the life cycle of both products and processes, the co-simulation of smart factories has become increasingly credible. Authors such as [START_REF] Wu | Cloud-based design and manufacturing: A new paradigm in digital manufacturing and design innovation[END_REF] demonstrate that this virtualization and IoT technologies will facilitate information sharing through a virtualization of a closed loop centered around the concept of digital twins [START_REF] El Haouzi | Contribution à la conception et à l'évaluation des architectures de pilotage des systèmes de production adaptables : vers une approche anthropocentrée pour la simulation et le pilotage[END_REF]).

Simulations are currently a widely accepted tool in the industrial world, and in particular, [START_REF] Masood | Industry 4.0: Adoption challenges and benefits for smes[END_REF] identify it as a key Industry 4.0 technology with low complexity and high benefit for SMEs. Authors such as [START_REF] Salama | A decision support system architecture based on simulation optimization for cyber-physical systems[END_REF], however, have noted their ever-increasing computational costs and have thus proposed a coupling with predictive artificial intelligence metamodels, which can benefit from historical data and advances in Machine Learning (ML) technologies. Similarly, [START_REF] Thomas | Multilayer perceptron for simulation models reduction: Application to a sawmill workshop[END_REF] proposed the use of a multilayer perceptron to reduce the simulation model of a sawmill workshop. In addition, [START_REF] Nesrine | Adaptive smart card-based pull control systems in contextaware manufacturing systems: Training a neural network through multi-objective simulation optimization[END_REF] used a simulation to completely generate a dataset and train a neural network to drive decision making in the card based control system of a manufacturing installation. All of these studies demonstrate in different ways the interest of coupling simulations and ML models in an industrial context.

However, if unlabeled data are increasingly easy to gather, the labeled data necessary to train ML metamodels can still be a limiting factor because their production often implies the intervention of an expert team or the use of a computationally intensive, gold standard simulation. This is even more problematic when multiple classifiers must be trained to correspond to multiple settings of the simulation or of the environment. A linked example, albeit not in a simulation context, was presented by [START_REF] Htike | Adapting pedestrian detectors to new domains: a comprehensive review[END_REF], who considered the problem of training multiple, context-dependent, pedestrian detectors needed for autonomous cars. Among other solutions, they pointed toward Active Learning (AL) as a promising research direction. This goal of efficiently using the data to train ML models is also linked with the transition of a paradigm from big data to smart data, which aims to leverage only useful data among the mass gathered by big data technologies [START_REF] Iafrate | A journey from big data to smart data[END_REF]).

Active Learning is a field of Machine Learning, and deals with the selection of a small subset of to-be-labeled individuals in an unlabeled database when the cost of labeling the entire base is intractable. However, despite showing excellent results on multiple benchmark datasets, [START_REF] Settles | From theories to queries: Active learning in practice, in: Active Learning and Experimental Design workshop In conjunction with AISTATS 2010[END_REF] noted that Active Learning strategies had rarely been used in the industrial world. They, additionally, noticed that empirical studies with real annotators had mixed or negative results. They attribute this dichotomy to open challenges that were rarely studied by the literature. An example of such problem is to consider settings where the different classes in the classification problem are unknown. Recently, [START_REF] Abraham | Rebuilding trust in active learning with actionable metrics[END_REF] have interpreted the mistrust of the industry toward AL application as being partially caused by the literature striving for ever increasing prediction scores, while the industry has a higher interest in robust methodologies, performing at least better than random strategies.

This paper explores a method, based on Active Learning concepts, to combine two main technologies associated to industry 4.0: a simulator, considered as exact in this study but computationally costly, and an ML classifier, less costly to use online but whose predictions are only approximations of the simulator. More precisely, this study considers a case inspired from the sawmill industry where sawing simulators are used to simulate the sawing of logs using their 3D scans, that is, point clouds sampled from the log surface, and an ML classifier that directly uses those scans to predict the results of the simulator. This method is tested on a dataset provided by the Canadian forest wood industry, which contains a particularly large number of labels with respect to the number of instances. Three elements stemming from an industrial setup are important to consider when designing an Active Learning strategy (figure 2). The first is the way it accesses the unlabeled data. Is there an existing massive database or are the data generated by a stream? The second problem is the actual classification problem that one wants to solve. Is it a binary or multi-class problem? In addition, are the input data structured? The third is the notion of budget, that is, which proportion of the unlabeled instances can be labeled. This proposed workflow outline general principles that should be considered in any AL study and will guide us to design the solution implemented in our simulated experiments. The remainder of this F 2: Proposed workflow paper is structured as follows. Section 2 discusses the industrial context along with previous studies on the development of ML metamodels for sawing simulators. Section 3 provides an overview of the Active Learning concepts presented in figure 2. The AL method studied in this paper is then described in Section 4. Section 5 provides details about the experimental setup, the results of which are presented in Section 6. Finally, section 7 provides some concluding remarks along with some perspectives regarding this research.

Sawing simulation in the wood industry

Sawmills process logs of varied lengths and shapes to produce lumber. This process is described as divergent with a co-production because several products, each with potentially different dimensions and grades, are produced at the same time from the sawing of a single log (figure 3).

Owing to these characteristics, predicting in advance the set of lumber (called a basket of products in the following) resulting from the sawing of a specific log, is a difficult problem. This complicates the optimization of operational or strategic planning, as well as the running of simulations needed to make long-term decisions, such as the remodeling of a sawmill, or simply the acceptation of a command containing unusual products, since acceptation of such a command would require the modification of mill setup and impact the whole mix of lumber produced in a way difficult to predict [START_REF] Wery | Simulation-optimisation based framework for sales and operations planning taking into account new products opportunities in a co-production context[END_REF]). However, the wood F 3: Breaking a log into a set of lumber. [START_REF] Morin | Machine learning-based metamodels for sawing simulation[END_REF] industry has several sawing simulation tools at its disposal to tackle this issue. Examples of such simulators include Optitek (FPInnovation), SAWSIM (HALCO software systems ltd. ) and Autosaw [START_REF] Todoroki | Autosaw system for sawing simulation[END_REF]). Considering 3D scans of the exterior shape of the logs, these simulators are able to digitally break it into a basket of products. However, depending on the simulation setting required and the log considered, simulators may need from a few seconds to 3 hours or more CPU time to determine the optimal breaking of a single log, which renders them impractical in cases in which a large number of simulations are needed. As an example of such an issue, Morneau-Pereira et al. ( 2014) proposed a mixed integer programming (MIP) model using Optitek simulation results on a few sampled logs to optimize the allocation of logs from cutblocks to sawmills. They reported that, although the MIP can be solved within a few seconds, the simulation itself takes several hours.

Considering this problem, [START_REF] Morin | Machine learning-based metamodels for sawing simulation[END_REF] proposed replacing the simulators with Machine Learning metamodels, which learn from the results of previous simulations and are able to approximate the simulator output. They used six features describing the logs to train several ML models, including random forest and k-Nearest Neighbor (kNN) classifiers. In [START_REF] Morin | Machine learning-based models of sawmills for better wood allocation planning[END_REF], the same authors used those classifiers to generate data later applied in a MIP model to optimize the log allocation from cutblocks to sawmills.

However, considering that these ML models use only six features describing the logs while the simulator makes use of a full 3D scan, [START_REF] Selma | An iterative closest point method for measuring the level of similarity of 3d log scans in wood industry[END_REF] and [START_REF] Chabanet | A knn approach based on icp metrics for3d scans matching: an application to thesawing process[END_REF] proposed an algorithm based on the iterative closest point algorithm (ICP) to compute the similarity between log scans. These similarities were then used in a kNN classifier.

Whereas previous studies on both structured and unstructured data offer interesting perspectives in terms of the computing time and prediction scores, they consider disposing from the start of a labeled database used to train an ML model with the objective of fully replacing the simulator. However, such ML metamodels are only applicable to a single sawmill using one configuration. Its efficiency also depends on the input log distribution staying stationary over time. Therefore, it is preferable to couple the simulator and the ML classifier using AL concepts to continually improve the latter while alleviating the computational cost of the former.

Literature review on Active Learning

In this section, Active Learning concepts and scenarios common in the literature are reviewed, along with popular sampling strategies.

Definition

Active Learning can be defined as a field of artificial intelligence that considers the problem of selecting only a few individuals from an unlabeled database. These instances are then iteratively labeled and used to train an ML model, that is, a function that can yield a prediction ˆ for the label of an instance . The main motivation is that, while huge, unlabeled databases have become increasingly easier to produce with the development of big data technologies, creating labeled databases remains time consuming and costly in some cases, particularly when the labeling process involves human experts or computationally intensive simulations. However, in the AL framework, only a few specific individuals are selected to be labeled by an expert, called an Oracle, to train or improve an ML classifier.

From our reading, an efficient AL strategy should be able to train such a classifier so that it is nearly as good as the model trained on the whole database by using only a fraction of the available data. Here, "nearly as good" refers to the occurrence of an expected error. Considering a loss function ( , ˆ ) that measures the cost of making an erroneous prediction ˆ instead of the true label , an AL strategy should be able to train a predictive model ℎ such that:

E ( , ) [ ( , ℎ ( )] < (1 + )E ( , ) [ ( , ℎ ( )] , (1)
with E the probabilistic expected value of the loss over new data instances with label , ℎ a predictive model trained on the whole dataset and a small value.

Data access scenarios

Various studies have explored several ways in which an Active Learning engine can gain access to a dataset, which are referred to as data access scenarios in this study for easy differentiation from other AL concepts. Occasionally, however, they are also simply called Active Learning scenarios in the literature. As identified in [START_REF] Kumar | Active learning query strategies for classification, regression, and clustering: A survey[END_REF], the data access scenario considered in the literature can be classified into three categories: pool-based, stream-based, and membership query synthesis.

• Pool-based Active Learning (figure 4) occurs when the AL engine has access from the start to a huge base of unlabeled data, and potentially of a small set of labeled data. This database is not supposed to evolve, except for the addition of labels to existing instances. Here, the AL engine goal is to select only a subset of the unlabeled data to be labeled by the Oracle and included in the labeled database. This labeled database is simultaneously used by the ML engine to train and improve the ML model. For example, [START_REF] Rastogi | Fast laplacian twin support vector machine with active learning for pattern classification[END_REF] propose to carefully select points from a database to label them and train a Laplacian twin support vector machine, which is a classifier able to learn from both labeled and unlabeled data. Similarly, Martinez [START_REF] Martinez Arellano | Towards an active learning approach to tool condition monitoring with bayesian deep learning[END_REF] propose an application of pooled-based active learning in an Industry 4.0 context. They study the use of Bayesian Neural Networks for tool wear detection. The uncertainty of the prediction is, interestingly, measured using Bayesian inference over the network parameters. • In membership query synthesis based Active Learning (figure 6), no stream or existing database is used. The AL engine generates query instances that are labeled by the Oracle. This framework was first introduced by [START_REF] Angluin | Queries and concept learning[END_REF], who considered the problem of identifying an unknown subset from a larger universal set. However, a disadvantage of this strategy is that it may be difficult for human experts to classify artificially generated instances. To solve this issue, [START_REF] Wang | Active learning via query synthesis and nearest neighbour search[END_REF] proposed a framework merging a membership query synthesis scenario and a pool-based scenario, where the AL engine generates an artificial query, but the one being labeled is its nearest neighbor in a real database. In addition to these scenarios, the AL process can either start from a small subset of already labeled data or with no labeled data. The latter case is referred to as cold start.

As shown in figure 2, the determination of which scenario to use is highly dependent on the application context. Pooled-based strategies are suitable when a huge unlabeled database is already present and no concept drift or concept shift is expected. Concept drift refers to the emergence of a new class or a change in the data generation process slowly over time, while concept shift refers to a brutal change in the data. In such a case, the predictor can be trained off line at one point in time and used consistently with no loss of prediction accuracy.

However, if concept drift is expected, if new unlabeled data are continuously generated, or if a single pass over the dataset is considered preferable due to computational limitations, a stream-based strategy might be preferable. This study focuses on a stream-based scenario, since it is more generally applicable than the pool-based case. However, while concept drift is to be expected in the forest-wood industry on which this study is based, no drift or shift was naturally present on the studied dataset. Therefore, in the last set of experiments presented in this paper, concept shift has been simulated to assess its effect on the proposed solution.

Lastly, a membership query synthesis might be an interesting choice when even unlabeled data are difficult to gather. However, in the case of a human the Oracle, a hybrid strategy is preferable.

Budget

As emphasized in [START_REF] Settles | From theories to queries: Active learning in practice, in: Active Learning and Experimental Design workshop In conjunction with AISTATS 2010[END_REF], the notion of budget is crucial for an Active Learning strategy to be practical and accepted in an industrial context. What defines the budget and the strategies proposed to avoid overspending may vary depending on the data access scenario and industrial setup being considered. In a pool-based scenario, the budget is often expressed as the maximum number of calls to the Oracle. A popular strategy, as used in [START_REF] Gikunda | Cost-based budget active learning for deep learning[END_REF], for example, is to iteratively select instances from the unlabeled dataset, which maximize some criteria and adds them to the labeled dataset until the budget is exhausted. In a stream-based scenario, it might be argued that a budget over time, that is, a maximum proportion ∈ [0, 1] of the stream instances to be selected per time period, is more practical than a fixed budget. Indeed, if the stream is infinite but the budget is fixed, the AL process will stop at some point in time when the budget is exhausted, whereas the stream will continue indefinitely, rendering the adaptation of the ML classifier to structural changes in the stream difficult. In [START_REF] Kottke | Probabilistic active learning in datastreams[END_REF], such a budget is considered and the use of an adaptive threshold is proposed on some computed quantity, which ensures that the Oracle budget is met within some tolerance window.

In addition, depending on the chosen ML classifier, an increase in the labeled database size might also increase its training time (e.g., random forest classifier) or prediction time (e.g., kNN). It might then be necessary to limit the size of the labeled database by dropping the least interesting instances. In [START_REF] Kurlej | Learning curve in concept drift while using active learning paradigm[END_REF], such a design is implemented by systematically dropping the oldest labeled instance, with the idea of helping a kNN model adapt to sudden drifts in the data stream.

Overview of AL methods

Once the scenario, budget constraints, and classification problem have been identified, it is necessary to develop an appropriate sampling strategy to select a subset of the available instances. As shown in Figure 2, the final choice of this strategy should be motivated by those characteristics. In an industrial context, it might also be important to choose an interpretable model.

Numerous AL strategies have been reported in the literature. For example, uncertainty sampling methods, introduced in [START_REF] Lewis | A sequential algorithm for training text classifiers[END_REF], is a natural heuristic for performing AL when the ML classifier output can be interpreted as a probability distribution over the labels given the features. An AL engine using uncertainty sampling queries instances that are more uncertain, that is, when max ( | ) is below a certain threshold. For example, [START_REF] Schmidt | Text classification based filters for a domainspecific search engine[END_REF] propose an application in text classification. An unlabeled document is first classified by a precise but fixed SVM ensemble, which attributes a probability to each of the document possible classes. If, however, the most probable class for the document is under a decision confidence threshold, the document is classified by a single SVM which is regularly trained on a database built using active learning principles. When this class probability is additionally under a annotation confidence threshold, the document is added to this classifier training database. A natural variant of uncertainty sampling, margin sampling, is used in [START_REF] Schein | Active learning for logistic regression: an evaluation[END_REF] for example. Consider and ′ as the most probable and second-most probable classes for . The margin is defined as ( | ) -( ′ | ), and the instances sampled are those with the lowest margin.

Similarly, query-by-committee methods were introduced in [START_REF] Seung | Query by committee[END_REF]. This method maintains a committee of several ML models and queries the Oracle in case of disagreement among its members. Several methods have been used in the literature to measure disagreement among committees. According to [START_REF] Settles | Active learning literature survey[END_REF], two popular methods are vote entropy and Kullback-Leibler divergence. A more straightforward methodology, used for example in [START_REF] Rajpathak | An integrated framework for automatic ontology learning from unstructured repair text data for effective fault detection and isolation in automotive domain[END_REF], is to train several classifiers, 8 in their case, and to select instances leading to tie in the vote, that is, in this example, instances with 4 vote for each class.

Whereas the former methods can be said to search for informative data points, other methods search for representative points. For example, in Wu et al. (2006), an AL strategy combining several criteria are proposed to measure the interest in selecting an instance, including a measure of representativeness pushing for the selection of points in a dense area of the input data space. Similarly, [START_REF] Wang | Active learning through density clustering[END_REF] proposed an algorithm to build clusters from an unlabeled database and select representative points for each cluster.

In [START_REF] Lughofer | On-line active learning: A new paradigm to improve practical useability of data stream modeling methods[END_REF], a family of methods based on soft computing is identified, which has been gaining attention during the last few years. Similar to uncertainty sampling methods, these strategies aim to quantify prediction uncertainty, but do not necessarily use the ML model outputs to do so. This allows them to consider other sources of uncertainty. For example, [START_REF] Kumar | Ensemble-based active learning using fuzzy-rough approach for cancer sample classification[END_REF] proposed an Active Learning strategy based on fuzzy rough logic for the classification of cancer samples.

Whereas most of the above methods propose a heuristic to select the points, the ultimate goal of the AL engine is to select data to reduce the prediction error of the ML model being trained, as defined in equation 1. This is a difficult task, however, as it requires an accurate estimation of the output probabilities without access to a test set of labeled instances [START_REF] Chapelle | Active learning for parzen window classifier[END_REF]. In addition, as described in [START_REF] Dasgupta | Two faces of active learning[END_REF], the Active Learning engine may induce sampling bias in the labeled database, which means that the data distribution in this database does not reflect the real data distribution. To bypass these problems, several authors have proposed the use of Bayesian inference and sample weighting. See [START_REF] Kottke | Toward optimal probabilistic active learning using a bayesian approach[END_REF] for an example of a pool-based model and [START_REF] Mohamad | Active learning for classifying data streams with unknown number of classes[END_REF] for a stream-based model.

In addition, an AL strategy should consider at least two sources of uncertainty. In [START_REF] Lughofer | Single-pass active learning with conflict and ignorance[END_REF], conflict and ignorance concepts are presented:

• A conflict occurs when an instance appears near the decision boundary between classes.

• Ignorance occurs when an instance appears in a region of the input space that has not been sufficiently explored or has not been explored at all.

In [START_REF] Bondu | Exploration vs. exploitation in active learning: A bayesian approach[END_REF], an interpretation of similar concepts is proposed under the exploration-exploitation framework. The AL engine should compromise between sampling from unknown areas of the input space, that is, exploration, and sampling from an area already known to increase the ML classifier performance there, that is, exploitation. A model performing only exploitation might be extremely precise on a small area of the input space and extremely imprecise everywhere else, whereas a model performing only exploration might miss areas of the input space where the classifier performs poorly and where more sampling is necessary.

Proposed method

Even if the proposed approach considers a particular problem from the sawmilling industry, a generalization of that problem can be made, with minimal assumptions on the data structures and class labels.

The data access scenario considered here is a stream-based one. Instances sampled from a possibly ill-defined space B arrive one by one from a stream, and an AL engine has to decide whether to call the Oracle and add the instances to a labeled database used to train an ML classifier. The instances from the set B are not supposed to have any structure, and therefore, can only be compared using a dissimilarity function, that is, a function : B × B ↦ → R, which intuitively measures the difference between two instances. No other assumption was made for the dissimilarity function. In particular, neither symmetry nor triangular inequality, which are properties of a valid distance, are required. In addition, there is no consideration of having prior knowledge on the set of possible classes, neither on its size nor on the class probability distribution.

In this study, the Oracle is a simulator. Therefore, the instances whose classes were attributed by the Oracle are considered to be the gold standard and stored in a database used to further improve the ML model. A k-nearest neighbor classifier was used. A kNN is well suited for the problem considered in this study because it allows the direct use of a non-metric dissimilarity, and do not considers the extraction of a context dependent vector of features.

A second advantage of kNN is that this algorithm belongs to the family of instancebased classifiers. This means that it does not require any training phase, but directly uses a database of known examples to make a prediction. Hence, the task of the ML engine is only to add the instances selected by the AL engine to this example database. This also means, however, that the computational cost of making a prediction increases with the size of the example database.

A last noticeable advantage is that a kNN classifier does not require prior knowledge of the number of classes or their probability distribution. This is useful in the setup described in the present paper because it does not consider any prior knowledge on the composition of realistic baskets of products before running the simulation.

However, considering that this kNN classifier makes use of dissimilarities, which in some cases can be relatively costly to compute, there is a real need to limit the growth of the example database.

The kNN model

The kNN rule [START_REF] Fix | Discriminatory analysis: nonparametric discrimination, consistency properties[END_REF]) is well known and commonly used in the industry owing to its simple implementation and overall results. Given a set of labeled instances and a new instance with an unknown label, the kNN rule searches for the instances ( 1 , ..., ) that are more similar to , that is, the instances with minimal dissimilarity. The class predicted for is as follows:

ˆ = argmax ∈ 1 =1 1 { = } , (2)
where 1 is the indicator function and ( 1 , ..., ) are the respective labels of ( 1 , ..., ).

Therefore, the kNN rule predicts the most frequent class among instances that are most similar to .

It is expected, however, that instances farther from the query will have a lower probability of sharing its class than the closer ones. Some authors, for example [START_REF] Dudani | The distance-weighted k-nearest-neighbor rule[END_REF], rectify this by weighting the instance votes with a function decreasing with the dissimilarity. In this study, a similar approach was explored, which only considers a neighbor if its dissimilarity with is below some threshold . Such neighbors are later referred to as acceptable. The prediction ˆ then becomes the following:

ˆ = argmax ∈ =1 1 { ( , )≤ and = } =1 1 { ( , )≤ } , (3)
where is the dissimilarity. Therefore, the indicative function 1 { ( , )≤ } as a weight can be seen as an extreme case of weighting scheme.

In this study, the dissimilarity introduced in Selma et al. ( 2018) is used. Figure 7 shows the ratio of logs sharing the same basket as a function of this dissimilarity. As expected, this ratio decreased rapidly with increasing dissimilarity.

In the remainder of this paper, the threshold is tuned to 250, which is approximately the value at which the ratio is lower than 0.5. Furthermore, as the specificity of this dataset, each log belongs to one of three categories depending on its length. These categories are different from the class labels. Therefore, the neighbor search is restricted to logs from the same length category only.

When the set of acceptable neighbors is empty but for some reasons a prediction is still needed for , the modified kNN rule falls back to a simple 1NN rule, that is, the predicted basket is the basket of the known instance that is more similar to the query . The conflict measure used in this paper as a measure of the predictor uncertainty cannot, indeed, take more than values.

needs, therefore, to be high enough to allow this measure to differentiate multiple situations. However, the size of the example database used by the kNN model to make its prediction is expected to remain small in our experiments. Therefore, the value of should be chosen to remain small compared with the size of this database. No further optimization of had been made. More experiments, however, have been done, changing the value of to 5 or 15. This had very little impact on the overall results. Consequently, in the following, the parameter is fixed to 10 as a reasonable value considering the expected size of the built database and the way the prediction confidence is measured.

Prediction confidence assessment

The kNN algorithm is not, by nature, probabilistic. However, numerous heuristics have been proposed for measuring the uncertainty of its output. For example, [START_REF] Delany | Generating estimates of classification confidence for a case-based spam filter[END_REF] proposed 5 confidence measures, and [START_REF] Cheetham | Measures of solution accuracy in case-based reasoning systems[END_REF] proposed 12.

In this study, two measures of uncertainty were chosen, one adapted to measure the ignorance and the other to measure the conflict. The ignorance measure is the inverse of the distance from to its nearest neighbor in the example database.

( ) = 1 min 1< < ( ( , )) , (4)
The conflict measure is defined as the margin between the two most frequent classes among the k-Nearest Neighbors of used by the modified kNN classifier, that is, those with a dissimilarity lower than . More precisely, first consider 1 as follows:

1 = =1 1 { = ˆ and ( , )< } =1 1 { ( , )< } . (5)
Similarly, consider 2 as the score of the second most frequent class:

2 = max ∈ \{ ˆ } =1 1 { = and ( , )< } =1 1 { ( , )< } , (6)
The conflict measure is as follows:

= 1 -2 (7)
This measure is used as follows. Consider two thresholds and (these thresholds can either be fixed in advance based on prior knowledge or adjusted over time to ensure that the budget is respected). When ( ) < or ( ) < , the Oracle is called for the new instance , and the result is added to the example database. If the Oracle is not called, the class predicted for is given by the modified kNN presented in the previous section. Figure 8 presents an example of the threshold usage. The query instance is represented by a cross and is surrounded by instances from three classes, circle, square, and star. Among these instances, seven are acceptable, i.e., have a dissimilarity lower than the threshold . Here, is the minimum dissimilarity among the neighbors. The two more frequent

Budget

This study runs four set of experiments. The first two sets of experiments do not consider any notion of budget and use fixed ignorance and conflict thresholds. However, this would be considered unsatisfactory in most industrial contexts. As previously described, budget management is, indeed, particularly important in such a case. The third and fourth set of experiments will, therefore, introduce a simulation budget, which will also be considered in the last set of experiments assessing the impact of concept shift. More precisely, the coupling of an ML classifier and a simulator requires to take into consideration the maximum simulator capacity. Inspired by the methodology presented in [START_REF] Kottke | Probabilistic active learning in datastreams[END_REF], the following extension is proposed to ensure that the budget will not be exceeded, that is, that no more instances will be sent to the simulator-oracle than can be simultaneously managed. Consider as the ratio of free slots in the simulator at time step . The thresholds and will be adjusted such that, for an incoming instance , the probability of sending it to the Oracle is lower than ; that is, P( ( ) < or ( ) < ) < . Therefore, when no free slot is available, = 0 and the probability of sending a new instance to the Oracle is null. However, it is also desirable to keep P( ( ) < or ( ) < ) sufficiently high such that the simulator does not remain unused. Multiple choices of and satisfy these constraints. To select only one, a hyperparameter ∈ [0, 1] is introduced, which can be seen as a measure of the relative importance accorded to the ignorance measure, compared with the conflict measure. The thresholds and are then chosen as the quantiles at level over the distribution of and at level (1 -) over the distribution of . Then, by definition of the quantile,

P( ( ) < or ( ) < ) ≤ P( ( ) < ) + P( ( ) < ) ≤ + (1 -) (8)
≤ .

As in [START_REF] Kottke | Probabilistic active learning in datastreams[END_REF], the quantiles were estimated on a sliding window on the past data from the stream. It is expected that this estimate may be biased, as the distributions of and are expected to vary over time with the addition of new instances to the example database. However, this strategy ensures that the simulator will not be overloaded.

However, it should be noted that the conflict measure can only take values in a finite set. Considering that the conflict threshold being defined has a quantile that often takes one of those values, the strict inequality comparison seemingly leads to an under sampling of the stream, particularly for small values of . This behavior was corrected using the following scheme. When ( ) = , consider = (1 -) -P( ( ) <

). The instance is sent to the simulator according to the value of a Bernoulli random variable of parameter .

An overall summary of the complete proposed method is presented figure 9. In this figure, the budget is represented as a number of free slots in the simulator, or free capacity . The two notions are linked by the formula = where is the maximal capacity of the simulator.

Experiments setup

The strategy described in the previous section was simulated using the programming language Python, with a 3D scan dataset supplied by the Canadian wood industry. The following is a detailed description of the database and an evaluation of the scores.

Log database

The database used in this paper contains 1207 3D scans of logs (figure 10), as well as their associated baskets of products simulated by the software Optitek. As said earlier, these logs can be separated into three length classes. The very short logs have a length under 2.48 m. shorts logs are defined as having a length between 2.48 m and 3.5 m. The vast majority of them, however, have a standard length of 2.5 m. Similarly, long logs are defined has having a length above 3.5 m and have, in nearly all cases, a standard length of 5 m. The 19 different types of lumber appearing in the database are numbered from 1 to 19, and each basket is represented by a vector of length 19, where the element in position is the amount of product resulting from the breaking of the log. It should be noted that, because no basket contains more than five different kinds of products, such vectors are sparse. The base contains up to 105 different types of baskets, including 72 that appear only once because of their rarity and the size of the database. Each basket was considered a class in the classification problem. Because our goal is to create a metamodel of the original simulator, that is, the Oracle, these rare labels are not considered as outliers.

The scans are composed of a succession of ellipsoids, which together sample the log surface. However, some scans initially contained missing sections, that is, parts without ellipsoids. These sections were filled by repeating the ellipsoid that immediately preceded them.

Evaluation scores

To evaluate and compare the performances of the different ML classifiers, a score must be defined. In [START_REF] Morin | Machine learning-based metamodels for sawing simulation[END_REF], the prediction-production score is specifically introduced for the problem of evaluating ML models that predict the log baskets of products.

Consider as the real basket of products of a log, and ˆ as the predicted basket of products. Because both and ˆ are sparse, including all (0, 0) real/predicted pairs would bias the score optimistically. Hence, all such (0, 0) values are removed. The new length of the vectors is denoted by .

The production score is introduced as follows:

= 1 =1 min(1, max( , ˆ ) ), (9)
where and ˆ are the ℎ components of vectors and ˆ , respectively, and is a small value to avoid dividing by zero. The prediction score is similarly defined as follows:

= 1 =1 min(1, ˆ max( , )
).

(10)

The production score can be seen as the proportion of the prediction that is effectively produced, whereas the prediction score is the proportion of the production that is correctly predicted.

The prediction-production score is then naturally defined by the following:

× = × . ( 11
)
The evolution of the kNN performance is monitored as the stream progresses using the accumulated × : × . This accumulated score allows following the evolution of the performance profile of the classifier with respect to the stream advancement, as recommended in [START_REF] Lughofer | On-line active learning: A new paradigm to improve practical useability of data stream modeling methods[END_REF] for short stream simulations.

The value of × is initially set to zero. Then, whenever a new log appears in the stream, a prediction ˆ is always performed using the current example database, before potentially completing this database with the new log depending on the result of the AL rules.

The accumulated score is then updated using the following formula:

× = × ( -1) + × , ( 12
)
with i being the number of previous updates.

When not working under budget, × is introduced as a version of the accumulated score and is only updated when the log is not sent to the Oracle and is therefore not added to the database. In this case, the growth of the database was also monitored. Similarly, when working under budget, × is introduced, which is either updated with 1 when the log is sent to the Oracle, and × when it is not. A strategy with a higher × is better at dispatching incoming instances between the simulator and the ML classifier under budget constraints.

The second performance measure considered in this study is the number of classes present on the example dataset at the end of the stream. This measure is not directly linked to the prediction score. It is, however, a measure of the effectiveness of the exploration of the input data space by the AL strategy. This stems from the idea that a strategy with a better exploration is expected to be, in general, more robust against a potential concept shift. Such a measure is considered in [START_REF] Mohamad | Active learning for classifying data streams with unknown number of classes[END_REF] under section class discovery performance.

Results

In this section, four sets of experiments are described. First, no budget restrictions are considered. Therefore, the thresholds are set to fixed values. The example database used by the kNN classifier is initially empty, and the logs are considered individually in random order to simulate a stream. Three models were considered in this study. One model adds all instances from the stream to the example database. One model adds only the instances whose ignorance measure is lower than . The third model selects instances when the ignorance measure is lower than or when the conflict measure is lower than . A second set of experiments repeated the previous experiment 100 times and considered the influence of the stream order.

The third set of experiments considers the budget with the strategy presented in Section 4. To avoid problems at the beginning of the stream, the example database is initialized with one log at random per category of length. These logs are, therefore, removed from the stream. This experiment was repeated 100 times for different stream orders.

The last set of experiments consider a set up similar to the third set of experiments. In particular, budget is considered and managed with the same strategy, presented in section 4. Contrary to what is done in the third set of experiment, however, concept shift is introduced here. More particularly, long logs are only included in the stream after the first 600 time steps.

Experiment with no budget

This section focuses on the results of the simulation for one random ordering of the stream. Rather than an independent set of experiments over an implementable solution, this section should be seen as an example of what happen in a particular case to gain insight over the mechanics at play. Budget is not considered yet, so that the base can freely grow.

The conflict threshold is set to = 0.3, as previous experiments make it appears an interesting compromise between database growth and prediction score. Further details about these experiments and the roles of the thresholds will be given in the next section. The ignorance threshold is, similarly, set to = 1 250 , that is, = 1 . In this particular case, the modified kNN rule never has to fall back to the 1NN rule because the Oracle is called whenever no neighbors have a dissimilarity lower than . Figure 11 shows the evolution of the accumulated score with the progress of the stream. Here, the next instance is always predicted by the modified kNN rule, whether sent to the Oracle or not. For readability, the plot starts only after the first 50 instances have passed in the stream. The experiment was conducted on the three models. The first considers only the ignorance measure and therefore performs only an exploration on the input data space. The second experiment considers both ignorance and conflict thresholds, whereas the third experiment adds all instances from the stream to the example database for future predictions. As can be seen, there is little difference between the three accumulated score curve profiles. They all grow rapidly at the beginning of the stream before stabilizing around similar final values. However, the curves for the models using thresholds are slightly lower than those of the model that adds all examples to the labeled database. A symmetric Wilcoxon signed rank test between the scores of the last 500 predictions of the model when adding all instances of the model using the ignorance threshold shows a p-value of 0.02, which is statistically significant at the 5% confidence level. However, the p-value of the test between the model when adding all instances and the model using both ignorance and the conflict threshold was 0.51.

More importantly, a significant difference can be observed between the model management of the example database in Figure 12. This figure shows the growth of the example database for the models using either the ignorance rule only, or both the ignorance and conflict rules. Whereas the model adding all examples to the labeled database is not presented for clarity, its curve would be a straight line = . As can be seen from this figure, however, at the end of the stream, the model using both rules selects only 45% of the instances, whereas the model using the ignorance rule alone selects only 39%. Considering that the nearest neighbor search in this study uses brute force because the data input does not belong to a vector space, and therefore has a linear prediction cost with respect to the size of the example database, reducing this base, as was applied herein, reduces the prediction cost by a similar amount. The benefit of the conflict rule is shown in Figure 13. This figure shows the evolution of × as the stream progresses, i.e., the evolution of the accumulated prediction/production score when it is only updated with the prediction/production scores of the predicted class of instances not sent to the Oracle. In this case, the model that adds all aspects to the example database cannot be considered because × would never be updated. Here, whereas the evolution of the scores is less stable than in Figure 11, the curves are clearly separated, with the model using the conflict rule having a final score higher than a model that does not. The difference was found to be statistically significant based on a Mann-Whitney U test. Hence, in this case, the conflict rule is effective at detecting instances that would be poorly predicted by the current kNN model.

Influence of stream order

To study the influence of the stream order, the experiment carried out previously was repeated 100 times for 100 random orders in the stream. The end values of × of × and of the example database size were stored for each repetition. The total number of classes in the example database was also recorded. These values are listed in Table 1. The experiments were repeated for three different ignorance thresholds and three conflict thresholds . In addition, the table also contains the results for AL models using only the ignorance rule. They correspond to the models marked "Not used" in the column.

t
As the first remark, the end of the stream accumulated scores of the AL models are on average nearly as good as the model that adds every instance from the stream to the example database. However, they are not as good as this last model, as confirmed by the Wilcoxon signed-rank tests between the end of the stream values, with a confidence level of 5%.

However, the worst accumulated score, 74.8%, also corresponds to the model with the most reduced example database. Indeed, 234 logs were selected, which corresponds to only 29% of the total stream. The AL model with the highest example database is, unsurprisingly, the model with the highest ignorance threshold, = 1 200 , and the highest conflict threshold = 0.5, as they increase the sensitivity of the rules. The size of the example database in this case is 807 logs, which corresponds to a reduction of approximately 33% with the initial model. Despite selecting fewer samples, the AL models are efficient at detecting new classes. Indeed, by the end of the stream, at least 95 different classes are present in the example database, out of a total of 105 present in the entire dataset. The models with the lowest ignorance threshold systematically selected at least one instance of each class. For comparison, a set of 807 logs sampled randomly from the entire database contains on average only 80 different classes. Similarly, a random set of size 234 contains only 34 classes.

In addition, the average accumulated scores updated only for instances not added to the example database, × , is always higher than the average accumulated score for all instances from the stream, × . In fact, they are always higher than the maximum value of × obtained for the model that adds all components to the example database. The only model for which this difference is not statistically significant is the model using = 1 300 and no , with a p-value of the Wilcoxon test at 0.5. Therefore, the proposed set of rules is efficient at detecting instances from the stream that would be poorly predicted by the current model, sending them to the Oracle.

Concerning the threshold role, a higher conflict threshold for a fixed ignorance threshold coincides on average with a higher end of stream × , as confirmed using Wilcoxon signed rank tests. Similarly, this results in a higher × . A higher ignorance threshold for a fixed conflict threshold also results in a higher × and × . However, it can be observed that when or increases, the size of the example database also increases because higher thresholds mean that the Oracle is called more often.

Budget experiment

In this section, a budget limitation is added to the simulation using the strategy defined in Section 4. The number of steps needed to obtain the result of the simulation was fixed to 20, and the number of slots in the simulator was fixed to 10, and thus no more than half of the instances from the stream could possibly be sent to the simulator. The experiments were run for five values of parameter . For = 0, only the conflict measure is used. For = 1, only the ignorance measure is used. For = 0.3, 0.5, and 0.7, both measures are used but are more or less important. For comparison, a greedy strategy to dispatch logs between the simulator and classifier is also considered, i.e., whenever a slot is free in the simulator, the next instance is sent to fill it. Table 2 presents the results of the simulations: The average end of stream × , which measures the performance of the kNN model alone, the average end of stream × , which measures the global performance of the couple simulator-ML classifier, the average end size of the example database, the average number of classes discovered, and the average number of occupied slots in the simulator along the whole stream.

AAS

As can be seen, the strategy using only one of the conflict and ignorance measures, that is, for = 0 or = 1, underperforms in terms of both × and × when compared with models using both measures. In particular, the model using only the conflict measure has the worst accumulated scores among all non-greedy models. It also discovers far fewer classes than the other, i.e., 20 classes on average against more than 65 for all the others, despite sending in slightly more instances to the simulator and example database on average.

Among the models using both measures, = 0.5 yields slightly better results than the others. This difference was rarely found to be statistically significant, however, because when repeating the Wilcoxon test under the hypothesis in which the "prediction production score for = 0.3 is less than the prediction/production score on the same instance for = 0.5", with simulation prediction scores equal to 1, the p-value was never lower than the (Bonferroni corrected) level of 0.0005; in addition, it was under the non-corrected threshold for only four of the experiments.

All models have a similar management of the number of occupied slots and database growth. Indeed, they all use an average of 6 out of 10 slots of the simulators, whereas the size of the example database at the end of the stream is approximately 400. The greedy strategy, despite having a decent average end of stream × of higher than = 1 but lower than = 0.3, has the worst × among all models considered. Indeed, the example base used by the kNN classifier is built this time at random and therefore does not perform as well as the kNN using the selected example base.

Figure 14 exposes the averaged number of occupied simulator slots for each step of the stream and value of . For clarity, the plot was stopped after 600 time steps, but the curves keep going as expected. As can be seen, this figure can be separated into a transient state, where the kNN and distributions used for the computation of the quantile threshold are set up, and a steady state. The differences observed between different values of can be, at least in part, explained by the correction . This correction, indeed, push to select instances with a probability closer from during the set up time where the quantiles are ill-defined. However, in the steady state, the average simulator usage is stable and appears independent of the value of . This might be different, however, in the presence of concept drift, which might be expected to trigger a higher use of the simulator.

Impact of concept shift

This section presents the results of experiments with concept shift. The notion of budget is considered and managed as in the previous section. Concept shift is similarly introduced, and simulated as follow: As explained in section 5.1, the logs present in the studied dataset belong to three length classes. For the 600 first iterations of the stream, the logs are selected randomly among the very shorts and shorts logs only. After the 600 ℎ time step, logs are chosen among the all the ones not already passed in the stream, including the long logs.

AAS pre×pro BAS pre×pro

Example database size

Number of classes

Average simulator use 0 78.7 ± 0.2 86.0 ± 0.1 409.9 ± 0.7 17.0 ± 0.5 6.5 ± 0.1 0.3 82.4 ± 0.2 88.5 ± 0.1 411.9 ± 0.8 60.5 ± 0.7 6.5 ± 0.1 0.5 83.5 ± 0.2 89.2 ± 0.1 402.7 ± 0.8 79.1 ± 0.6 6.5 ± 0.1 0.7 83.5 ± 0.2 89.0 ± 0.2 402.7 ± 0.9 89.5 ± 0.6 6.4 ± 0.1 1 81.9 ± 0.3 88.0 ± 0.2 401.2 ± 0.8 95.8 ± 0.4 6.3 ± 0.1 Greedy strategy 77.6 ± 0.2 88.8 ± 0.1 597.0 ± 0 64.7 ± 0.8 9.5 ± 0 T 3: Accumulated scores, example database size, number of classes discovered at the end of the stream, and average number of occupied slots in the simulator, averaged over 100 runs of the experiment, with random stream ordering. Concept shift is included in these tests.

Table 3 presents the same scores used in the previous section. The difference lays in the simulation of data drift in this set of experiment. These scores are, unsurprisingly, similar to what was obtained in the previous set of experiments, albeit slightly lower in general. Figure 15 appears, in that aspect, of higher interest. This figure is similar to figure 14 and shows the average number of occupied slots in the simulator for each time step. The influence of the concept shift is visible from the simulator usage increase, for a short period following the appearance of long logs in the stream. This effect is similar for all values of the parameters , except for = 0, for which no such increase in the number of occupied slots is observed. This is not surprising considering that for = 0, only the conflict measure is used, which will not be able to immediately detect the apparition of logs very dissimilar with the ones previously seen in the stream.

Conclusion and limitations

In this paper, an application of an Active Learning concept was proposed to couple two technologies pushed by the transition toward Industry 4.0, by adding one of the mains industry of the future capabilities: predictive capacity to anticipate and react to changes and avoid potential issues. More precisely, a simulator and an ML classifier were coupled. Log scans from a stream were dispatched to one or the other to ensure a high prediction quality of the ML classifier and reduce the number of calls to the costly simulator. Furthermore, the logs sent to the simulator were used to improve the classifier.

It was shown that, when budget limitations are not considered, the method presented in this paper allows the training of a kNN on a fraction of the log scans with nearly as high of an accumulated score than the kNN which adds all instances from the stream to its example database. In addition, the accumulated score computed only over instances that were not added to the database was significantly higher than the accumulated score over the predictions of all instances from the stream. Therefore, the set of measures used in this study can be considered efficient at detecting instances that would be poorly predicted by the kNN, sending them to the simulator instead.

Similarly, when working under a budget, the method presented in this paper can lead to global accumulated scores of over 89% and kNN scores of over 83% on the effectively predicted examples while reducing the number of logs sent to the simulator by a controlled amount.

However, there are some limitations to this study. In particular, the choice of the hyperparameters for the AL strategy and for the kNN rule are far from easy to achieve, particularly at the beginning of the stream when no information is known on the log scan properties. Whereas it appears from these experiments that the choice of has little influence on the results as long as both the ignorance and conflict measures are used, this is not a given and might be different for another application. These parameters could, however, be initialized to reasonable values, for example = 0.5, to balance the exploitation and exploration, and = +∞ to start with a standard kNN rule, and evolve over time according to the system results.

The cost of making a prediction using the kNN model considered in this study is bound to increase as the example database is continuously gathered. Further studies will therefore focus on either limiting the maximum size of the database, using an approximate version of the classifier, for example with a similarity graph, or by using other ML classifiers able to apply dissimilarity inputs. Wu, Y., Kozintsev, I., Bouguet, J.Y., Dulong, C., 2006

F 1 :

 1 Development stages toward Industry 4.0. Source: FIR e.V. at RWTH Aachen University be managed despite an increasing tendency to decentralization induced by the adoption of Cyber Physical Production System technologies

F 4 :

 4 Explanatory diagram of pool-based Active Learning scenario • Contrary to what occurs in a pool-based case, stream-based Active Learning (figure 5) strategies do not consider having access to the whole unlabeled database at once. The new data instances arrive iteratively from an unlabeled data stream. The goal of the AL engine considering the current state of the ML model is to then decide whether to call the Oracle or not.

F 5 :

 5 Explanatory diagram of the stream based Active Learning scenario For example, Lughofer et al. (2015) proposed an active learning application based on fuzzy classifiers to classify visual defects on micro fluid chips. An important point of their study is the ability of the proposed model to incorporate on the fly new classes, that is, new type of defects never observed before. More recently, Lowrance and Lauf (2019) proposed a comprehensive framework for developing the online Active Learning of the wireless connection quality for mobile robots.

F 6 :

 6 Explanatory diagram of the query synthesis

F 7 :

 7 Ratio of pair of logs having the same basket, as a function of the ICP dissimilarity between the logs

F 8 :

 8 Example of an application of the AL strategy.

F 9 :

 9 Outline summary of our proposed method

F 10 :

 10 Example of a 3D scan of a log.

F 11 :

 11 Evolution of × with the progress of the stream for three AL models.

F 12 :

 12 Growth of the example database with the progress of the stream for two AL models.

F 13 :

 13 Evolution of× with the progress of the stream for two AL models.

F 14 :

 14 Average number of used slots in the simulator as a function of time, for each value of the parameter

F 15 :

 15 Average number of used slots in the simulator as a function of time, for each value of the parameter . Long logs are introduced from the step 600 only.

  Application of the use of the ignorance and conflict measures to decide whether to send a new instance to the Oracle.

	Input New instance , a database B
	Output toAdd, Boolean, whether to add to B or not
	kNearestNeighbors ← list of k elements in B most similar to
	acceptableNeighbors ←
	toAdd ← FALSE
	for nn in kNearestNeighbors do
	if Dissimilarity(x, nn) <	then
	add nn to acceptableNeighbors
	end if
	end for
	_	←	( , B)
	_	←	( , acceptableNeighbors)
	if _	<	OR _	<	then
	toAdd ← TRUE
	end if
	return toAdd
	classes are circle and star, with a margin of 4 7 -2 7 = 0.286. The cross query is sent to the Oracle if and only if 0.286 < or 1 < .

Algorithm 1

ign t conf AS pre×pro AAS pre×pro Example database size Number of classes

  Accumulated scores, example database size, and number of classes discovered at the end of the stream, averaged over 100 runs of the experiment, with random stream ordering.

		Not used 77.8 ± 0.1 86.3 ± 0.2	577 ± 1	105.0 ± 0
	1	0.1	77.9 ± 0.1 88.4 ± 0.2	620 ± 2	105.0 ± 0
	200	0.3	78.2 ± 0.1 92.4 ± 0.2	707 ± 3	105.0 ± 0
		0.5	78.3 ± 0.1 96.1 ± 0.1	807 ± 2	105.0 ± 0
		Not used 76.2 ± 0.2 81.7 ± 0.3	355 ± 1	101.0 ± 0.2
	1	0.1	77.5 ± 0.2 85.5 ± 0.2	426 ± 3	101.4 ± 0.2
	250	0.3	77.8 ± 0.1 88.9 ± 0.2	534 ± 4	101.5 ± 0.2
		0.5	78.2 ± 0.1 91.8 ± 0.2	655 ± 4	101.7 ± 0.2
		Not used 74.8 ± 0.4 78.7 ± 0.5	234 ± 1	88.4 ± 0.4
	1	0.1	76.8 ± 0.2 82.5 ± 0.3	300 ± 3	88.5 ± 0.4
	300	0.3	77.1 ± 0.2 84.7 ± 0.3	392 ± 5	88.6 ± 0.4
		0.5	77.5 ± 0.2 86.5 ± 0.3	504 ± 6	88.8 ± 0.4
		add all	78.5 ± 0.1	-	1207	105
	T	1:

pre×pro BAS pre×pro Example database size

  Accumulated scores, example database size, number of classes discovered at the end of the stream, and average number of occupied slots in the simulator, averaged over 100 runs of the experiment, with random stream ordering.

					Number	Average
					of classes	simulator use
		0	79.5 ± 0.2 86.6 ± 0.1 412.2 ± 0.7 20.2 ± 0.7	6.5 ± 0.1
		0.3	83.4 ± 0.2 89.1 ± 0.1 412.2 ± 0.7 69.9 ± 0.7	6.5 ± 0.1
		0.5	84.0 ± 0.2 89.5 ± 0.1 409.2 ± 0.78 84.6 ± 0.7	6.5 ± 0.1
		0.7	83.8 ± 0.2 89.3 ± 0.2 403.4 ± 0.9 93.4 ± 0.6	6.3 ± 0.1
		1	81.6 ± 0.3 87.8 ± 0.2 400.0 ± 0.7 98.7 ± 0.4	6.3 ± 0.1
		Greedy strategy	77.8 ± 0.2 88.9 ± 0.2	597.0 ± 0	65.1 ± 1	9.5 ± 0.1
	T	2:

  . Sampling strategies for active learning in personal photo retrieval, in: 2006 IEEE International Conference on Multimedia and Expo, IEEE. pp. 529-532.

Acknowledgement

The authors gratefully acknowledge the financial support of the ANR-20-THIA-0010-01 Projet LOR-AI (lorraine intellgence artificielle) and région Grand EST. We are also extremely grateful to FPInnovation who gathered and processed the dataset we are working with.


Agnès Braud

Xavier Dolques

Pierre Fechter
email: p.fechter@unistra.fr

Nicolas Lachiche
email: nicolas.lachiche@unistra.frflorence.leber@engees.unistra.fr

Florence Le Ber

Véronique Pitchon
email: pitchon@unistra.fr

Analyzing the composition of remedies in ancient pharmacopeias with FCA

This paper presents the collaborative work led in an interdisciplinary project on studying remedies in Arabic medieval pharmacopeia. The goal is to find new molecules in plants or combinations of active principles to substitute them for antibiotics which encounter some limits. Formal Concept Analysis is used to discover co-occurrences of ingredients. We describe the difficulties inherent to these data and the results of preliminary analyses.

Introduction

This paper presents the preliminary work led in an interdisciplinary project that aims at studying remedies in Arabic medieval pharmacopeia. The project gathers researchers in history, microbiology, botanic and computer science. The general goal is to discover the active ingredients in remedies and to test them experimentally on bacteriae. The extracted knowledge could be used to substitute molecules in plants or combinations of active principles for antibiotics which encounter some limits.

In this work, we focus on medieval remedies prescribed for urinary problems. We present a dataset of remedies extracted from 5 pharmacopeias. This dataset is rather small, but the modeling is not straightforward. Although the building of the database is not finished, some analyses can already be done on the composition of remedies. Formal Concept Analysis (FCA) [START_REF] Ganter | Formal Concept Analysis: Mathematical Foundations[END_REF] appears as particularly suitable for this task, and preliminary results we obtained using it seemed very interesting to historians and microbiologists.

Section 2 presents the process for carrying out the project and in particular data collection. Section 3 describes the data, their characteristics and the difficulties resulting from them. In Sect. 4, we present our preliminary analyses and show the benefits of using FCA in this context. Finally, Sect. 5 yields some conclusions.

The whole process of this research work is presented on Fig. 1.

Fig. 1. Overview of the project process

The first step is to select pharmacopeias and remedies in them. This is done by an historian, who reads Arabic, on the basis of the symptoms indicated in the description of the remedy and on her knowledge of Arabic medicine. Let us note that Arabic medecine is based on the theory of Humours that considers that the body is constituted of four humours (water, fire, earth, air) having some qualities (hot, cold, dry, wet). The second step consists in clarifying some plants which are not described clearly enough in the text, with the help of a botanist. The next step is to build a database to store the remedies, whose modeling difficulties will be discussed in the next section. Then comes the formulation of questions that experts have on the data and that can be solved using FCA. The analysis of lattices and rules may bring new insights or questions both in history and on the use of plants in remedies. Some hypotheses on the use of plants stemed from this analysis will be studied in collaboration with a botanist (for the identification and characterization of therapeutic properties of plants) and a pharmacologist studying drugs based on natural substances (for the identification of the active molecules in plants), and then tested on bacteriae by microbiologists.

In this project, 5 pharmacopeias have been selected:

two versions of the pharmacopeia of Sābūr ibn Sahl (9th century). Sābūr ibn Sahl was born in Jundishāpūr (Iran) and was chief of the hospital there before moving to Iraq. A version of the pharmacopeia [START_REF] Kahl | Sābūr ibn Sahl's Dispensatory in the Recension of the 'Ad . udī Hospital[END_REF] was for the pharmacists of 'Ad . udī's hospital in Baghdad (this pharmacopeia will be designated by ISA), and a shorter one [START_REF] Kahl | The Small dispensatory: Sābūr ibn Sahl[END_REF] for pharmacists outside of the hospital who were considered less skillful (designated by ISP); the pharmacopeia of Al-Kindī (9th century) [START_REF] Levey | The Medical Formulary or Aqrābādhīn of Al-Kindī[END_REF], who studied in Bassora and Baghdad. This pharmacopeia will be designated by AK; the pharmacopeia of Al-Tilmīdh (11th-12th centuries) [START_REF] Kahl | The dispensatory of Ibn at-Tilmīdh, Arabic text, English translation, study and glossary[END_REF], who was chief of 'Ad . udī's hospital in Baghdad. This pharmacopeia will be designated by AT; the pharmacopeia of Al-Samarqandī [START_REF] Levey | Chemistry in the Medical Formulary of Al-Samarqandī[END_REF]. This pharmacopeia will be designated by AS.

The historian has based her choice firstly on the availability of books describing them, then preferably around Baghdad because of her knowledge on this area and also because Arabic pharmacopeias have a very rich content, and on a long period for a wide historical view. A few other criteria are linked to interesting historical questions.

Pharmacopeias are available as translations and/or original manuscripts. Figure 2 shows pages of two manuscripts. Both translations and original manuscripts may contain errors, so in the first case the historian may also have an original manuscript to check, and in the second case there may be errors made by copyists so that several different manuscripts are necessary. Among several hundreds of remedies, 38 prescribed for urinary symptoms were found. Among these, we removed 3 for this work: 1 from ISA which was already in ISP with exactly the same recipe, and 2 universal remedies with more than 50 ingredients (1 in ISP, 1 in ISA).

In the following, remedy identifiers will be prefixed by the acronym of the pharmacopeia in which they appear.

Data characteristics

The data that have been collected are rather small, but the collection requires a lot of time and the data are actually complex. The description of a remedy is composed of a list of ingredients (see Table 1 for an example) with quantities, and a description of the preparation. Let us note that part of the ingredients are present in the recipe to treat the disease, and some others may be present to treat their side effects, but this is not indicated. Ingredients belong to different categories: plant, mushroom, mineral, (like honey or musc) and metal. The description of plants is not homogeneous:

some plant descriptions correspond to different taxonomic rank (e.g. species for Scammony, genus for Euphorbia, several families for Fern); some descriptions correspond to a plant, other to a part of a plant, or even a part of a part of... a plant (e.g., Acorn/Acorn shell/Inside peel of acorn shell, or Thymus without part while just a part is probably used). Let us notice that several parts of the same plant can be used in a remedy; some ingredients have some transformations associated (e.g., Peeled and grilled bitter almonds); some ingredients are a mix of ingredients (e.g., Persian za'atar); a few ingredients have an origin (e.g., Kerman cumin) and it is an important information since it usually reflects a high quality; some are still to determine (e.g., Idrūmaghmū).

Data modeling requires expert knowledge to determine which information is important to capture; for example, should Acorn and Inside peel of acorn shell be comparable? Moreover, for a work on active principles, having a precise description of plants is important as different species may have different properties. The exact species may be implicit for the author, who is used to a specific one or to the local one. A more precise information can be inferred on the species, either by checking the translation, searching for contextual information in books, or relying on illustrations present in the book. In this last case, the botanist may help as well as with knowledge on the parts of plants traditionally used. At the end, the discussions on data modeling have raised new questions. For example, after a discussion on the problem of representing acorn and the different parts used, the historian has decided to study further in books the use of oak.

All these points make that a relational database is not suitable to store these data. A graph database offers more flexibility to represent them and to adapt the representation to new cases. We have thus chosen this type of database. For the same reasons, building a context for FCA requires some choices among the information.

Currently, the data on which we work are the data issued from the translation of texts. The work to clarify species and parts of plants is in progress, led by the historian and the botanist, and will take some time, but it is still possible to start some analyses.

Preliminary analyses

For our preliminary analyses on the data, we have worked on two questions asked by the microbiologist: "which ingredients appear the most often?" (Q1) and "which ingredients often appear together?" (Q2). As shown in previous works [START_REF] Couceiro | Elements About Exploratory, Knowledge-Based, Hybrid, and Explainable Knowledge Discovery[END_REF], FCA-based approaches are very suitable to solve this type of questions.

We have worked both on the ingredients as they appear in the recipes, and on these ingredients with the ones coming from plants replaced just by the corresponding plant (without part and transformations, such as Oak for Acorn shell or Almond tree for Peeled sweet almonds). The plant can be at the level of species, genus, family... Let us note R the set of remedies, I the set of ingredients without modification and IP the set of ingredients with the ingredients coming from plants replaced by the plant, contains ⊆ R × I and containsP ⊆ R × IP two incidence relations describing the composition of remedies. We have thus built one context CI = (R, I, contains) and another context CIP = (R, IP , containsP ). Let us recall that we work on 35 remedies concerning urinary symptoms. They are distributed in the 5 pharmacopeias as follows: 3 in AK, 5 in AS, 7 in AT, 6 in ISA and 14 in ISP. Their recipes contain between 2 and 21 ingredients giving 170 different ingredient descriptions in CI, and 144 attributes in CIP. The lattice obtained from CI (L CI ) contains 138 concepts, the one obtained from CIP (L CIP ) 151.

Starting with question Q1 ("which ingredients appear the most often?"), we study the lattices and in particular the concepts with the biggest extents. Table 2 shows some of the concepts obtained in L CI and the ones in L CIP corresponding to the same ingredients but considering the plant. The extent is presented so that the different pharmacopeias are separated. Concept ({Celery seeds}, {AK114, AT16, AT20, AT72, ISA137, ISA162, ISP100, ISP16, ISP185, ISP186, ISP78, ISP9 }) from L CI reveals that Celery seeds is the ingredient that appears the most often (12 times) in remedies. Then Indian nard appears 9 times, Saffron and Black pepper 7 times. Of course, it is possible to know which ingredients appear most often by computing statistics in the database, but the extension of the concept also shows that Celery seeds appears in 4 out of 5 pharmacopeias. Similarly, lattice L CIP reveals Celery as appearing the most often in remedies. There is however a little change with Oak appearing with 8 occurrences, while Acorn appeared only 6 times in L CI . As can be seen in Table 2, this is due to the use of different parts of oak with different transformations (Acorn in 6 remedies, Acorn shell and Grilled inside peel of acorn shell in remedy AT137, Grilled acorn shell in AT80). There are thus 3 concepts introducing oak parts in L CI . Moreover, among the 6 remedies in the extension of the concept introducing Acorn shell, 2 are from ISA pharmacopeia and none from ISP while they are from the same author. This may be due to the fact that ISP was for pharmacists outside of the hospital who where considered less skillful than those from the hospital, and acorn shell is toxic and thus should be used carefully.

Black pepper AS78, ISA137, ISA261, ISP47, ISP54, ISP6, ISP70

For question Q2 ("which ingredients often appear together?"), association rules are a good starting point. We computed those with a minimal support of 3 remedies and a minimal confidence of 80%. For context CI, we obtained 15 rules. Among these rules, 10 were implication rules. Three of these implication rules are given in Table 3.

One appeared with a support of 7: Celery seeds → Fennel seeds, another one with a support of 6: Opium → Saffron. With a support of 4, we had 2 This project highlights several interesting points about the work on such real data. First, the necessity and richness of adopting an interdisciplinary approach. Indeed, interdisciplinarity is required at each step of the process. Data preparation requires historians, botanists and computer scientists. The questioning on data leading to the analyses realized by computer scientists comes from historians and microbiologists. Finally, the results are discussed with historians and microbiologists, who will also perform experimental tests of interesting hypotheses. The questioning evolves all along the process with the discussions and new results. Second point, FCA appears as particularly suitable for expert needs, and even the simple analyses of lattices and rules presented in this paper have revealed useful insights.

The next steps of the project will aim at enriching the database, both by clarifying ingredients and by integrating other data like quantities for the ingredients, symptoms for which remedies are prescribed, preparation of the remedies, remedies for other kind of diseases, and by adding information on plants such as toxicity. More complex analyses will then be possible.

Currently, the amount of data the historian needs to work is rather small, however if the amount of data increases we may have to search for techniques to facilitate the exploration of the results.

Fig. 2 .

 2 Fig. 2. Example of pages of manuscripts -Left: Dioscorides Pedanius of Anazarbos, Kitab Disqūrīdis (Dioscorides's book), circa 1100-1200, National Library of France. Right: Al-Kindī Folio 98r (photo credit: Aya Sofia, Istanbul, Ms. N°3603)

Table 1 .

 1 List of ingredients of a remedy

	-Armenian borax	-Ginger	-Peeled sweet almonds
	-Kerman cumin	-White pepper	-Rue leaves
	-Parsley	-Scammony	-Dates from Hairūn

Table 2 .

 2 Examples of concepts in LCI and LCIP

	Concepts of LCI	Concepts of LCIP
	Intent	Extent (cardinality)	Intent	Extent (cardinality)
	Celery seeds	AK114,	Celery	AK114,
		AT16, AT20, AT72,		AT16, AT20, AT72,
		ISA137, ISA162,		ISA137, ISA162,
		ISP100, ISP16, ISP185,		ISP100, ISP16, ISP185,
		ISP186, ISP78, ISP9 (12)		ISP186, ISP78, ISP9 (12)
	Indian nard	AT137, AT72, AT80,	Indian nard AT137, AT72, AT80,
		ISA137, ISA162, ISA261,		ISA137, ISA162, ISA261,
		ISP16, ISP27, ISP78 (9)		ISP16, ISP27, ISP78 (9)
	Saffron	AT16,	Saffron	AT16,
		ISP16, ISP186, ISP27,		ISP16, ISP186, ISP27,
		ISP6, ISP70, ISP9 (7)		ISP6, ISP70, ISP9 (7)
	Black pepper	AS78,
		ISA137, ISA261,
		ISP47, ISP54, ISP6,
		ISP70

The work in [START_REF] Connelly | Data mining a medieval medical text reveals patterns in ingredient choice that reflect biological activity against infectious agents[END_REF] is based on the same objective of finding co-occurring ingredients but in a different pharmacopeia and for skin, mouth, or eye infections. It uses community detection in a network of ingredients. FCA is a more direct process that gives a complete view of the combinations of ingredients. Moreover the expert can see the remedies corresponding to each combination and exploit association rules. An FCA-based approach has been used in a similar project focusing on the identification of local plants for addressing sanitary problems in Sub-Saharan Africa [START_REF] Silvie | Prototyping a Knowledge-Based System to Identify Botanical Extracts for Plant Health in Sub-Saharan Africa[END_REF][START_REF] Keip | Effects of Input Data Formalisation in Relational Concept Analysis for a Data Model with a Ternary Relation[END_REF]. In this project, data represent plants or part of plants, and how, and in which country, they are used to treat animal or plant diseases. They are collected from various contemporary texts and concern contemporary practices, unlike our data for which we thus have more uncertainty.


Xavier Dolques

Agnès Braud
email: agnes.braud@unistra.frflorence.leber@engees.unistra.fr

Corinne Grac
email: corinne.grac@engees.unistra.fr

Florence Le Ber

Analyzing water monitoring data with RCA-based approaches

This paper is a short feedback on a collaborative research work by computer scentists and hydroecologists. We have applied Relational Concept Analysis on complex data about running water characteristics (physical, biological and chemical parameters), to answer various questions. Two approaches are presented and discussed: the first one extracts patterns from temporal data, the second one extracts rules from a multi-relational dataset.

Introduction

For almost ten years, we have been working on watercourse monitoring data and, among other approaches, we have exploited Relational Concept Analysis (RCA) [START_REF] Hacene | Relational concept analysis: mining concept lattices from multi-relational data[END_REF]. We have focused on temporal characteristics, that are inherent in monitoring data, but also on relations betweeen the different parts of the system being monitored (biological as well as physical and chemical characteristics of the watercourses). We have developed RCA-based approaches to extract temporal patterns from sequential data, or to extract rules from complex relational data, results being always assessed by domain experts. This paper is a short feedback on this collaborative research work. It is organized as follows. Section 2 describes the datasets, Sect. 3 gives a short explanation on RCA functioning. The approaches used are described in Sect. [START_REF] Dolques | Relational Concept Analysis for Relational Data Exploration[END_REF] and discussed in Sect. 5.

Data characteristics

Data were collected during the ANR Fresqueau project (2011-2015) 1 and organized into a database (60 million records and 20 gigabytes). The study area covers 161,100 km² in the east of France, for the 2000-2010 period. We collected five categories of water data from 21 different sources (mainly public data banks or research projects): 1) river quality data; 2) sampling site data; 3) hydrographic network data; 4) human activities data and 5) driving data.

River quality data are temporal data, and the most complex part of the data as detailed below. They are divided into three sub-categories: physical (e.g., the dimensions and shape of the river bed, characteristics of the substrate), physico-chemical (like pH, nitrate and phosphate, pesticides in the water or sediments) and biological data (i.e. lists of fauna and flora taxa, and metrics on these taxa, e.g., total abundance, diversity, and biological indices) for four groups: macroinvertebrates, diatoms, macrophytes and fishes. Biological indices are defined according to French standards (e.g., the French macroinvertebrate index, IBGN [START_REF]AFNOR: Qualité de l'eau : détermination de l'Indice Biologique Global Normalisé (IBGN)[END_REF] for invertebrates). Taxa are associated to their life traits (like the type of respiration, or the habitat preference).

The other four categories of data are mostly geographic data. Sampling site data give the location of the sites where the river quality data were sampled and their main features. A sampling site is considered as a point. Hydrographic data comprise the different segments of running waters or waterbodies, the size of watersheds, administrative regions, and additional information on the hydrographic network. Human activity data allow to estimate anthropogenic pressures on running waters: land use, impediments to flow, location of discharges. Driving data concern forcing or context variables such as climate (for instance, average atmospheric temperature, precipitations), flows, geology or administrative information. They allow to characterize the environment of the running waters and sampling sites.

Building a database integrating data coming from different sources was not easy. For example, concerning taxa, although the data are based on a standard, their identifiers may evolve over time so that it is difficult to combine data from different years. Besides, geometric data may be imprecise: it may be hard to determine whether a sample site is placed on a watercourse or another one.

Then these data are highly heterogeneous in their values (quantitative continuous or discrete, semi-quantitative or qualitative), temporal variability (frequency and duration of sampling) and topological structure (with a geometry or not). They may be simple measures of a parameter (e.g., a pH value) or a complex index using different metrics (e.g., IBGN) or based on expert knowledge. For instance physico-chemical measures are collected 4 to 6 times per year, while biological samples are done at most once a year, and physical measures even more rarely. Moreover, some sample sites may require stronger monitoring, based on more parameters, in particular pesticides, so that some parameters are less abundant in the database. Let us also notice that depending on the area, taxa may differ.

We have proposed some approaches based on RCA in order to deal with some of these problems when analyzing the data, starting from questions asked by experts.

RCA basics

Relational Concept Analysis [START_REF] Hacene | Relational concept analysis: mining concept lattices from multi-relational data[END_REF] is an extension of Formal Concept Analysis [START_REF] Ganter | Formal Concept Analysis: Mathematical Foundations[END_REF] which considers relational data, formalized within a relational context family (RCF), F = {K, R} where K is a set of object-attribute contexts (each context corresponding to an object category) and R is a set of object-object contexts (relations between objects of various categories).

The principle of RCA consists in integrating object-object relations as new attributes (called relational attributes) in the formal contexts of K thanks to scaling quantifiers, such as the existential (exist) or universal strict (exist+forall ) scaling quantifiers. It produces iteratively a set of concept lattices (one lattice per object category) interconnected through relational information. The concepts in a given lattice group objects according to the shared attributes and to the connections they have with objects of another category. The result is a family of concept lattices where concepts of a lattice are linked to concepts of other lattices. We illustrate this with a small example (from [START_REF] Dolques | Relational Concept Analysis for Relational Data Exploration[END_REF]). Table 1 introduces two object-attribute contexts, one about taxa and their life traits, one about river sites and their physical characteristics, and an object-object context linking taxa to the sites where they have been found.

First, the RCA process builds lattices on the two object-attribute contexts, stations and taxons (Fig. 1). Then the stations context is extended by relational attributes linking stations objects to taxons concepts, based on the taxonPresence context. For example, ∃taxonPresence : Concept 2 means that at least one object of Concept 2 in the taxons lattice is present on each stations object that owns this attribute. The lattice built on this extended context is shown in Fig. 1 (right). In this example, the process stops here since there is only one (one-way) relation linking the two contexts.

Questions and Approaches

For domain experts, the general question is to link physical and physico-chemical data to biological ones, the first ones giving an instantaneous information, the second one giving a long term integrative information. It covers more specific questions, for example, how can values of biological indices be explained by Fig. 1. Lattices of the two object-attribute contexts of Table 1 -initialization (left) and first step (right) of RCA -Only stations lattice changes the preceding successive measures of physico-chemical parameters? What is the relation between the values of physico-chemical or physical parameters and the life traits of taxa living in a site? The first question raises the problem of dealing with temporality and it has been undertaken with a pattern mining approach [START_REF] Fabrègue | Discriminant temporal patterns for linking physico-chemistry and biology in hydro-ecosystem assessment[END_REF] and then by RCA [START_REF] Nica | Exploring temporal data using relational concept analysis -an application to hydroecology[END_REF]. Moreover, working on biological quality requires to overcome the difficulty of analyzing sites with different taxa. This problem has been tackled by working with biological indices in the pattern mining approach, one of their aims being to make biological quality comparable between sites. For the second question, it has been tackled by working on life traits, and the question has been undertaken by a RCA-based rule mining approach [START_REF] Dolques | Performance-friendly rule extraction in large water data-sets with AOC posets and relational concept analysis[END_REF].

Analyzing sequences of physico-chemical and biological measures. In [START_REF] Nica | Exploring temporal data using relational concept analysis -an application to hydroecology[END_REF], we focused on sequences of physico-chemical measures (6 measures per year) ending with biological samples (one per year). The selection and preprocessing of the data were done under the supervision of domain experts. Physico-chemical measures were discretized into qualitative scales. Biological samples were synthetized into qualitative indices (five levels from red to blue, corresponding to quality). The question was to explain the biological quality wrt the physico-chemical quality assessed during the last months. Sequences were encoded into an RCF, according to the schema shown in Fig. 2: each rectangle corresponds to an objectattribute context, while the arrows correspond to object-object contexts.

Then data are processed as follows. Firstly, RCA is applied to the RCF in order to obtain a family of concept lattices. Secondly, the interrelated concepts from the RCA result, are navigated to extract a set of sequential patterns for each concept of the BioSamples lattice. A pattern is actually a directed graph, where the various paths represent sequences of parameter values preceding a biological sample. Iceberg lattices [START_REF] Stumme | Computing iceberg concept lattices with Titanic[END_REF] have been used to select patterns with the highest support (i.e. represented in many sample sites). Figure 3 shows an example of an extracted pattern: it summarizes a set of sequences of physico-chemical Fig. 2. Modeling sequences of physico-chemical and biological samples [START_REF] Nica | Exploring temporal data using relational concept analysis -an application to hydroecology[END_REF] Fig. 3. An example of a sequential pattern parameter values measured before a biological index (IBGN) with red value. The pattern is read as follows: in all sequences, an orange value for AZOT (nitrogen except nitrate) and a red value for PEST (pesticides) have been measured before a green value for NITR (nitrate) and a red value for AZOT occurring at the same moment. Also, a red value for PHOS (phosphorous) has been measured after the red value for PEST. According to expert domains, this pattern can be interpreted as follows: the quality values of physico-chemical parameters are consistent with the biological value, macroinvertebrates being sensitive to high rates of pesticides and ammonium.

Extracting rules linking taxa life traits and site physical and physico-chemical characteristics. In [START_REF] Dolques | Performance-friendly rule extraction in large water data-sets with AOC posets and relational concept analysis[END_REF], we tried to connect physical characteristics of sample sites, physico-chemical parameters, and the traits of taxa living in sample sites. We therefore developed an RCA-based method using AOC-posets to deal with large datasets. This approach allowed to provide a reasonable number of concepts and to extract meaningful implication rules (association rules whose confidence is 1). In order to offer more flexibility on the quantification of taxa on sample sites than with the existing exist and forall scaling operators, new scaling operators were defined and experimented, providing different semantics for the rules. Data were modeled as shown in Fig. 4. Detailed temporal information (physico-chemical parameters) was aggregated into annual values and then discretized into five levels. Taxa numbers were also discretized (taxa weakly to highly represented). An example of rule is given below, where a percent-quantifier is used [START_REF] Dolques | Performance-friendly rule extraction in large water data-sets with AOC posets and relational concept analysis[END_REF]: such a quantifier allows to build relational attributes with for example, the form ∃∀ >n% r(C); an object owning this attribute is linked to at least n% of C objects

Physico-chemical parameters Life Traits

Stream Sites

Macroinvertebrates

Level of Physicochemical parameter population of macro-invertebrates life traits of macro-invertebrates Fig. 4. Modeling the links between physico-chemical parameters and the life traits of taxa (macro-invertebrates) living in sample sites [START_REF] Dolques | Performance-friendly rule extraction in large water data-sets with AOC posets and relational concept analysis[END_REF] with the r relation [START_REF] Braud | Generalization effect of quantifiers in a classification based on relational concept analysis[END_REF]. S >50% high population(∃strong affinity(slow current)) → ∃bad state(hydrology)

This rule means that a sample site having more than half of its highly represented taxons preferring slow current, has a bad hydrological state. According to the experts, it corresponds to small disconnected phreatic streams, with almost no current, that are specific of the Alsace plain.

Discussion and Conclusion

In the following we describe some problems we have faced with the data and novelties that stemmed from these works. Note that all these experiments led to new proposals to make the use of RCA easier [START_REF] Ouzerdine | Adjusting the exploration flow in Relational Concept Analysis -An experience on a watercourse quality dataset[END_REF]. First of all, ecosystems are very complex entities, influenced by many parameters. We have tried to integrate many of these parameters in our database, but handling all of them in a single analysis is not really possible, and even for experts to fully understand such results involving many information types. We have thus worked on subproblems, handling a smaller but consistent part of parameters, based on an expert question. Also, data like biological indices already integrate several parameters in one measure. Their definition has been proposed by groups of specialists and it is pertinent to use them when studying water quality, in particular to overcome the difference of taxa between areas, but at the same time they are not raw data and represent a kind of bias.

Regarding the pattern mining approach, given the sequence set of biological and physico-chemical samples, we found hierarchies of multilevel cpo-patterns that summarize the impact of physico-chemistry to biology. The hierarchical representation allows to enhance the analysis of the extracted set of sequential patterns. Nevertheless, there are too many patterns, and relevant interestingness measures must be chosen. Another problem is due to the irregular distribution of biological index values, leading to more or less frequent, complex, and informative patterns for the different values. Regarding the rule mining approach: using AOC-posets causes loss of concepts, and some interesting rules will thus not be found. Other techniques should be explored for processing the complexity of this relational dataset.

With respect to classical approaches in the hydroecological domain, our approaches are original since most work are based on statistical analysis or supervised machine learning methods (see e.g., [START_REF] Goethals | Applications of artificial neural networks predicting macroinvertebrates in freshwaters[END_REF][START_REF] Villeneuve | Can we predict biological condition of stream ecosystems? a multi-stressors approach linking three biological indices to physico-chemistry, hydromorphology and land use[END_REF]).

Table 1 .

 1 Relational Context Family example.

		object-attribute contexts	object-object contexts
	taxons ≤1 year > 1 year Athericidae x Bithynia x x Boreobdella x	Atheri-Bithy-Boreob--Presence -cidae -nia -della taxon-BREI0001 x BRUN001 x x FECH001 x x
	stations	small watercourse watercourse stream fresh, running phreatic
	BREI0001	x	x
	BRUN001		x
	FECH001		x

http://dataqual.engees.unistra.fr/fresqueau_presentation_gb