dataesr/scientific-paragraphs-categorization huggingface dataset:
As for the experimental data analysis in ref. 18  , the electrode tortuosity is determined from a least-mean square fit of the simulated impedance response to the TLM model using Eq. 4. Practically, the fminsearch function in MATLAB is used as the non-linear fitting function to minimize the objective functions shown below: F ¼ X n¼1 ð ZÃ ElÀsim À ZÃ El Þ 2 ZÃ ElÀsim p ; (8) where ZÃ ElÀsim is the normalized-simulated impedance given by eSCM from TauFactor; ZÃ El is the normalized-fitting impedance given by Eq. 4, p is a weighing factor  20. However, it should be noted that the value of τ e can be extracted from just the values of ZÃ El at ω ! 0 and ω ! 1.
DATA AVAILABILITY The datasets generated and analyzed during the current study are available from the corresponding author on reasonable request. For eRDM, Ĉ is the complex concentration of the diffusing species. For eSCM, there is a domain in between the two electrodes that represents the porous separator. Since there is no electrochemical reaction occurring in the system, Φ1 and Φ2 are simply the electronconducting phase (solid) and ionic-conducting phase (liquid) electric potentials respectively; ω is the radial frequency of the boundary stimulation; j is the imaginary unit; c dl is the interfacial double layer capacitance per unit microstructural active surface area. For both methods, Ω is the pore network domain in the system (in both electrodes and separator); n is the outward pointing unit normal to each voxel face.
ACKNOWLEDGEMENTS The authors would like to acknowledge  French National Association for Research and Technology (ANRT)  for partially supporting the funding of this research work. T. -T. N. was supported by  Renault Group  for his PhD Project. Authors would like to thank  Dr Alexis Rucci  for the help to generate the synthetic 3D microstructures used in this work, as well as  Dr Nina Meddings  and  Steve Kench  for their contributions to the discussion surrounding this work. S. J. C. was supported by the  EPSRC Faraday Institution Multi-Scale   Modeling  project (https://faraday. ac. uk/; EP/S003053/1 , grant number  FIRG003 ).
In Section 3, a declarative language for the composition of services is proposed, which consists of the syntax definition, the specification of the operational semantics and its verification. In Section 4, a verification framework of the proposed language is presented based on the PROMELA language and the SPIN tool. Section 5 describes a validation framework that presents a prototype for evaluation of our approach, this prototype consists of an editor (DSL) for the proposed language, model transformation rules to Promela/SPIN and an execution engine. Section 6 highlights the strengths of our work compared to the existing in the field of the composition of services. Section 7 concludes the work and presents some future directions.
Considerable efforts have been invested in providing the rule engines to support flexible and adaptable service compositions. In  [4, 25] , a service-oriented rule engine was introduced, allowing access to business rules by invoking the RuleML engines. [23]  introduces an alternative service execution environment in which rules can be defined and then injected into WSDL specifications, after which they can be deployed to a service executor. Reference  [26]  defines in the form of clauses if. then, the structure, the data and the constraint rules under the basis of elements such as Message, Event, Condition, Provider, Flow, Role, and Activity. This is a first step for the flexible composite service specification but it is presented as an extension of the BPEL notations. To separate the business rules from the BPEL code, Charfi et al.
Translate Service Specification to Promela Language (Translation Template) The Promela language is an abstract specification language of a system. It models the synchronization and coordination of processes. Our choice was based on Promela, because it allows in a message to send a channel a bit like in the pi-calculus  [32, 33]. A message contains a dataset as well as a port on which the remote process will transmit its response. Table  1  presents the correspondences between pi-calculus concepts and Promela code. where α is the public port of user space(peer) containing s in the service specification, p is the private port contained in the request and used like the return channel. The Promela code translates the receipt of s, x and p on α, the choice of the appropriate implementation according to the guard and the input parameters.
Space Promela Code space 1 s( x) y → s 1 ( x 1 ) y 1 [α 1 ] s 2 ( x 2 ) y 2 [α 2 ] s 3 ( x 3 ) y 3 s 3 ( x) y → Proctype space1(){ begin: α?s, x, p if :: (s == id) → α 1 !id 1 , x 1 , p 1 ; p 1 ?y 1 α 2 !id 2 , x 2 , p 2 ; p 2 ?y 2 y 3 //de f iney 3 p!y goto begin; fi } space 2 s 1 ( x) y → Proctype space2(){ begin: α 1 ?s, x, p if :: (s == id1) → p!y 1 goto begin; fi } space 3 s 2 ( x) y → Proctype space3(){ begin: α 2 ?s, x, p if :: (s == id2) → p!y 2 goto begin; fi }.
The Transformation and Semantic Verification Engine The transformation of Table  1  has been automated using the ATL language  [36]. The source is the Abstract Syntax Tree in Figure  7  and the target is the Promela meta-model presented in document  [37]. The main transformation rules are: • guard2Condition rule: transforms the guards associated with the service into a condition for IF statement of promela. • service2ChannelAndSimpleStatement rule: transforms simple services into channel-type variables and simple statement in a promela proctype process. • service2ChannelAndCompositeStatement rule: transforms composite services into channel-type variable and composite statement such as the If statement • role2Process rule: transforms a role (peer) into a promela process. • system2Model rule: transforms the system composed of the set of roles into a promela model composed of all the processes.
Modelling in the Environment and Verification The current version of the editor is textual. It offers the possibility of editing and checking the syntax of the services. Figure  11  shows the edition of the rules associated with the example of the previous section. Each role is represented, in each role we have the associated services. For example in the role Employee we have the submitDemand service. Once the modeling is completed, the code is verified and in case of success, the transformation engine translate it into Promela for semantic verification. Then, the editor generates the XML model which is loaded in the execution engine. In summary • each peer contains the editor and all the service specification of the system because the verification is done over the entire specification; • on a peer, the operational services generated are only those of the roles; • an update of the service specification is reflected in the different peer after the verification has been successful.
These requirements disqualify a number of popular methods which require that the number of clusters be known (e. g. , C-means) or which rely on a random initialization stage (e. g. , fuzzy C-means). In the literature, few methods can satisfy all the above requirements. Among them, DBSCAN  [6]  is a density-based method requiring two parameters, i. e. , the size of a neighborhood and the minimum number of samples lying in it. OPTICS  [7]  was developed to improve DBSCAN for the case of clusters with unbalanced densities. It has the same parameters as DBSCAN, and another distance threshold (the accessibility distance) which allows one to tackle the imbalance. DBSCAN and OPTICS can only be applied to datasets with limited numbers of dimensions  [23]. The K-nearest neighbor (KNN) paradigm has been proven very useful to tackle clustering problems.
Clustering approaches based on nearest neighbor graphs are very attractive when dealing with large datasets. Nevertheless, it is noteworthy that KNN search (i) relies on the distance/similarity metric used, which may have a counter-intuitive behavior in high-dimensional spaces  [28, 29] ; (ii) has a quadratic complexity in the number of samples for an exhaustive search (brute force), though approximate but faster methods exist  [30, 31]. Moreover, these methods are able to work with just the pairwise distances between samples, i. e. , without the data itself. In this work, we propose several improvements and extensions to baseline nearest-neighbor density-based clustering algorithms. While we focus specifically on hyperspectral image analysis, the proposed framework is applicable to any type of data.
In Section 5, we consider the application of these baseline methods to pixel clustering in HSIs, and introduce the two other improvements: the KNN graph regularization to facilitate cluster unveiling in high dimensions, and the introduction of a spatial context into the core labeling rules of each density-based method. Section 6 describes experiments to assess the improvements of the baseline methods and to compare their clustering properties on synthetic datasets. Then, Section 7 proposes an experimental study, using real datasets, of the four methods adapted to the context of hyperspectral images; this study includes a comparison with other state-of-the-art clustering methods. Lastly, we draw our conclusions in Section 8.
Notation Let X = {x i } i=1,. ,N be a set of samples, where x i ∈ R n is an element (sample) of the dataset. Let us define d as a distance metric between any two samples in X , and d ij = d(x i , x j ). Let K be the number of nearest neighbors (NNs); then N K (x i ) is the set of KNNs of x i ; i. e. , N K ( x i ) ⊂ X such that |N K (x i )| = K and ∀x j ∈ X \N K (x i ), d ij ≥ max x l ∈N K (x i ) d il. For the time being K is assumed constant ∀x i. The directed KNN graph G = (X , N K (X ), {d(X , N K (X ))}) can be rewritten as a pair of N × K arrays (D, J) where D is the array of distances (in ascending order) between each sample and its KNNs, and J = {j i } i=1,. ,N , j i = j 1 i , j 2 i ,. , j K i is the array of corresponding indices of each sample's KNNs. Like in  [24]  and  [11] , the methods selected in the present work rely on the computation of a local (point-wise) density function ρ(x i ) = ρ i , 1 ≤ i ≤ N.
MODESEEK In its original implementation  [10] , MODESEEK first estimates the local density at each sample based on its KNNs, and selects the neighbor with the highest local density. The label of that neighbor is then given to the sample and this is done iteratively until no more label changing occurs. One important property of this algorithm is that samples having themselves as neighbors (in the above sense) are reported as cluster exemplars. MODESEEK is a very simple, fast and quite attractive clustering method, which does not require the user to specify the number of clusters. MODESEEK is publicly available within the PRTools MATLAB package (prtools. org). Note that a similar, but recursive approach, called KNN graph clustering (KGC) was proposed in  [33].
KNNCLUST In 2006, Tran et al. introduced KNNCLUST  [24] , an iterative version of the supervised KNN algorithm. In KNNCLUST, all the samples of a dataset are assigned a unique label at initialization. Then the algorithm successively relabels each sample based on a KNN-kernel Bayes decision rule; i. e. , the class conditional probability p(x i |c) is replaced by max c ∈C p(x i |c ) ∀x i ∈ X. By doing so, KNNCLUST forms clusters in order to maximize a total class-conditional density function for all samples. KNNCLUST has also the advantage with respect to other popular clustering techniques of automatically estimating the number of clusters. Similarly to other clustering methods, KNNCLUST is iterative; it is stopped when no more label changes occur. Its main drawback is the computational load of the first iterations, due to the high number of putative labels to handle.
Implementation Choices Besides the parameter K used to construct the NN graph, two choices are crucial for density-based methods in general: the distance d and the density function ρ. In terms of the former, several distances have been proposed to best apprehend the data structure, from the Minkowski L p norm with p = 1, p = 2 or even p < 1 for high dimensional datasets  [42] , to data-driven distances (e. g. , Mahalanobis distance  [43] , geodesic distance  [44, 45]  or kernel-based distance  [46] ). In essence, the nearest-neighbor density-based methods discussed in the present work are flexible with regard to this choice and can account for specific distance metrics. All the experiments described below involve the Euclidean norm. The issue of finding an appropriate density model is more important and deserves attention.
This is motivated by the fact that the local density ρ(x i ) can be estimated only from N K (x i ), and does not need to depend on the full pairwise distance matrix; limiting the "scope" of each sample to its KNNs is therefore expected to better capture the structure of the data under study  [34] , while still allowing the use of different kernel functions for density estimation. Moreover, the reduction in storage can be significant for large datasets, decreasing from O(N(N -1)/2) to O(KN). The second issue related to the decision graph (or more generally the decision rule that one sample is or is not a cluster exemplar), can be easily by-passed owing to a simple observation. Actually, the first stage of DPC consists of finding the unique neighbor of each sample x i having the minimum distance among its neighbors of higher density: NN(x i ) = arg min j∈N K (x i ):ρ j >ρ i d ij ∀x i ∈ X.
These modifications yield a new method, called M-KNN-DPC in the following, which can be compared with the three other density-based methods strictly under the same conditions. The pseudo-code of M-KNN-DPC is given in Algorithm 1. Compared to similar KNN DPC methods which are non iterative, the iterative feature of M-KNN-DPC is in fact not too critical since convergence is generally ensured within a few iterations, similarly to MODESEEK. In fact, as pointed out in  [40] , the above simplification of the labeling rule actually makes M-KNN-DPC very similar to MODESEEK: both methods require seeking a unique NN for each sample and proceed by iterative hill-climbing. However, in MODESEEK, the retained NN of an sample is, among its KNNs, the one with the highest density, whereas in M-KNN-DPC, the retained NN is the closest in distance among all NNs of higher density.
Clustering Experiments with the Baseline Methods on Synthetic Datasets In order to verify the quality of clustering results with the improved baseline methods described in Section 4, we set up a few experiments with synthetic datasets (https://cs. uef. fi/sipu/datasets/). After presenting the clustering performance indices used in the present work, in the first experiment, we wished to assess the improvement of M-KNNCLUST-WM over KNNCLUST-WM. In the second one, we compared the behavior of the four baseline methods on more challenging clustering problems.
Cluster Validation Indices All the datasets used in our work include a ground truth, which enables one to compute external classification accuracy indices. Some of these indices are derived from a confusion matrix obtained after optimal pairing of cluster labels with the actual ground truth classes. The cluster-to-class mapping is based on the Munkres assignment algorithm  [56]. Once the optimal assignment is obtained, a new confusion matrix is obtained which is close to diagonal. From there, standard classification indices can be derived: the overall accuracy (OA, i. e. , the normalized trace of the confusion matrix), the average accuracy (AA, i. e. , the average of per-class accuracies)  [57]  and Cohen's kappa index of agreement (κ)  [58]. These indices are widely used in the remote sensing community.
Comparison of KNNCLUST Variants In this experiment, we wished to verify the improvement of M-KNNCLUST-WM over the original KNNCLUST, its weighted mode variant KNNCLUST-WM and M-KNNCLUST, which is the original KNNCLUST algorithm modified according to Section 4. 2. The objective was to compare their results in terms of AA as a function of the number of NNs K and to show their ability to provide consistent clustering results, in terms of identification of the correct number of clusters and in clustering accuracy. For this we used the S4 dataset  [63]  (see Figure  3 ), which has 5000 samples randomly distributed issued from 15 overlapping Gaussian 2D distributions with various means and covariance matrices. Both features were first normalized in the [0, 1] range. Figure  4  reports the number of clusters found as a function of the number of NNs K, and the average accuracy (AA) also versus K.
This is due to the fact that a smaller number of clusters was found in this situation. Indeed, primarily accounting for too-distant NNs to label points with high density is likely to result in biased labeling decisions and the merging of samples issued from close clusters in a single larger one. However, since our objective is to achieve the best clustering performances at reduced algorithm complexity, this has no practical relevance. In this sense, the above example seems to indicate that M-KNNCLUST and M-KNNCLUST-WM must be preferred over the original method. Figure  4  also shows the improvement of the weighted mode rule (KNNCLUST-WM and M-KNNCLUST-WM) against the classical mode decision rule (KNNCLUST and M-KNNCLUST). Similar conclusions were obtained after analyzing the S1, S2 and S3 datasets (available on the same website), which are much easier to partition due to smaller overlaps between the generating Gaussian distributions.
Comparison of the Baseline Clustering Methods To illustrate the behavior of the four baseline clustering methods described above, we have used the synthetic datasets Worms-2D, with n = 2, and Worms-64D with n = 64  [48]. We have selected these datasets because they exhibit curve-shaped clusters with a large amount of overlap or even non-separable data, which represents a very challenging clustering task. Figure  3  displays the Worms-2D dataset, with N = 105,600 points distributed in C true = 35 clusters. Figure  5  shows the evolution of the average accuracy (AA) and the number of clusters C as a function of K. The AA values are lower than in the previous example due to the difficulty to cluster this dataset. Still, a tiny plateau of C can be observed for K ∈ [550, 650], giving a number of clusters slightly superior to the actual one.
From these figures, one can observe close behaviors between M-KNNCLUST-WM and GWENN-WM on one hand, and between MODESEEK and M-KNN-DPC on the other hand. M-KNNCLUST-WM and GWENN-WM provide a few less clusters than MODESEEK and M-KNN-DPC, thereby yielding higher performance for lower K. For K > 700, M-KNN-DPC provides slightly higher AA values. The results for the Worms-64D dataset, shown in Figure  6 , show that the AA is stable for a very wide range of K (from 20 to 1000 for M-KNNCLUST-WM and GWENN-WM). Over this range, the correct number of 25 clusters was identified. Here again, M-KNNCLUST-WM and GWENN-WM outperformed the two other methods for all K. It is interesting to notice that MODESEEK outperformed M-KNN-DPC for a large range of K. This illustrates the fact that, for high dimensional data, the choice of the closest NN with higher density can be less relevant than the one of the NN with highest density used in MODESEEK.
• The best overall kappa index (κ = 0. 794) was obtained for M-KNNCLUST-MNN-SP with K = 900, providing C = 17 clusters, closely followed by κ = 0. 792 for GWENN-WM-MNN-SP with same K, giving C = 18 clusters. Notice that the running time between those two methods is very different, with 2338 s for M-KNNCLUST-MNN-SP-mostly induced by the high number of labels at initialization-scaling down to 22 s for GWENN-WM-MNN-SP. These times exclude the computation of the original KNN graph, which is about 13 s for K = 1000 using MATLAB 2016 on a DELL 7810 Precision Tower (20-core, 32GB RAM), and the MNN procedure (78 s).
The latter three are useful to assess the consistency of the results; indeed, high values of OA, AA or kappa after cluster assignment are not sufficient to measure high quality clustering, especially in the case where the number of GT classes is greater than the number of found clusters. Again, the nearest-neighbor density-based methods show superior performance to the popular FCM in all cases. The situation is less clear for DBSCAN which seems to provide better accuracy indices for the KSC and Massey University HSIs. Actually, for the KSC dataset, the clustering results for DBSCAN were calculated only over 25% of the number of pixels (so-called "core points"), the remainder being classified as outliers by DBSCAN. For the Massey University HSI, the number of outliers provided by DBSCAN exceeded 96% of the number of pixels.
Thus, the best OA results provided by DBSCAN must be considered with caution. However, the high CVR indices given by DBSCAN for these two HSIs can help with detecting this kind of anomalous situation. Many of these best kappa results come with an underestimation by a few units of the actual number of classes present in the GT. However, on average the number of clusters is better approximated by applying the MNN graph regularization prior to density-based clustering. This was particularly observed for the Massey University HSI which has roughly twice the dimensionality of the other ones. To some extent, these results on various hyperspectral datasets are in agreement with the preceding observations made in the above experiments, as shown by the good performances of the proposed approaches versus state-of-the-art clustering methods, and the improvement brought by the MNN graph pruning procedure.
Second, we proposed using two additional procedures to help with tackling the problem of pixel partitioning in hyperspectral images. The first relies on a KNN graph pruning method based on mutual nearest neighbors (MNN), which can facilitate the discovery of clusters in high dimensional datasets. This procedure is applied prior to the baseline clustering methods. The second one aims to introduce a spatial context in the core of each clustering method, in order to account for the correlation between adjacent pixels in hyperspectral images. The improved KNNCLUST-WM method and the set of baseline nearest-neighbor density-based methods MODESEEK, M-KNN-DPC, GWENN-WM and M-KNNCLUST-WM were then tested and compared on synthetic datasets, showing their ability to adequately cluster points issued from highly overlapping conditional densities in low and high dimensions.
Additionally, M-KNN-DPC generally performs better than MODESEEK in the baseline and MNN improved versions; this is, however, no longer true for their spatial versions, due to the difference pointed out between their respective core labeling rules, and MODESEEK should then be preferred to M-KNN-DPC. From a more general viewpoint, unlike other methods like DBSCAN and FSAP which are sensitive to parameter tuning, the proposed approaches require only one parameter, i. e. , the number of nearest neighbors K. In conclusion, owing to their attractive features, the nearest-neighbor density-based methods investigated in this paper do constitute a viable alternative to traditional clustering methods in the context of hyperspectral images: they are able to closely predict the number of clusters present in a dataset with minimal parametrization; they are strictly deterministic and therefore do not rely on a random initialization stage.