Marianne Huchard
email: marianne.huchard@lirmm.fr

Ines Ammar

Ahmad Bedja Boana

Jessie Carbonnel

Theo Chartier

Franz Fallavier

Julie Ly

Vu-Hao Alias

Daniel Nguyen

Florian Pinier

Ralf Saenen

Sebastien Villon

Class model extraction from procedural code: Confronting a few ideas from the 2000's against the reality of an industrial system

Keywords: Software reengineering, software migration, class model extraction, object identification

In this extended abstract, we report an ongoing experience conducted during a Master project on the migration of two industrial software systems. The project was proposed by a major IT service company (not cited here for confidentiality reasons) which would like to investigate a migration processing chain, in order to renovate legacy software composed of man-machine interfaces, databases and procedural source code. The aim of the renovation is to migrate to the object-oriented paradigm and generate new source code. Due to the limited time that the Master students had in their curriculum for this project, we restricted the study to the extraction of a class model. A processing chain was proposed and a few heuristics, taken in the literature, have been tested, with no really conclusive results. We report here the current status of the project in order to get feedback and new ideas to build for the future.

Context and problematics

Software renovation still remains a costly and time-consuming process for IT service companies, that can be viewed as a waste of resource, compared to the development of new software. Nevertheless, if timely and effective measures are not taken to regularly update the design, the source code, the documentation and all related artifacts, it may arrive the day where the software can no longer be understood by human, or compiled by the new compilers, or even ran on the new servers. The challenge is to maintain and migrate with a low cost the legacy software, before real problems arise. In this extended abstract, we report an experience, in which we designed a processing chain for renovating a particular legacy software.

The two studied legacy software systems are part of a larger software suite, but can be analyzed independently. They are composed of code describing man/machine interface (HTML, VBScript/ASP, Javascript), Visual Basic Code (VB6), SQL procedures (SQL Server 2000) and two databases. The source code (VB and SQL) is composed of 909 functions, 30437 LOC for the largest software and 346 functions, 26042 LOC for the smallest software. One database contains 45 tables, while the other contains 103 tables.

Due to the limited time that the Master students had in their curriculum for this project, we restricted the study to the extraction of a class model. The students were divided in three groups, but they collaborated throughout the project. In the next sections, we develop the proposed approach and its current results (Section 2), then we conclude in Section 3.

The renovation approach

The global process The current study is concerned with specific programming languages, but we aim at proposing a generic processing chain which could be applied to other procedural and database programming languages (input) and other object-oriented language (output) of the same company. We decided to follow a classical processing chain such as that which is presented in Fig. 1, organized around an intermediate model. Fig. 2 shows the current instantiated process that we follow. We describe in next paragraphs the tested tools and methods of each step.

Intermediate model The choice of the intermediate model was partly guided by simplicity reasons (avoiding complex UML meta-model as proposed in UML2tools

for example) and by the needs of the envisaged heuristics (study data access and function calls to determine connected sets of data and functions). In order to represent the source artifacts and the class model, we chose the FAMIX metamodel and its MSE serialization format [START_REF] Ducasse | Mse and famix 3.0 : an interexchange format and source code model family[END_REF]. For the representation of the output class model, this was quite natural, because of its language independency and its ability to describe the static structure of object-oriented software: main used We met a problem for the representation of database elements. FAMIX being extensible, we thought that it would be the right approach to add meta-classes for representing data table and columns. Due to the delay, we provisionally abandon this track, but it remains a future work. Then, we used meta-classes Class and Attribute to respectively represent tables and columns, even if we don't consider the solution satisfactory. In this step, we found a difficulty in establishing a common strategy for the three student groups for the use of FAMIX, because initially, the groups were using different attributes of the meta-classes for representing the same information (e.g. using signature in Invocation meta-class, versus candidates).

Source code analysis Man-machine interface source code was partially manually analyzed, but in a first approach, we decided to abandon the track because of the little domain knowledge that this code seemed (at first sight) expose. This will be study into more details in future work. At the beginning, we would like to analyze VB code using Microsoft Visual studio, but it reveals to be impossible because of the old version of VB code. This again shows the importance to regularly update software source code. An evaluation version of VBdepend1 was tested and allowed us to retrieve functions, invocations and parameters. As we were interested in finding the VB functions and the SQL functions that manipulated the database they called, some specific code has been developed because in the source code, this is done via a same function that takes as parameters the called SQL function and its parameters. SQL code has been analyzed with GSP2 to extract which SQL procedure has which kind of access to which tables (and which columns of the tables). We met a few problems in using the two tools, but more than 99% of the VB functions and more than 91% of the SQL procedures were correctly analyzed. MSE entities coming from SQL analysis and from VB analysis are merged to give a unique MSE file for the remainder of the project.

Class model heuristics extraction Each student group had three or four papers about "object identification" (the term used in 2000's for talking about class model extraction) and they had to choose one for implementation [9, 2-4, 7, 1, 6, 8, 10]. The three methods of [START_REF] Van Deursen | Identifying objects using cluster and concept analysis[END_REF][START_REF] Glavas | Solving the class responsibility assignment problem using metaheuristic approach[END_REF][START_REF] Sahraoui | A concept formation based approach to object identification in procedural code[END_REF] have been tried. The approach of [START_REF] Van Deursen | Identifying objects using cluster and concept analysis[END_REF] is an ad hoc method based on a hierarchical clustering technique that we had to entirely implement. The clusters are composed of columns "similarly accessed" by functions. In [START_REF] Glavas | Solving the class responsibility assignment problem using metaheuristic approach[END_REF], they compare several meta-heuristics and we chose among them the simulated annealing method. The framework AIMA3 has been used for the tests. It requires to implement a few Java interfaces by accessing the MSE files and computing a neighbor solution as well as cohesion and coupling metrics (on which an objective function is based) on the current solution (a set of candidate classes composed of data and functions). The approach of [START_REF] Sahraoui | A concept formation based approach to object identification in procedural code[END_REF] uses Formal Concept Analysis to form concepts composed of functions and their accessed columns. After concept lattice building, an ad hoc algorithm merges some concepts and assigns the functions to the classes.

VerveineJ4 is used in all implementations for finding the entities that are taken as input of heuristics and MSE files are generated that contain the output class models.

Current results

The hierarchical clustering based implementation allows us to find different size solutions, depending the chosen level for stopping the clustering. It produces classes which mainly correspond to connected groups of tables of the initial databases, thus with an explainable logics. Its current issue concerns the methods assignment (only functions that access to a single class are assigned to that class), thus a complementary approach has to be proposed. The metrics to be used in simulated annealing approach and their respective weights were not sufficiently described, and for the moment we are not able to obtain the same results as those obtained by the author on the example given in the paper. The FCA approach produces many classes (compared to the database table number). Some obtained classes have a coherence for people of the company, but some seem to be incidental groups of attributes and methods, technically explained by accesses and invocations, but with no clear meaning. Besides, even if the concept lattice guarantees maximal factorization with no redundancies, the applied post-treatments generate a huge attribute and method duplication.

Conclusion

In this extended abstract, we reported an ongoing work that aims at extracting a class model from procedural code, relying on work mostly done in the 2000s. Some difficulties were met to apply the methods: some are dedicated to specific contexts (as COBOL code, or C code) and they are not so generic; some parameters of the methods are not very precisely described, leaving space for interpretation. As we also think that structural aspects, including data access and function invocation are not sufficient to determine meaningful classes, we plan to investigate software identifier analysis. Besides, we expect that man-machine interface code or execution trace could be an help to extract connected functionalities. Last, as these techniques have to be understood as a technical assistance for expert engineers, we would like to study how the user should intervene in the process.

Fig. 1 .

 1 Fig. 1. The generic process

Fig. 2 .

 2 Fig. 2. The current process

http://www.vbdepend.com

http://www.sqlparser.com

http://code.google.com/p/aima-java/

http://www.moosetechnology.org/tools/verveinej


T Djouama
email: torkia_djouama@yahoo.fr

M Poulain

B Bureau

R Lebullenger

STRUCTURAL INVESTIGATION OF FLUOROPHOSPHATE GLASSES BY 19 F, 31 P MAS-NMR AND IR SPECTROSCOPY

Keywords: Fluorophosphate, glass, vibrational spectroscopy, NMR

published or not. The documents may come

Structural investigation of fluorophosphate glasses by 19F, 31P MAS-NMR and IR spectroscopy

Torkia Djouama, Marcel Poulain, Bruno

Introduction

Fluorophosphate glasses have been extensively studied since more than 50 years. One must quote the pioneering work of K. H. Sun in the late forties [START_REF] Sun | fluorophosphate glass[END_REF][START_REF] Sun | Fluorophosphate Glass[END_REF]. Since then they have been the subject of numerous papers, especially from German and Russian researchers [START_REF] Veksler | [END_REF][4][START_REF] Leitz | Fluorophosphate optical glass[END_REF][START_REF] Stokowsky | Laser Glass[END_REF][START_REF] Sandwick | Production of high homogenous fluorophosphate laser glass[END_REF][START_REF] Videau | [END_REF][9]. In addition to rather low temperature processing, they offer low non linear refractive index [START_REF] Stokowsky | Laser Glass[END_REF][START_REF] Sandwick | Production of high homogenous fluorophosphate laser glass[END_REF] and high UV transmission [9]. Many reported glasses contain aluminium, calcium, strontium or barium polyphosphate as vitrifying compounds Phosphate glasses based on sodium polyphosphate NaPO3 are often hygroscopic, which limits practical use. However the incorporation of fluorides increases chemical durability as this was observed in the NaPO3-BaF2-MFn ternary systems (M = Mg,Mn,Zn,Fe,Cr,Ga) [10]. In a general way, sodium fluorophosphate glasses are easy to prepare, stable versus devitrification and withstand humid atmosphere [11]. Glass formation has been reported in other multicomponent fluorophosphate glasses [START_REF] Stokowsky | Laser Glass[END_REF]. More recently, glasses in the system NaPO3-ZnF2-MnF2 have been described [12]. Fluorophosphate glasses usually exhibit low refractive index, small optical non linearity [START_REF] Leitz | Fluorophosphate optical glass[END_REF][START_REF] Stokowsky | Laser Glass[END_REF][START_REF] Sandwick | Production of high homogenous fluorophosphate laser glass[END_REF] and good UV transmission [9].

Structural studies have been implemented by vibrational spectroscopy and solid NMR spectroscopy. Infrared (IR) spectroscopy is currently used to investigate glass structure [START_REF] Wong | Glass Structure by Spectroscopy[END_REF][START_REF] Karmakar | [END_REF][15]. Indeed, the position of the absorption bands depends on local symmetry as vibration modes are different in tetrahedra and octahedra. In addition, strength constants are also different for bridging and non bridging anions.

The 31 P NMR provides accurate information about the way PO4 tetrahedra are connected and the number of non-bridging oxygens. Polyphosphate glasses with the generic formula M(PO3)n contain long chains made from corner-sharing PO4 tetrahedra. These tetrahedra are referred to as Q 2 , meaning that they contain two non-bridging oxygens. Incorporation of additional metallic oxides leads to the shortening of these chains and the formation of Q 1 tetrahedra. Structure is described as an assembly of phosphate chains in which cations are randomly inserted. The role of fluorine in fluorophosphate glasses is less clearly defined, as it may form isolated F -anions surrounding cations or PO3F tetrahedra. In this case fluorine is expected to be non-bridging.

While very numerous fluoride glasses have been investigated so far [10][11][12][START_REF] Wong | Glass Structure by Spectroscopy[END_REF][START_REF] Karmakar | [END_REF][15][START_REF] Poulain | Fluoride glasses: properties, technology and applicationsIn "Photonic Glasses and Glass Ceramics[END_REF], heavy metal oxyfluoride glasses are less common, insofar as fluoride association with classical oxide glass formers-oxides of B, Si, P, Ge-leads to severe losses of volatile compounds. Recent studies on fluoride glasses [START_REF] Djouama | [END_REF] containing MnF2 confirm that manganese acts as a glass progenitor. The structural studies on fluoride glasses show a vitreous network constructed from large polyhedra (e.g. octahedra or square antiprisms) sharing corners and edges [START_REF] Poulain | Fluoride glasses: properties, technology and applicationsIn "Photonic Glasses and Glass Ceramics[END_REF].

In this study, a series of glass samples has been prepared according to the general composition rule (x)MnF2 -(x-80)NaPO3 -(20)ZnF2 (0 < x < 40). This corresponds to the substitution of sodium polyphosphate by manganese difluoride.While main physical characteristics of these glasses have been measured and reported [START_REF] Leitz | Fluorophosphate optical glass[END_REF], structural aspects require special attention. In order to collect information, the structural investigation of these new glasses has been performed using 19 F, 31 P MAS-NMR and FTIR vibrational spectroscopy. These results should help to understand the way the respective vitreous networks of phosphates and fluorides are combined.

Experimental

Starting materials

Anhydrous ZnF2 fluoride is a commercial products from Aldrich, with 99.9 % purity. Other starting materials are ammonium hydrogenofluoride NH4F,HF from WWR (Prolabo) and sodium polyphosphate NaPO3 (97% Rectapur from WWR Prolabo).MnF2 was prepared by the ammonium fluoride processing, and controlled by X-Ray diffraction.

Glass synthesis

Glasses are prepared at air by melting, fining and casting [START_REF] Poulain | Fluoride glasses: properties, technology and applicationsIn "Photonic Glasses and Glass Ceramics[END_REF]18]. The calculated amount of the starting materials is introduced in a long platinum crucible. After melting is complete, a clear liquid is obtained at a temperature ranging from 700°C to 900°C, depending on MnF2 content. Then this liquid is briefly heated for 5 to 10 mn at higher temperature for the fining step, and cooled into the crucible below 600 °C to increase viscosity and to minimize sub-liquidus nucleation. Finally it is cast between two brass walls that are heated at temperature close to Tg, that is roughly 250°C. A final annealing stage is carried out for 6 hours at a temperature 10 K lower than Tg to remove residual thermal stresses prior to polishing. The absence of a crystalline phase in the samples synthesized was checked on a DRON-2.0 X-Ray diffractometer using the filtered Cu Kα radiation.

Characterizations

The glass system under investigation is defined by the following composition rule: (x)MnF2-(x-80)NaPO3 -(20)ZnF2(10 < x < 40) while the manganese-free 20ZnF2-80NaPO3 glass was also studied for comparison.

The absorption spectra of the samples, either bulk or powders,were recorded on a Fourier transform infrared (FTIR) spectrophotometer Merlin Digilab FTS 3000 operating between 4000 and 400 cm -1 from powdered glasses dispersed in dehydrated KBr pellets. Powdered samples and KBr were kept at 110°C before the analysis to remove adsorbed water. FTIR spectroscopy method is used to confirm the identification of groups formed by glass formers, modifiers and anions and the type of chains. FTIR is also useful to detect the presence of hydroxyl radicals.

The 31 P and 19 F (I=1/2) NMR spectra were recorded at room temperature on an Avance 300 Bruker spectrometer operating at respectively 121 and 282 MHz with a 2.5mm MAS probe. The spectra were recorded at a maximum spinning speed of 30 kHz in order to simultaneously average the chemical shift and reduce the dipolar interaction. Then, the remaining broadness of the lines is due to the isotropic chemical shift distributions characteristic of the vitreous states. Due to this strong residual line broadness, a rotor-synchronized spin echo sequence was applied to refocus the whole magnetization and thus to avoid any distortion of the baseline. The Fourier Transformation were implemented from the whole echoes (so-called full shifted echoes) in order to increase the signal to noise ratio and to directly obtain absorption mode lineshapes [19][20]. The 31 P spectra were recorded with a first pulse of 1µs (π/2) and 2µs (π) for the second pulse. The recycle time was 30s, which was sufficient for full relaxation.The 19 F -31 P CP MAS NMR spectra were recorded with a contact time of 1ms and a recycle delay of 2s ensuring the quantitativity of the spectra.

The external reference used for the chemical shifts is C6F6 for 19 F spectra and NaPO3 for 31 P spectra. The simulations of the experimental spectra were performed thanks to the dmfit software [21].

3.Results

Infrared spectra

 Bulk samples

The transmission spectrum of the 30MnF2-50NaPO3-20ZnF2 glass has been recorded between 1000 and 5000 cm -1 . The thinner sample (dashed line) evidences the complex structure of the absorption bands (see Fig. 1). The main features that emerge from this figure are: -The absorption band around 3200 cm -1 that originates from hydroxyl groups.

-An intense band at 2200 cm -1 that defines the transmission limit of the sample.

-Another band around 1600 cm -1 . Optical transmission is restricted to the visible spectrum because the electronic transitions of Mn 2+ cations in octahedral ligand field lead to strong UV absorption [22,23]. It is limited to 4.5 µm in the mid-infrared by the first overtone of the P-O vibrations as this has been shown in fluoride glasses doped with phosphates [24].

 Powdered samples

Infrared transmission of powdered samples of the same glass in KBr pellets is shown in Fig. 2. The spectrum is limited to 400 cm -1 , as KBr is no more transparent beyond this frequency. The comparison with bulk glass shows that the absorption observed between 1500 and 2500 cm -1 corresponds to the first overtones of the fundamental absorption bands of the PO4 tetrahedra [24]. The vibrational behavior of phosphate salts has been widely studied [START_REF] Corbridge | Topics in Phosphorus Chemistry[END_REF][START_REF] Efimov | [END_REF][27]. The infrared absorption spectrum of phosphates brings out almost endless chains of polyphosphate. It encompasses bands associated with stretching vibrations of [PO2] -and [POP] groups that correspond to connections, terminal (PO -) and bridging Q 2 . The allocation of band network phosphate is based on the work of Efimov [START_REF] Efimov | [END_REF]. In particular, this concerns the different modes of vibration of the long chains and the short chains in the case of pyrophosphate glasses. The IR absorbance spectra of the studied glasses are shown in figure 2, which shows bands at: 530, 770, 870, 1000, 1095, 1165 and 1275 cm -1 . The assignment of these bands is shown in Table 1. Some bands also exist in the pure NaPO3 glass but they have a very low intensity. This concerns the bands located at 530, 770 and 870 cm -1 , respectively attributed to the deformation mode of PO bonds of the Q 2 tetrahedra, the symmetric stretching mode of POP bonds dimers Q 2 , and the antisymmetric mode of POP connections between tetrahedra Q 2 . However, the intensity of these bands increases gradually as the fluoride addition increases up to 25 mol% and subsequently decreases. On the other hand, the band observed at 999cm -1 in pure NaPO3 glass, has undergone a slight shift to 1018 cm -1 with the introduction of MnF2, the latter being attributed to the symmetric stretching mode of terminal P-O bonds of Q 1 . An additional weak band appears around 435 cm -1 and becomes more visible when MnF2 increases; it is attributed to the vibration mode of Mn-F octahedra MnF6. The presence of octahedral [MnF6] has actually been observed in fluoride glasses and oxyfluorides, using IR spectroscopy [28,29]. Finally the band located at 1277 cm -1 is characteristic of phosphate groups. It is attributed to the antisymmetric stretching mode of PO terminal bonds, tetrahedra Q 2 fades and disappears completely beyond 15% MnF2. This band is observed in the spectra of tungsten fluorophosphates glasses [24] Table 1 summarizes the functions of the vibration modes observed in the spectra of our vitreous samples.

31 P MAS-NMR spectra

Fig. 3 shows respectively the 31 P MAS-NMR spectra obtained first from crystalline sodium metaphosphate NaPO3 used as a structural model, and glasses in the system (x)MnF2-(x-80)NaPO3 - (20)ZnF2 with x = 0, 10, 20, 30, 40 and 50 % molar. The analysis of the last two samples (x = 40 and 50% MnF2) could not be performed because of an excess of manganese fluoride. Manganese ion Mn 2+ is a paramagnetic element (3d 5 ) with an electronic magnetic moment, which interacts with the nuclear moment of 31 P and causes a strong broadening of NMR lines. The vitreous NaPO3 spectrum presents a band centred at -20 ppm. This line position is characteristic of the Q 2 tetrahedral units [30][31][32]. This observation agrees with previous studies on sodium metaphosphate NaPO3. Its structure consists in the arrangement of PO4 tetrahedra, corner linked and forming a mono dimensional chain [(O2PO2/2)]. The Na + cations, as network modifier, are located between the chains. The spectrum of pure zinc and sodium fluorophosphate glass of the composition 20ZnF2-80NaPO3 (see Fig. 3) shows a second line of lower intensity than the first one. It is observed at around -3 ppm. This line is attributed to the Q 1 tetrahedra according to the authors previously cited. This result is quite expected, since Q 1 correspond to groups based on bits of string [30,33]. Indeed, it confirms that the fluorine takes place into PO3F tetrahedra, breaks the chains as monovalent element, and so decreases the reticulation of the tetrahedral network. This observation is corroborated by the 19 F-31 P CP-MAS spectrum shown in Fig. 5. Indeed, the relative intensities of the both lines are inverted by comparison to the 31 P direct acquisition, at the expense of the Q 2 tetrahedra. This is clearly due to the presence of fluorine in the close neighborhood of the Q 1 tetrahedron phosphorus, which is not the case for the Q 2 . Then, the introduction of MnF2 leads to the increase and the broadening of the line assigned to Q 1 .This line extends now from -3 to 0 ppm. These tetrahedra Q 1 emerged continuously with the incorporation of MnF2, suggesting that the fluorine atoms, added as MnF2, gradually cut chains of phosphate tetrahedral as described above. All the 31 P spectra have been reconstructed in order to measure precisely the relative weight of the Q 1 and Q 2 species. The results are reported in table 2 and their variations are given in Fig. 4. It confirms the progressive vanishing of Q 2 with the increase of the fluorine content in the composition.

19 F MAS-NMR spectra

The 19 F MAS-NMR spectra of the studied glasses are shown in Fig. 6. The fluorine broad line is observed at 95 ppm for the 20ZnF2-80NaPO3 initial glass, in agreement with previous studies [34]. This line is attributed to the fluorine ions directly bonded to phosphorus as met in PO3F entities for example. This line is strongly broadened as manganese content increases. It results from the paramagnetism of Mn 2+ cations. Other weak signals appear in the background line, especially around 60-70 ppm. This range of chemical shift encompasses the line position of 19 F in MnF2. Note that the two large side bands are spinning side bands due to the Magic Angle Spinning of the sample. While they are not significant, they make more difficult the identification of other possible 19 F lines.

Discussion

In pure NaPO3, either in the crystalline form or in the vitreous state, PO4 tetrahedra form chains or rings. Thus tetrahedra share only two corners, which corresponds to Q 2 tetrahedra. As a consequence, IR spectrum shows absorption bands typical of P-O bonds between phosphorous and bridging oxygen and non-bridging oxygen. As reported in table 1, IR spectrum also shows deformation of P-O-P chains, and also the stretching of the M-F bonds (Zn and Mn). As the fluoride content increases, bridging oxygens is replaced by two non-bridging fluorides, leading to shorter chains and the transformation of Q 2 tetrahedra into Q 1 [35]. The changes in IR absorption spectra resulting from fluoride incorporation are consistent with this scheme. A confirmation is provided by NMR measurements.

The first information given by NMR measurements concerns the relative number of Q 2 and Q 1 tetrahedra as a function of composition. Insofar as all glass components -NaPO3, ZnF2, MnF2-may act as glass progenitors, there are several possibilities for constructing the vitreous network. The first one consists in the mere insertion of MF6 octahedra into the set of polyphosphate chains. This structural hypothesis corresponds to the coexistence of two types of networks, oxide and fluoride, with ionic interactions. The other possibility leads to the formation of a hybrid network that associates tetrahedra and octahedra. This implies the breaking of the long -O-PO2-O-chains by non-bridging fluorine. The NMR results clearly support this hypothesis, which is consistent with previous work [35]. While pure NaPO3 glass contains almost exclusively Q 2 tetrahedra, the incorporation of 20 mol % ZnF2 -that is the starting composition of this study-leads to the formation of 40 % Q 1 tetrahedra at the expense of the original Q 2 's. The mechanism corresponds to the replacement of one bridging oxygen by two nonbridging fluorides. In the glass containing 30 mol % MnF2, only 5 % Q 2 tetrahedra are remaining. Thus glass structure contains almost exclusively P2(O,F)7 dimers. Indeed, these large complex anions make a diffusion barrier for structural ordering, which enhances glass formation. However the vitreous network based on PX4 tetrahedra does not exist anymore. These fluorophosphate glasses are rather similar to heavy metal fluoride glasses, with a vitreous network constructed from large polyhedraoctahedra in this case-and P2X7 groups.

Less accurate information is provided by the 19 F NMR because of the broadness of the lines due to the paramagnetic manganese ion presence. Despite the isostructural character of both fluorides, NMR signal is very different for ZnF2 (-36 ppm) and for MnF2 (+ 66 ppm). Neither of these chemical shifts is observed in the glass network confirming that fluorines are well incorporated into the phosphate vitreous network. It is especially clear for the initial composition containing only ZnF2 for which only one well resolved line is observed at 95 ppm. Besides, assuming a large disordering in glass structure and a 3 coordination number of fluorine versus cations, four different situations could be encountered for the environment of the free fluorine anions that are not linked to phosphorus : 1) 3 Zinc cations 2) 2 Zn and 1 Mn 3) 1 Zn and 2 Mn 4) 3 Mn NMR signal in the second and the third case should be intermediate between -36 ppm and 66 ppm. In practice a weak signal around 60 ppm appears in the glass containing 20 mol % MnF2. This suggests that structural units in glass are close to the local arrangement in crystalline manganese difluoride, that is MnF6 octahedra sharing edges and apexes, as it may be observed in rutile structure. Nevertheless, this type of environment is clearly a minority and is observed only for the manganese-rich compositions. Thus, 20% for MnF2 can be considered as a limit for a homogeneous dissolution of Mn 2+ ions into the structural network.

Conclusion

The introduction of manganese difluoride MnF2 at the expense of NaPO3 in the 80NaPO3 -20ZnF2 glass results in structural changes that have been studied by infrared spectroscopy and NMR. While vitreous sodium polyphosphate consists ideally of (PO4)n indefinite chains trapping isolated Na + cations, the incorporation of 20 % ZnF2 reduces chain length, as 40 % PX4 tetrahedra are terminal. With further incorporation of MnF2, Q 2 tetrahedra disappear almost completely. This means that only pyrophospate groups P2(O,F)7 remain as phosphorus-based structural units.Vitreous network associates these P2(O,F)7 groups and MF6 octahedra. There are two types of fluorine anions, those linked to phosphorus, and those linked to Mn and Zn in a rutile-like arrangement.

The high concentration of divalent manganese modifies the magnetic and optical properties of the base glass. Complementary physical measurements are under way.

Tables & Figures

Figure 1 . 1 )Figure 2 .Figure 3 .Figure 4 .Figure 5 .

 112345 Figure 1. IR transmittance of 30MnF250NaPO3-20ZnF2 glass sample

Figure 6 .

 6 Figure 6. 19 F NMR MAS spectra of xMnF2-(x)MnF2-(x-80)NaPO3-(20)ZnF2 glasses

Table 1 .

 1 Assignment of vibration modes in IR for glasses in : xMnF2-(80-x) NaPO3-20ZnF2 system (x=0,10, 20, 30, 40,45, 50 % molar)

	Positions of bands(cm -1 )	Attribution
	435-445	Stretching mode of M-F bonds (on MnF6and ZnF6 octahedra)
	540-570	Deformation modein Q 2 tetrahedra(δO-P-O andδP-O-P)
	745-817	Symmetric stretching mode connections P-O bridging groups
		intermediatePO2 -tetrahedra Q 2 .
	920-935	Elongation asymmetric links (P-O-P) between Q 2 tetrahedra.
		(frequency rated νas (PO2 -))
	1018-1027	Elongation symmetric connections P-O terminal (Q 2 ).
	1128-1150	Elongation symmetric connections P-O terminal (Q 1 of PO3 2-group)
	.

Table 2 .

 2 Values of chemical shifts of phosphorus and % for each environment

	(Reference used: 85%. H3PO4)
	Compositions Chemical shift		% of P in each environment F/P Ratio
	(%mol)	Q 1	Q 2	Q 1	Q 2
	NaPO 3 glass	N/A	-21	0	100	0
	80NaPO 3 0MnF 2	-3	-20	40	60	0.5
	70NaPO 3 10 MnF 2	-0.5	-19	84	16	0.86
	60NaPO 3 20 MnF 2	2	-19	90	10	1.08
	50NaPO 3 30 MnF 2	2	-19	95	5	2


Stéphane Frénot
email: stephane.frenot@insa-lyon.fr

Amine Ghorbali
email: mohamed-amine.ghorbali@univ-ubs.fr

Frédérique Laforest
email: frederique.laforest@univ-st-etienne.fr

Pascale Launay
email: pascale.launay@univ-ubs.fr

Nicolas Le Sommer

Damien Reimert
email: damien.reimert@inria.fr

Nicolas Le Sommer
email: nicolas.le-sommer@univ-ubs.fr

Demo Spontaneous and Ephemeral Social Networks: an Event-based Framework

Keywords: Social Networks, Opportunistic Computing, Event-based data flow, in-browser architecture

ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

INTRODUCTION

Online social networks have been adopted by a large part of the population, and have become in few years essential communication means and source of information. Nevertheless, as they rely on a centralized and proprietary architecture, these social networks present some drawbacks. Among these, users rely on a remote authority for information management, filtering and dissemination. All data management algorithms are centralized and determined by the authority; this authority defines solely its terms of service. Secondly, an Internet connection is mandatory to access them. In circumstances such as during peak times in crowded environments, people may experience long latencies and even net-work outages. Finally, they are not specifically designed and are not well suited for allowing geographically close users to exchange contents in a collaborative way.

The C3PO project 1 proposes to investigate multimedia content exchange in a new type of social networks, so called Spontaneous and Ephemeral Social Networks (SESN). At the network level, SESNs rely on a peer-to-peer distributed architecture spontaneously formed by mobile devices. Opportunistic communication techniques are used in order to support the connectivity disruptions resulting from the mobility of devices and the short communication range of wireless interfaces. A SESN is created by any user and advertised to other users in the vicinity. As a SESN is geographically constrained by the happening location, the set of users collaborating in the SESN is limited. When the happening stops, peers forming the SESN separate, devices are disconnected and the SESN vanishes. Multimedia contents are stored locally on each device, so users still have access to these contents after the end of the happening. These contents are massively exchanged within the SESN: all peers receive all contents. At the application level, each peer filters contents according to a selection of plugins. Each plugin processes specific events, produces some results and handles the user interactions on the results. Some plugins may create new events thrown in the flow.

Due to their spontaneous and ephemeral nature, SESNs are suited for happenings, such as conferences, cultural or sports events. For instance, the spectators of a marathon can take photos, write comments about the marathon and publish them in the dedicated SESN. The C3PO project objectives are detailed in [START_REF] Laforest | C3PO: a Spontaneous and Ephemeral Social Networking Framework for a collaborative Creation and Publishing of Multimedia Contents[END_REF].

Our proposal claims for the following differentiating characteristics:

3. a highly configurable application based on a set of plugins that can select the events they must process. Plugins may be added or removed on the fly.

4. an infrastructure-less architecture that does not depend on a central authority, each device managing his own view of the SESN.

This paper is organized as follows. Section 2 provides an overview of the C3PO framework. Sections 3 and 4 present respectively the inter-devices communication and the intradevice communication parts of the C3PO framework. In section 5, we propose a demonstration for DEBS'15 of an Android application based on the C3PO framework, and that supports the above-described SESN architecture.

GENERAL ARCHITECTURE OF THE C3PO FRAMEWORK

C3PO targets the mobile user, where the panel of devices is large and heterogeneous: genericity of the C3PO application is mandatory. C3PO aims at being independent from the operating system as much as possible, and therefore a large part of the C3PO framework relies on the today's inbrowser technologies.

Using an event-based paradigm, the C3PO framework general architecture can be represented as on figure 1. We structured this framework in two parts: the inter-devices communication part, that manages the data exchange between devices, and the intra-device communication part enabling the propagation of events within the local device. To implement the event-based architecture, we have used a turn-based processing approach 2 , that consists in processing an event through all the parts of the architecture before processing the next one. This approach follows three principles: no blocking, no wait, finish fast. Moreover, it allows to manage only one queue of events that corresponds to a single network interface connection, as most mobile devices have.

The architecture uses a set of components plugged on the event flow. Components use a specified API to be notified of events. Current components are developed in Java or JavaScript, to cope with low level hardware APIs and high level HTML5 in-browser development.

Sections 3 and 4 explain the inter-devices and intra-device communication parts.

INTER-DEVICES COMMUNICATION

The C3PO inter-devices communication part is built upon four blocks of functionalities and an event registry (Figure 2). The Connectivity and Network Management block 2 http://www.youtube.com/watch?v=dkZFtimgAcM makes the device discovery and the connection with neighboring devices. It supports different connectivity types, i.e. Bluetooth, Wi-Fi Legacy, Wi-Fi Direct and 3G/4G. In the C3PO framework, this inter-devices communication part is developed in Java, so as to be implemented on Android mobile devices and Wi-Fi access points based on Raspberry-Pi devices. The latter can be deployed during a happening in order to help form the network.

Opportunistic Networking

The short communication range of Bluetooth and Wi-Fi interfaces, the mobility of people and the radio interferences can yield unpredictable disruptions in communication links. Maintaining end-to-end connectivity between all devices then becomes quite a challenge, as solutions relying on dynamic routing protocols designed for MANETs prove unable to ensure message forwarding in such conditions. They assume that the network is dense enough, so it can be viewed as a fully connected graph. It proves unrealistic in many real situations. Opportunistic communications rely on the "store, carry and forward" principle. The basic idea is to take advantage of radio contacts between devices to exchange messages, while exploiting the mobility of these devices to carry messages between different parts of the network. In opportunistic networks, different message forwarding strategies can be devised, like epidemic and network flooding techniques, or more sophisticated techniques [START_REF] Mota | Protocols, Mobility Models and Tools in Opportunistic Networks: A Survey[END_REF]. In the C3PO framework, message forwarding strategies use reactive and event strategies. Four main types of events are currently considered: (1) the emission of a message by a local component, (2) the reception of a message from the network, (3) the discovery and connection of a new neighbor and (4) the disappearance and disconnection of a neighbor.

Simple flooding message forwarding

The flooding strategy is the most elementary one. When a message is received from a local application, it is stored in the local cache and forwarded to the connected neighbors. When a message is received from the network, it is stored in the local cache and transmitted to the intra-device communication part. When a new neighbor connects, all the messages in local cache are forwarded.

Gossiping-based message forwarding

The gossiping strategy relies on a prior exchange of catalogues of messages IDs. Each device maintains an up-to-date vision of the cache of its neighbors. Based on these catalogues, each device asks the new neighbor to forward the unknown messages (see Figure 3) and broadcasts its new catalogue to other neighbors. The simple flooding strategy is dedicated to SESNs with few neighbours. The gossiping-based message forwarding strategy should be used when the number of neighbors increases: catalogue exchange permits to effectively exchange only necessary contents.

Communication Paradigms

The C3PO framework provides two distinct applicationlevel communication paradigm.

The pub/sub topic-based communication model makes it possible to develop applications that can publish multimedia contents on specific topics, and subscribe in order to receive the contents related to given topics. This model relies on a purely peer-to-peer decentralized approach. Subscription and publication are local to each device. Due to the spontaneous nature of the opportunistic network, it is not possible nor suitable to rely on a centralized registry. Thanks to the store, carry and forward principle, contents published on a topic by publishers (P in Figure 4) are disseminated opportunistically in the communication network by mobile devices, being either devices hosting subscribers for this topic or any intermediate device (resp. S and I in Figure 4). The point-to-point communication paradigm based on the concept of channel is intended for applications that allow users to communicate with each other by sending messages addressed to specific recipients. In the framework, a channel between two devices is identified by the addresses of the devices and a port number. Messages sent through a channel are opportunistically forwarded by intermediate devices towards their destination according to one of the message forwarding strategies implemented in the framework. Thus, two devices can exchange data even if they are not within mutual radio range.

INTRA-DEVICE COMMUNICATION

The intra-device communication part manages the events for the end-user. It gets events from the flow of events, processes them and presents the results to the end-user. This intra-device communication part is also responsible for the creation of new events reflecting some end-user actions. For example, the end-user can create new contents to be exchanged with other end-users; he can also promote a received content to stress his special interest.

Depending on the SESN happening type, the events may carry very different contents and thus event processing requires extensibility. Devices in the same SESN have a set of identical processing units, but some more powerful devices may also have additional specific ones.

The global architecture of the Intra-device communication part is illustrated on figure 5. Plugins are components responsible for the processing of incoming events and for the interaction with the end-user [START_REF] Frénot | An in-browser microblog ranking engine[END_REF]. Each plugin has a specific event processing unit, dedicated to a kind of event. For each incoming event, the event dispatcher selects in a registry of plugins the corresponding plugins and calls their processing unit with a reference to the event. Plugins can store their processing results in their own context.

When a device connects to a SESN, the SESN Manager registers the corresponding plugins in the registry. A SESN Canvas organizes plugins in the graphical user interface.

Plugins

A plugin is defined with three elements: (1) the grammar of the events contents it is interested in, (2) the processing modalities of the corresponding events, (3) the management of end-user interactions with the results of its process. For example, an image plugin can declare in its grammar that it requires events containing references to images, process the events by uploading the images, interacting with the enduser by showing the list of images and proposing a "promote" button for each image.

Plugins must conform to the C3PO plugins API, that contains one standardized function invoked by the event dis-patcher. This method has one parameter: a reference to an event in the event registry. Plugins are developed using the AngularJS framework. User interactions in a plugin are developed as an AngularJS directive. This Directive may also include an event creation. This new event is thrown into the global events queue, as shown in the general architecture on figure 1.

An event can be processed by many plugins. Each plugin declares regular expressions to be matched on the event content in order to be notified. The plugin registry gathers all regular expressions in a way that optimizes plugins selection. The event dispatcher uses this registry to trigger processing units in plugins. Regular expressions are flexible enough to accept any kind of identifier within events. In the current implementation, regular expressions provide a list of hashtags that must be present or absent.

Plugins examples

In this section, we describe a subset of the plugins that have already been developed in the C3PO project.

• The "Flow" plugin takes all the received and emitted events and displays them as a list ordered with the last received first. Its regular expression is empty. The user can browse the list, and can click a "promote" icon that indicates that he believes this event is important. Each promote done by the end-user generates and throws a new Event including a #promote hashtag and the source event id. A screenshot is given on figure 6. • The "Trends" plugin selects events containing a #promote hashtag. The promote event can come from any node of the SESN. Its regular expression is #promote. It consolidates in its context a promotion value associated with the event. When the promotion value reaches a given threshold, it displays it, creates and throws a new Event including a #trend hashtag with the consolidated promotion value and the source event id.

• The "Tags Cloud" plugin takes all the incoming events and builds a tags cloud that reflects the frequency of each hashtag in the events set. Its regular expression is empty. Its user interface displays the tags cloud.

• The "Image" plugin selects events containing a reference to an image (url) and displays them as a list ordered with the last received first. Its regular expression and its user interface are similar to the "Flow" plugin.

• The "My Journal" plugin displays all trending events interleaved with all events manipulated by the user.

The user can manipulate the displayed list to raise, diminish or remove events. At the SESN termination it provides a summary of the happening.

• The "Config" plugin helps user to activate or to deactivate each other plugin. When deactivated, the plugin is removed from the user interface but keeps its local context. If the user reactivates a plugin, it starts processing events with the previous saved context.

DEMO PROPOSAL

The demonstration will be used by the conference attendees. They will enter the DEBS'15 SESN instance using the C3PO application with their own Android device. They will publish messages and photos, promote contents and get trending events during the conference. A voting plugin will be provided to elect the best paper from the SESN community.

Our C3PO application can be installed on Android smartphones or tablets, provided these devices are equipped at least with Android version 4.4. This application could be installed thanks to a flash code or a URL indicated on a poster. Even if our application has a friendly and simple to use interface, a short introduction to the possibilities offered by the application will be provided online and on site.

Figure 1 :

 1 Figure 1: C3PO general event-based architecture

Figure 2 :

 2 Figure 2: C3PO Inter-devices communication The Opportunistic Networking block provides two communication paradigms, namely a pub/sub topic-based, and a send/rec channel-based. It defines a generic mechanism to forward messages in mobile ad hoc networks, and allows to devise different forwarding strategies. Finally, the interdevices communication part uses two other blocks of functionalities: Events Management and Logging.In the C3PO framework, this inter-devices communication part is developed in Java, so as to be implemented on Android mobile devices and Wi-Fi access points based on Raspberry-Pi devices. The latter can be deployed during a happening in order to help form the network.

Figure 3 :

 3 Figure 3: Exchange of messages after a connection event using gossiping-based message forwarding

Figure 4 :

 4 Figure 4: Communication between mobile devices using the topic-based publish/subscribe paradigm

Figure 5 :

 5 Figure 5: C3PO Intra-Device Communication

Figure 6 :

 6 Figure 6: Event flow display

a location-constrained social network, where users only may interact with others using short range communications.

2. a short-lived pseudo, where each user is identified only for the happening lifetime.1 http://www.c3po-anr.fr/

ACKNOWLEDGMENTS

This work is done in the C3PO project, supported by the French ANR (Agence Nationale de la Recherche) under contract ANR-13-CORD-0005. http://www.c3po-anr.fr/


Hrishikesh Deshpande
email: hrishikesh.deshpande@inria.fr

Pierre Maurel
email: pierre.maurel@irisa.fr

Christian Barillot
email: christian.barillot@irisa.fr

Classification of Multiple Sclerosis Lesions using Adaptive Dictionary Learning

Keywords: Sparse Representations, Adaptive Dictionary Learning, Computer Aided Diagnosis, Magnetic Resonance Imaging

 We classify multiple sclerosis lesions using adaptive dictionary learning.

 Separate dictionaries are learned for the healthy brain tissues and lesion classes.

 Tissue-specific information is incorporated by learning dictionaries for each tissue.

 Adapting dictionary sizes based on complexity of data gives better classification.

A c c e p t e d M a n u s c r i p t

Introduction

Multiple sclerosis is a chronic, autoimmune disease of the central nervous system (CNS). It is characterized by the structural damages of axons and their myelin sheathes. Magnetic resonance imaging is the best paraclinical method for the diagnosis of MS, A c c e p t e d M a n u s c r i p t assessment of disease progression and treatment efficacy [START_REF] Grossman | Perspectives on multiple sclerosis[END_REF][START_REF] Miller | Role of magnetic resonance imaging within diagnostic criteria for multiple sclerosis[END_REF]. These images are analyzed to find the number and spatial patterns of the lesions, appearance of new lesions and the total lesion load, which are key parameters in the current MS diagnostic setup. Manual segmentation of MS lesions, however, is a laborious and time consuming task, pertaining to the requirement of analyzing large number of MR images. Furthermore, it is prone to high intra-and inter-expert variability. Several MS lesion segmentation methods have been proposed over the last decades, with an objective of handling large variety of MR data and which can provide results that correlate well with expert analysis. These methods are based on supervised or unsupervised approach and use different image features and classification strategies to model lesions [START_REF] García-Lorenzo | Review of automatic segmentation methods of multiple sclerosis white matter lesions on conventional magnetic resonance imaging[END_REF][START_REF] Lladó | Segmentation of multiple sclerosis lesions in brain MRI: A review of automated approaches[END_REF].

Over the last few years, sparse representation has evolved as a model to represent an important variety of natural signals using a linear combination of a few atoms of an over-complete dictionary. Dictionary learning, a particular sparse signal model, aims at learning a non-parametric dictionary from the underlying data. The representation of data in such a manner has led to the use of sparse representations and dictionary learning in many image processing applications such as image restoration [START_REF] Elad | Image denoising via learned dictionaries and sparse representation[END_REF][START_REF] Mairal | Sparse representation for color image restoration[END_REF], inpainting [START_REF] Elad | On the role of sparse and redundant representations in image processing[END_REF], face recognition and texture classification [START_REF] Peyré | Sparse modeling of textures[END_REF][START_REF] Wright | Robust face recognition via sparse representation[END_REF].

The ability of sparse representations to approximate high-dimensional images using a few representative signals in a low-dimensional subspace and the development of efficient sparse coding and dictionary learning techniques offer a great advantage in medical image analysis. Recent publications have demonstrated the effectiveness of sparse representation techniques in medical applications such as shape modelling [START_REF] Zhang | Towards robust and effective shape modeling: Sparse shape composition[END_REF], constructing a structural brain network model [START_REF] Chung | Sparse topological data recovery in medical images[END_REF] and predicting cognitive data from medical images [START_REF] Kandel | Predicting cognitive data from medical images using sparse linear regression[END_REF]. In addition, the dictionary learning framework has been used in deformable segmentation [START_REF] Zhang | Deformable segmentation via sparse representation and dictionary learning[END_REF], image fusion [START_REF] Yu | Medical image fusion based on sparse representation with ksvd[END_REF], super-resolution analysis [START_REF] Wang | Medical image super-resolution analysis with sparse representation[END_REF], denoising [START_REF] Rubinstein | Double sparsity: Learning sparse dictionaries for sparse signal approximation[END_REF][START_REF] Deka | Despeckling of medical ultrasound images using sparse representation[END_REF], deconvolution of low-dose computed tomography perfusion [START_REF] Fang | Tissue-specific sparse deconvolution for low-dose ct perfusion[END_REF][START_REF] Fang | Towards robust deconvolution of low-dose perfusion ct: Sparse perfusion deconvolution using online dictionary learning[END_REF] and low-dose bloodbrain barrier permeability quantification [START_REF] Fang | Improving low-dose bloodbrain barrier permeability quantification using sparse high-dose induced prior for patlak model[END_REF]. In each of these applications, the dictionaries are learned from the underlying data so that they are better suited for representation of the signal of interest. On the other hand, the discriminative dictionary learning approaches proposed for image segmentation focus on learning dictionaries which are representative as well as discriminative [START_REF] Zhang | Discriminative sparse representations for cervigram image segmentation[END_REF][START_REF] Tong | Segmentation of MR images via discriminative dictionary learning and sparse coding: Application to hippocampus labeling[END_REF]. In this paper, we propose a novel algorithm, for classification of multiple sclerosis lesions, which incorporates discrimination in the dictionary learning framework by adjusting the size of the dictionaries according to the complexity of the underling data. Previous works [START_REF] Deshpande | Detection of multiple sclerosis lesions using sparse representations and dictionary learning[END_REF][START_REF] Ramirez | An MDL framework for sparse coding and dictionary learning[END_REF] have also reported the effects of the dictionary size in image classification. We investigate this in the particular case of classification.

In the past, Weiss et al. [START_REF] Weiss | Multiple sclerosis lesion segmentation using dictionary learning and sparse coding[END_REF] proposed dictionary learning based MS lesion segmentation method by learning a single dictionary with the help of healthy brain tissue and lesion patches. The lesions are treated as outliers and lead to a higher reconstruction error when decomposed using this dictionary. There are several shortcomings in this method. The method uses only FLAIR MR images for analysis of clinical data. However, MS lesions appear in different intensity patterns in various MR sequences, which include T1-(T1-w MPRAGE), T2-(T2-w) and Proton Density-weighted (PD-w). The complementary information in these MR images can further assist in classifying MS lesions. We, therefore, build our analysis using multi-channel MR data.

The former method also uses an unsupervised approach and it was observed that one of the crucial parameters used in this approach is the threshold on error map. This pa-2

A c c e p t e d M a n u s c r i p t rameters drives the segmentation results and is not easy to tune. Furthermore, it could lead to worse segmentation results for small errors in the brain extraction procedure. We suggest a solution to this problem by proposing a fully automatic supervised classification method that eliminates this parameter. As outlined in many classification approaches using dictionary learning, we learn class specific dictionaries for the healthy brain tissues and the lesions that promote the sparse representation of the healthy and lesion patches, respectively. The lesion patches are well adapted to their own class dictionary, as opposed to the other. Thus, we can use the reconstruction error derived from the sparse decomposition of the test patch on to these dictionaries for obtaining the classification.

There exist several MS lesion segmentation methods that use tissue segmentation to help segment the lesions [START_REF] Zijdenbos | Automatic "pipeline" analysis of 3-D MRI data for clinical trials: application to multiple sclerosis[END_REF]. We can thus further enrich our model by taking into account the tissue specific information and learning dictionaries specific to different tissue types, such as White Matter (WM), Gray Matter (GM) and Cerebrospinal Fluid (CSF), as opposed to learning a single dictionary for healthy tissue patches. We explore the fact that various tissues as well as lesions appear in different intensity patterns in distinct MR modality images. For example, WM appears as the brightest tissue in T1-weighted image, but the darkest in T2-weighted images. Therefore, learning class specific dictionaries for individual tissues should further discriminate between lesion and non-lesion classes.

The dictionaries learned for each class are aimed at better representation of an individual class. However, if there exists differences in the data-complexity between classes, the relative under-or over-representation of either class will lead to worse classification. One idea for better classification could be to learn the dictionaries with adaptive sizes, in order to take into account the data variability between different classes. Thus, in addition to the dictionary learning strategy mentioned above, we also investigate the effect of modifying the dictionary sizes, leading to the proposition of adaptive dictionary learning. The basic idea is to learn the class specific dictionaries which are better adapted to the data and also complexity of the data.

The main contributions of this paper can be outlined as follows: (1) Supervised classification approach is developed using multi-channel MR data by learning dictionaries for the healthy brain tissues and the lesion classes. (2) Tissue-specific information is incorporated by learning dictionaries specific to each tissue class as opposed to learning a single dictionary for representation of the healthy brain tissue class. (3) The dictionary sizes are adapted according to the complexity of the underlying data so that the dictionaries are better suited for representation of each class data as well as classification of MS lesions.

This paper is organized as follows. We first describe sparse coding and dictionary learning in Section 2. The materials and methods are explained in Section 3, followed by results and discussions in Section 4, and conclusion in Section 5.

Sparse Coding and Dictionary Learning

Sparse representation of the data allows decomposition of signals into linear combination of few basis elements in the overcomplete dictionary. Consider a signal x ∈ R N and an over-complete dictionary D ∈ R N ×K . The sparse coding problem can be stated as min a a 0 s.t. x = Da or x -Da A c c e p t e d M a n u s c r i p t the later solves the convex approximation of the problem above by replacing l 0 norm with l 1 norm, which also results in a sparse solution [START_REF] Mallat | Matching pursuits with time-frequency dictionaries[END_REF][START_REF] Pati | Orthogonal matching pursuit: recursive function approximation with applications to wavelet decomposition[END_REF][START_REF] Chen | Atomic decomposition by basis pursuit[END_REF]. The sparse coding problem can be given by min

a x -Da 2 2 + λ a 1 ( 1
)
where λ is called sparsity induced regularizer and balances the trade-off between the reconstruction error and the sparsity of the coefficient vector a.

The fixed dictionaries like wavelets can be efficient, but over the past years, the dictionary learning from underlying data has produced exciting results with greater data adaptability. For a set of signals {x i } i=1,.,m , the dictionary learning problem is to find D such that each signal can be represented by sparse linear combination of its atoms. This can be stated as the following optimization problem min

D,{ai} i=1,..,m m i=1 x i -Da i 2 2 + λ a i 1 ( 2
)
The optimization is carried out as an iterative two-step process: (i) Sparse coding with a fixed D, and (ii) the dictionary update with a fixed a.

Among the methods available in the literature for learning the dictionary, KSVD, MOD and online dictionary learning are widely used algorithms [START_REF] Aharon | An algorithm for designing overcomplete dictionaries for sparse representation[END_REF][START_REF] Engan | Frame based signal compression using method of optimal directions (MOD)[END_REF][START_REF] Mairal | Online dictionary learning for sparse coding[END_REF].

Materials and Methods

Dataset

The proposed approach involved MR dataset of 14 MS patients acquired via Verio 3T Siemens scanner. T1-w MPRAGE, T2-w, PD-w and FLAIR modalities were chosen for the analysis. The volume size for T1-w MPRAGE and FLAIR was 256×256×160 and voxel size was 1×1×1 mm 3 . For T2-w and PD-w, the volume size was 256×256×44 and voxel size was 1×1×3 mm 3 . Annotations of the lesions were carried out on T2-w volume by an expert neuroradiologist. These manual segmentation images are referred to as ground truth lesion masks.

Overview of the method

The overview of the method proposed is shown in Figure 1. MR images for all patients are first preprocessed for noise-reduction and the elimination of extracranial brain tissues. The images are then registered into the same space. We represent image volumes as patches of a predefined size and normalize these extracted patches. This is followed by labeling patches in two ways: (i) Healthy brain tissue patches and lesion patches, using manual segmentation images and (ii) WM, GM, CSF or lesion patches, with the help of manual lesion segmentation and tissue segmentation images. The patches are then divided into the training and test dataset. For various classification strategies, we learn the dictionaries, using training data, in different configurations as follows: a single dictionary, two separate dictionaries for the healthy and lesion classes, or the class specific dictionaries for the lesions and each healthy brain tissue -WM, GM, CSF. For the last two approaches, we also study the role of the dictionary size in the classification. Finally, for a given test subject, we developed a reconstruction error based patch-classification method, which is followed by the voxel-wise classification. The following subsections briefly describe these steps. 4

A c c e p t e d M a n u s c r i p t

Preprocessing

The noise introduced during MR acquisition is removed using non-local means and intensity inhomogenity (IIH) correction [START_REF] Tustison | N4ITK: Improved N3 bias correction[END_REF][START_REF] Coupe | Optimized blockwise nonlocal means denoising filter for 3-D magnetic resonance images[END_REF]. To ensure the spatial correspondence, the images are registered with respect to T1-w MPRAGE volume [START_REF] Wells | Multi-modal volume registration by maximization of mutual information[END_REF] and are processed further to extract the intra-cranial mask [START_REF] Smith | Fast robust automated brain extraction[END_REF]. We limit our further analysis to this brain region.

Patch extraction and labeling

For local image analysis in the dictionary learning framework, the images are divided into the overlapping patches. Each patch is then represented as a signal in the dictionary learning process. We follow this patch-based approach and divide the whole intracranial MR volume for each patient into 3-D patches, with a patch around every 2 voxels in each direction. The individual image patches of each MR modality are then flattened to form a vector and are concatenated together. The patches so obtained are normalized for a unit l 1 norm.

Next step is to label the normalized patches obtained from every patient. We label them in two different ways for the experiments to be preformed next. Firstly, the patches are labeled as belonging to either healthy or lesion class, using the manual segmentation image. If the number of lesion voxels in the corresponding image block of the manual 5

A c c e p t e d M a n u s c r i p t segmentation image exceeds a pre-defined threshold T L , we assign this patch to the lesion class. Otherwise, it is labeled as a healthy patch. The image patches obtained in this manner form the dataset for the classification approaches which use a single dictionary or two class specific dictionaries. For other classification methods, the patches are labeled as either WM, GM, CSF or lesion class. We use the same rule, as explained above, to label the patch to the lesion class. In addition, the patch is now assigned to either WM, GM or CSF class, depending on the maximum number of voxels that belong to corresponding class in the brain tissue segmentation image obtained using Statistical Parametric Mapping (SPM) [START_REF] Ashburner | Unified segmentation[END_REF].

The labeled image patches are then divided into training and test data, and the experiments are performed by following Leave-One-Subject-Out-Cross-Validation (LOSOCV).

Patch-based classification using dictionary learning

Let n be the number of voxels per patch. For each class c, we write patches as vectors

x c i ∈ R n .
Learning an over-complete dictionary D c ∈ R n×k that is adapted to m patches, with sparsity parameter λ, is addressed by solving the optimization problem, similar to Equation 2.

min D c ,{a c i } i=1,..,m m i=1 x c i -D c a c i 2 2 + λ a c i 1 (3)
The subsections below detail the different strategies adopted while learning these dictionaries and the scheme of patch based classification. In every method, we obtain the sparse codes for the test patches using Eq (1), knowing the dictionary D c for the class c.

Single Dictionary (1D)

In the context of MS lesion classification, the simplest idea, similar to [START_REF] Weiss | Multiple sclerosis lesion segmentation using dictionary learning and sparse coding[END_REF], could be to use a single dictionary learned from the healthy and lesion class patches. Such dictionary is mainly representative of the healthy brain image patches, based on the fact that the number of lesion patches is very small as compared to that of the healthy class.

As lesions are outliers with respect to the healthy brain intensities, the decomposition of the lesion patch using such dictionary would result in a higher representation error than that for the healthy tissue patches. Thus, for a given test patch, we calculate the sparse coefficients with appropriately chosen sparse penalty factor and the reconstruction error. The test patch with representation error greater than chosen threshold would be classified as a lesion patch. For calculation of the threshold, we used the histogram of the error map, as proposed by the authors [START_REF] Weiss | Multiple sclerosis lesion segmentation using dictionary learning and sparse coding[END_REF].

Two-Dictionaries: Same dictionary size (2D-S)

In this method, we learn the class specific dictionaries D c of the same size, for the healthy (c = 1) and lesion (c = 2) class. The dictionaries learned in this manner are better suited to represent the corresponding class data. The decomposition of the test patch using other class dictionary would give rise to a higher representation error.

For a given test patch y i , the classification is performed by calculating the sparse coefficients a c i for each class and the test patch is then assigned to the class with a The dictionaries learned using above mentioned approach do not take into account the data variability between two classes. The size of the dictionary plays a major role in data representation. The healthy class data is associated with more variability as compared to the lesion class, because it represents complex anatomical structures such as white matter, grey matter and cerebrospinal fluid. The number of training samples for the healthy class also outnumber the lesion class training samples. To account for more variability and the number of training samples, we allow larger dictionary size for the healthy class and study its effect on MS lesion classification.

Four-Dictionaries: Same dictionary size (4D-S)

As explained before, the healthy brain tissues contain anatomically different regions such as WM, GM and CSF. The fact that every tissue, WM, GM and CSF, appears in different intensity pattern in each MR modality, using a single dictionary for representing the healthy brain tissues might not be as effective as learning separate dictionaries for each tissue. Adding tissue specific information in the dictionaries used for the classification would enhance the prior knowledge in the learning step, thus highlighting the differences between individual tissues and also improving the lesion classification.

After learning class specific dictionaries for WM, GM, CSF and lesion, we perform classification based on reconstruction error in a similar manner, as mentioned in Section 3.5.2. Each dictionary is representative of its own class and the reconstruction of the test data using true class dictionary would give a minimum reconstruction error.

Four-Dictionaries: Different dictionary size (4D-D)

Here, we experiment with different dictionary sizes for WM, GM, CSF and lesion classes, for the similar reasons mentioned in Section 3.5.3.

Voxel-wise classification

As already stated, we classify the patches centered around every 2 voxels in each direction. For voxel-wise classification, we assign each voxel to either of the classes by using majority voting. The voxel is assigned to a class using majority votes of all patches that contain the voxel.

Finally, in the context of lesion classification, we record the number of voxels that belong to True Positives (TP), False Negatives (FN) or False Positives (FP), and calculate percentage sensitivity (SEN)= T P ×100 T P +F N , percentage Positive Predictive Value (PPV) =

T P ×100

T P +F P and percentage dice-score (Dice) = 2×T P ×100 2×T P +F P +F N .

Experiments and Results

We implemented our method using MATLAB and Python. Neuroimaging softwares N4ITK and Brain Extraction Tool (BET) were used for IIH correction and brain extraction, respectively [START_REF] Tustison | N4ITK: Improved N3 bias correction[END_REF][START_REF] Smith | Fast robust automated brain extraction[END_REF] Parametric Mapping (SPM) [START_REF] Ashburner | Unified segmentation[END_REF]. The dictionary learning and sparse coding is performed with the use of SPArse Modeling Software (SPAMS) package [START_REF] Mairal | Online dictionary learning for sparse coding[END_REF].

For labeling patches, we used the threshold T L = 6, as mentioned in Section 3.5. For patch size of 5×5×5, the number of lesion patches for each patient varied from 1K to 30K, depending on the lesion load for the corresponding patient, whereas the average number of patches for the healthy brain tissue class was 1.5×10 6 . For WM, GM and CSF classes, the numbers of patches obtained per patient were 50K, 90K and 30K, respectively. The classification was performed using LOSOCV and different parameters were tested. It was found that the patch size of 5×5×5 and the sparsity parameter λ = 0.95 were optimal choices. Changing λ in steps of 0.5 from 0.5 to 0.95 did not influence the results much and the value of 0.95 provided good results for all patients. All these experiments were performed on 2.5 GHz, 120 GB RAM Xeon processor. The dictionaries of sizes ranging from 500 to 5000, were learned from the training data and the best results, in terms of both sensitivity and PPV, were selected. For the dictionary sizes varying from 500 to 5000, the dictionary learning step required 5 minutes to 3 hours, where as the classification step took 4 minutes to 38 minutes, respectively. We used these parameters for validation of classification approaches using multi-channel MR data. We, however, excluded one patient with strong MR artifacts from this analysis.

The results of voxel-wise classification, obtained using all the methods described above, are shown in Table 1. Method (a) indicates classification obtained using single dictionary learned with the help of both healthy brain tissue and lesion patches. Here, we chose the sparse penalty factor λ = 0.85 in the sparse coding step and performed the classification for various threshold values on the histogram of error map, as explained in Section 3.5.1. The threshold, which produced the best voxel-wise classification results in terms of both sensitivity and PPV, was then selected and the classification results were reported. It can be observed from very low PPV and dice-scores that this method suffers with a very large number of false positive detections.

A c c e p t e d M a n u s c r i p t

In the second experiment, we used the class specific dictionaries of same size, for the healthy and the lesion class. As indicated by method (b), the classification obtained using dictionaries with 5000 atoms each resulted in high sensitivity but PPV and dice-scores were still low. One possible reason behind these low values is that there exists a difference in variability of the data for two classes. Considering more variability associated with the healthy class data, we then used different dictionary sizes, 5000 for the healthy class and 1000 for the lesion class. As shown in method (c), this drastically reduced FP, improving PPV and dice-scores, but also decreased the sensitivity.

We further enriched this model by learning separate dictionaries for each healthy brain tissue -WM, GM, CSF, in addition to the dictionary learned for the lesion class. Using four such dictionaries with 5000 atoms each, it can be observed that a better compromise between sensitivity and PPV is achieved, as compared to methods (b) and (c) described above. This is shown by method (d). Finally, the classification using four dictionaries of different sizes, 4000 each for WM, GM and CSF classes, and 2000 for lesion class, was obtained. This reduced the mean sensitivity but improved both the mean PPV and the mean dice-score, as compared to method (d) and is indicated by method (e) in Table 1.

The methods (c) and (e), which consider the inter-class data variability and use different dictionary sizes in classification, offer a better compromise between sensitivity and PPV, as compared to their counterpart methods (b) and (d), which use the same dictionary size for all classes. Between methods (c) and (e), each employing either two or four dictionaries respectively, the later method performs better than the former with a higher mean sensitivity, PPV and dice-score. Their comparison also shows a significant difference in PPV and dice-scores, with respective p-values of 0.0008 and 0.003. This confirms that the classification improves using dictionaries for each brain tissue.

Role of dictionary size on classification

To investigate the effect of dictionary size on the performance of classification, we performed the experiments using methods (d) and (e) that use three separate dictionaries for the healthy brain tissues and one for the lesion class. Table 2 summarizes the results of classification. For method (d), which uses the same dictionary size for all classes, the results along the diagonal of the table from top-left to bottom-right show that the sensitivity and PPV increase until the dictionary size is increased to 2000. The possible reason for this is that the dictionaries capture more details with the increase in their size. However, the sensitivity reduces or remains constant thereafter, possibly because of the over-fitting occurring in either class. Excluding values along the diagonal mentioned above, all other entries in the table indicate the sensitivity and PPV values obtained with method (e), which uses different dictionary sizes for tissues and the lesion class. By referring to values in the columns from a single row, which suggests using a constant dictionary size for each tissue while varying the dictionary size of lesion class from 500 to 5000, we can observe that sensitivity keeps increasing but PPV value reduces, resulting in false positive detections. On the other hand, if we fix the dictionary size for the lesion class and increase the dictionary size for the tissues, PPV increases but sensitivity reduces, resulting in under-detection. Very low PPV scores above-diagonal from top-left to bottom-right suggest that the lesion dictionary over-fits the data corresponding to the lesion class, with the use of higher dictionary size for the lesion class than that for the tissue classes. The best results, for both sensitivity and PPV together, are obtained for the dictionary size of 4000 for each tissue class and 2000 for the lesion class. It can also 9

A c c e p t e d M a n u s c r i p t be observed that it is the relative dictionary size that drives the classification and is more important than just the absolute dictionary size for each class. It is crucial to adapt the size of the dictionaries to better control the classification. For such purpose, we analyzed the data using Principal Component Analysis (PCA), which gives an estimate of the intrinsic dimensionality of the data. Figure 2 shows the cumulative variance explained by the eigen-vectors of different classes such as WM, GM, CSF, lesion and healthy. The number of eigen-vectors required for explaining the mentioned percentages of the total variances for each class are shown in Table 3. It can be seen that, for each brain tissue -GM, WM and CSF, approximately twice as many eigen-vectors are required for an arbitrary proportion of the percentage cumulative data variance (90%, 95% or 98%), as that required for the lesion data. As exhibited by method (e), this observation supports our adaption of dictionary size for each brain tissue twice that for the lesion dictionary. In case of method (c), which uses dictionaries for healthy and lesion classes, the experimentally observed optimal dictionary size ratio of 5 for the healthy and the lesion class was not found with PCA. Although, the factor 2 indicated by PCA still favors using a higher dictionary size for the healthy class. One reasoning behind this failure might be the inability of PCA to analyze the non-linearity in the data. The intrinsic dimensionality estimation for this highly non-linear data could be further point of investigation.

Extending the training database

We are aware that we do not have a very large population for training. To investigate if the size of the training data has any effect on the classification results, we incorporated longitudinal database into our analysis. MR volumes are acquired for each patient, at time points M0, M3 and M6, with an interval of three months. As the lesions evolve over the course of time, some lesions might disappear partially or fully, and there might be some newly appearing lesions. It is therefore fair to consider that each dataset at consecutive time point would result in adding different lesion patterns in the training procedure. Thus, we modified the training data, for each patient, in two ways: (1) Data at time-points M0 and M3, with 24 datasets and (2) Data at time-points M0, M3 and M6, with 36 datasets. However, the lesion classification experiments for the same test subjects, as in previous experiments, using class specific dictionaries with 5000 and 1000 atoms for the healthy and lesion class respectively, did not show any significant improvement in the sensitivity and PPV. This suggests that the size of the population for training the dictionaries is not a critical issue for such approaches.

In Figures 3 and4, we show the voxel-wise classification results obtained using all methods discussed above. We arbitrarily selected a slice for the patients 4 and 6, as referred to in Table 1. It can be seen from Figure 3F that method (a) suffers with a large number of FP. The over-detections are reduced in methods (b) and (d), which use dictionaries of the same size for each class. This is indicated in Figures 3G and3I, respectively. Methods (c) and (e) further improve the classification, as shown in Figures 3H and3J, by employing the dictionaries of adapted sizes. However, the 2-class method (c) has many FN. As shown by method (e), including tissue specific information in such adaptive dictionary learning based approach results in significant improvement in the lesion classification with reduction in both FP and FN. This supports our claim that the method with the tissue specific dictionaries and adapted dictionary sizes is a better choice over the 2-class methods and those using the same dictionary size for all classes. A c c e p t e d M a n u s c r i p t

Conclusion

To automatically classify multiple sclerosis lesions, we proposed a novel supervised approach using sparse representations and dictionary learning. The methods using class specific dictionaries outperform the classification obtained using a single dictionary, in which the lesions are modeled as outliers. Learning more specific dictionaries for each anatomical structure in the brain helps improve the classification on account of specific intensity patterns associated with each of these structures in multi-channel MR images. We have also demonstrated the effectiveness of adapting the dictionary sizes for better amplification of differences among multiple classes, hence improving the classification. If performing PCA on input data can successfully adapt the dictionary size for the classification, it is not as much efficient when the classes represent more a mixture of different tissues. Knowing the limitation of PCA to handle only linear data, future work will be to use the intrinsic dimension estimation techniques, which can better analyze complexity of the non-linear data.

A c c e p t e d M a n u s c r i p t

Figure 1 :

 1 Figure 1: Flowchart of MS Lesion Classification using Dictionary Learning

A c c e p t e d M a n u s c r i p t minimum representation error. c pred = argmin c y i -D c a c i 2 2 . ( 4 ) 3 . 5 . 3 .

 24353 Two-Dictionaries: Different dictionary size (2D-D)

Figure 2 :

 2 Figure 2: Cumulative variance for different classes, plotted against the number of principal components obtained from the principle component analysis of the corresponding class data.

Figure 3 :

 3 Figure 3: Comparison of MS lesion classification methods, example 1 -patient 6, slice 164. (A) FLAIR, (B) T1-w MPRAGE, (C) T2-w, (D) PD-w, (E) Ground truth or manual lesion segmentation image (shown in red) superimposed on FLAIR, (F) Result for method (a) using single dictionary with 5000 atoms learned using the healthy and lesion class data, (G) Result for method (b) with two dictionaries containing 5000 atoms each for the healthy and the lesion class, (H) Result for method (c) with 5000 atoms for the healthy and 1000 atoms for the lesion class dictionary, (I) Result for method (d) with four class specific dictionaries with 5000 atoms each for WM, GM, CSF and the lesion classes, (J) Result for method (e) with 4000 atoms each for WM, GM and CSF class, and 2000 atoms for the lesion class dictionary. Classification image is overlayed on FLAIR MRI. Red: TP; Cyan: FP; Green: FN.

Figure 4 :

 4 Figure 4: Comparison of MS lesion classification methods, example 2 -patient 4, slice 153. (A) FLAIR, (B) T1-w MPRAGE, (C) T2-w, (D) PD-w, (E) Ground truth or manual lesion segmentation image (shown in red) superimposed on FLAIR, (F)-(J) Results of voxel-wise classification obtained using methods (a)-(e), as mentioned in Figure 3. Classification image is overlayed on FLAIR MRI. Red: TP; Cyan: FP; Green: FN.

Table 1 :

 1 Voxel-wise classification results using: (a) Single Dictionary, with 5000 atoms learned using the healthy and lesion class data, (b) Two class specific dictionaries with 5000 atoms each for the healthy and the lesion class, (c) 5000 atoms for the healthy and 1000 atoms for the lesion class dictionary, (d) Four class specific dictionaries with 5000 atoms each for WM, GM, CSF and the lesion classes, (e) 4000 atoms each for WM, GM and CSF classes, and 2000 atoms for the lesion class dictionary.

	. The brain tissue segmentation is obtained using Statistical
	7

Table 2 :

 2 Effect of dictionary size in voxel-wise classification of MS lesions. The leftmost column indicates the dictionary size for each healthy tissue -WM, GM and CSF, whereas the topmost row indicates the dictionary size for the lesion class. The sensitivity and PPV values for each combination of dictionary size for the tissue and lesion classes are indicated in the corresponding entries of the table. The entries in italics on the diagonal of the table from top-left to bottom-right refer to method (d), which uses the same dictionary size for all classes, where as all other entries represent method (e) with different dictionary sizes for the tissues and the lesion class.

			500	1000	2000	3000	4000	5000
		SEN PPV SEN PPV SEN PPV SEN PPV SEN PPV SEN PPV
	500	81.1 17.2	94.9	5.2	98.6	2.5	99.2	2.2	99.4	2.2	99.5	2.1
	1000	58.3	43.7	81.8 19.7	94.5	6.8	97.2	3.9	98.0	3.0	98.5	2.6
	2000	32.7	65.2	60.9	44.1	82.1 22.9	89.8	13.3	93.4	8.8	95.3	6.5
	3000	19.2	72.2	46.8	56.2	71.4	36.4	82.1 25.1	87.0	18.1	90.4	13.6
	4000	12.7	76.2	36.9	63.3	63.2	45.3	75.2	34.1	81.3 26.7	85.5	21.3
	5000	8.9	79.5	30.0	67.5	56.9	51.1	69.2	40.5	76.2	33.4	81.3 28.0

Table 3 :

 3 Principal component analysis of the training data for an arbitrarily selected patient. For each class mentioned in a row, an entry in the table denotes the number of eigen-vectors required to attain the percentage of total variance indicated in each column.

		95% 98% 99%
	WM	46	106	167
	GM	86	156	207
	CSF	60	140	209
	Healthy	63	143	208
	Lesion	31	71	121

≤ ε, where a 0 is l 0 norm of the sparse coefficient vector a ∈ R K and ε is error in the signal representation. The efficient solvers for sparse coding include matching pursuit, orthogonal matching pursuit and basis pursuit, where