Angela Manas

Mathieu Sperandio
email: sperandio@insa-toulouse.fr

François Decker

Béatrice Biscans

A Mañas

M Spérandio

Location and chemical composition of microbially induced phosphorus precipitates in anaerobic and aerobic granular sludge

Keywords: anaerobic granules, aerobic granules, UASB, dairy wastewater, biomineralization, microbially induced precipitation

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

Introduction

Nitrogen and phosphorus are responsible for eutrophication, which affects more than 50% of lakes and reservoirs worldwide [START_REF]Water Research Commission Report, Water Wheel[END_REF]. High-strength wastewaters generated by the agro-food industry contribute significantly to this phenomenon. Because of its high biodegradable-organic content, this type of wastewater is an ideal candidate for intensive biological treatment based on granular sludge, either anaerobic or aerobic [START_REF] Lemaire | Development and fundamental investigations of innovative technologies for biological nutrient removal from abattoir wastewater[END_REF]. Upflow anaerobic sludge blanket (UASB) reactors based on granular sludge have been reported to be robust, efficient systems for reducing the high organic loads that the agro-food industry produces [START_REF] Lettinga | Use of the upflow sludge blanket (USB) reactor concept for biological wastewater treatment, especially for anaerobic treatment[END_REF]. However, anaerobic digestion is not effective for nutrient removal and should be followed by a process dealing with nitrogen and phosphorus. Anaerobic effluents are rich in ammonium due to the hydrolysis of proteins, and need further treatment by conventional biological nitrification/denitrification or by partial nitrification combined with the Anammox process. Precipitation of phosphorus in the form of struvite (magnesium ammonium phosphate) is feasible in a crystallizer reactor with reagent dosing. MgCl 2 , MgOH or NaOH are usually required in specific crystallization reactors for struvite precipitation because dairy wastewater effluents are usually deficient in Mg 2+ compared with NH + 4 or PO 3- 4 . In our case, [Mg 2+ ] in dairy effluents was between 10-20 mg/L. Considering that, for struvite precipitation, the stoichiometry is 1 mol Mg 2+ to 1 mol of NH + 4 and 1 mol of PO 3- 4 , the lack of Mg 2+ limits the precipitation of struvite relative to other phosphate minerals. Thus reagents are used because effluents are usually deficient in Mg and strict control of the pH is required [START_REF] Van Rensburg | Modelling multiple mineral precipitation in anaerobic digester liquor[END_REF]. Aerobic granular sludge in sequenced batch reactors (GSBR) has been developed more recently, and it has proved its ability to withstand high organic loads and perform simultaneous nitrogen and phosphorus removal [START_REF] Liu | The essential role of hydrodynamic shear force in the formation of biofilm and granular sludge[END_REF][START_REF] De Kreuk | Simultaneous COD, nitrogen and phosphate removal by aerobic granular sludge[END_REF]. For example, biological phosphorus removal was successfully performed in a granular sludge process treating effluent from a slaughterhouse [START_REF] Yilmaz | Effectiveness of an alternating aerobic, anoxic/anaerobic strategy for maintaining biomass activity of BNR sludge during long-term starvation[END_REF].

Since industrial wastewaters also contain significant amounts of dissolved salts, precipitation can be observed in granular sludge processes. On the one hand, solid precipitation can be disadvantageous for granular sludge as it can reduce biological activities, increase the energy needs for mixing, and clog pipes [START_REF] Van Langerak | Impact of location of CaCO3 precipitation on the development of intact anaerobic sludge[END_REF][START_REF] Borgerding | Phosphate deposits in digestion systems[END_REF]. On the other hand, phosphate precipitation can constitute a removal process functioning in synergy with biological P removal [START_REF] Mañas | Etude de la précipitation du phosphore induite par réaction biologique dans un procédé de traitement d'effluent industriel par granulation aérobie[END_REF]. Hence, for different positive and negative reasons, these processes need to be controlled and predicted as accurately as possible. Both types of granules (aerobic and anaerobic) consist of macroaggregates made up of a wide range of different bacterial consortia, which can induce local pH and ion concentration gradients, leading to mineral precipitation inside the granules [START_REF] Wan | Alternating anoxic feast/aerobic famine condition for improving granular sludge formation in sequencing batch airlift reactor at reduced aeration rate[END_REF][START_REF] Mañas | Phosphorous recovery by inducing mineral phosphate precipitation in aerobic granular sludge process[END_REF]. A variety of analytical techniques (Raman spectroscopy, scanning electron microscopy and energy dispersive X-ray analysis (SEM-EDX), X-ray diffraction and chemical extractions) have been applied to aerobic granules from a GSBR. They revealed that calcium phosphate precipitated inside granules in the form of hydroxyapatite (Ca 5 (PO 4 ) 3 (OH)), causing up to 46% of the total P removal in the process [START_REF] Mañas | Biologically induced phosphorus precipitation in aerobic granular sludge process[END_REF]. Calcium carbonate precipitation inside aerobic granules has also been demonstrated with SEM-EDX analysis [START_REF]Calcium carbonate precipitation in anaerobic waste water treatment[END_REF][START_REF] Ren | Calcium spatial distribution in aerobic granules and its effects on granule structure, strength and bioactivity[END_REF][START_REF] Wang | A new way to cultivate aerobic granules in the process of paper-making wastewater in a sequencing batch reactor[END_REF], but little information on its formation and location is provided in the literature. In the field of anaerobic granules, Langerak investigated the parameters that could control the location of calcium carbonate either in the liquid phase or in the microbial biofilm of the granules [START_REF] Van Langerak | Influence of phosphate and iron on the extent of calcium carbonate precipitation during anaerobic digestion[END_REF].

Precipitation of phosphate minerals has been mainly investigated through analyses of the ash content of granular sludge but, as far as we know, no exhaustive local or chemical analyses have been conducted [START_REF] Van Langerak | Impact of location of CaCO3 precipitation on the development of intact anaerobic sludge[END_REF][START_REF] Van Langerak | Influence of phosphate and iron on the extent of calcium carbonate precipitation during anaerobic digestion[END_REF][START_REF] Bhatti | Comparative composition and characteristics of methanogenic granular sludges treating industrial wastes under different conditions[END_REF]. Moreover, the prediction of this phenomenon using geochemical models and a thermodynamic database for precipitation has not yet been evaluated. Knowledge of the biomineralization phenomena inside granules and their further control is also important regarding the value-added use of sludge, as well as the long-term stability of UASB and GSBR, which is a problematic issue in these processes.

Therefore, this work is specifically dedicated to the study of the solid mineral compounds found in granular sludge processes (aerobic and anaerobic) applied in highstrength wastewater treatment. A set of characterization analyses was carried out on different granule samples collected in different anaerobic (UASB) or aerobic (GSBR) processes treating dairy or synthetic wastewaters, respectively. The nature and location of the bio-precipitation process was investigated and its pros and cons will be pointed out. In an attempt to explain how the supernatant conditions can affect bio-precipitation, the characteristics of the wastewaters were analysed extensively and PHREEQC modelling software was used to calculate the saturation indexes (SI) of the minerals involved.

Materials and methods

Solid characterization and sample preparation

Anaerobic granule samples from three different UASB reactors treating wastewaters produced by cheese factories in southern France were studied. They are referred to as industrial sites 1, 2 and 3. Anaerobic granules came from the anaerobic digester mixed liquor separated from the supernatant by settling (5 min). No purge was made between start-up and the time granule samples were taken; hydraulic retention times (HRTs) were 5, 5 and 2.6 days and organic loading rates (ORLs; kgCOD m -3 d -1 ) were 8.5, 8 and 8 kgCOD m -3 d -1 for sites 1, 2 and 3, respectively.

Aerobic granules were sampled from two different GSBR processes (at the end of the aerobic reaction phase) fed with synthetic wastewater. Granular sludge had been inoculated more than 1 year before sampling, and the processes were operated for more than 100 days with different operating conditions: in anoxic/aerobic batch cycles for Laboratory_R1 and anaerobic/aerobic cycles for Labora-tory_R2. The latter was seeded from R1 for quick start-up, as described elsewhere [START_REF] Liu | Startup of pilot-scale aerobic granular sludge reactor by stored granules[END_REF]. OLRs and HRT were identical in both aerobic reactors: 3 KgCOD m -3 h -1 and 8.5 h, respectively. GSBR cycles were composed of a 15 min feeding, 20 min anoxic or anaerobic (mixed with nitrogen gas blowing) period, a 145 min aerobic period, 30 min settling and 30 min withdrawal. More details concerning the reactor operating conditions can be found elsewhere [START_REF] Wan | Alternating anoxic feast/aerobic famine condition for improving granular sludge formation in sequencing batch airlift reactor at reduced aeration rate[END_REF]. Granules were classified according to their size and colour, as described in Iqbal Bhatti et al. [START_REF] Bhatti | Comparative composition and characteristics of methanogenic granular sludges treating industrial wastes under different conditions[END_REF]. Granule samples are shown in Figure 1, and Table 1 summarizes their characteristics. Owing to the great heterogeneity of granules from industrial sites (different colours and sizes), three granules were analysed for each type of aggregate according to their colour: grey, brown, black or white. Conversely, aerobic granules were homogeneous and more than 10 granules were collected from each aerobic reactor, showing All granules sampled were cut into 100 μm slices with a cryo-microtome (Leica CM 30505 Kryostat) and then analysed with a photon X analyser (Quantax Technology Silicon Drift) which was coupled with a scanning electron microscope.

The EDX probe was directed onto at least seven different locations in each granule section (see green marks in Figure 2) in order to ensure the repeatability of the results. The ash content of granules was measured according to standard methods. Samples were taken in triplicate for each site and were washed with distilled water to ensure that the supernatant did not interfere in the measurement.

Characterization of liquid phases and calculation of saturation index

The influent and effluent of each reactor were characterized according to standard methods [START_REF] Afnor | Recueil des normes françaises: Qualité de l'eau[END_REF]. The analytical results provided the input data for the geochemical software PHREEQC ® version 2.17, which was used to calculate the concentration of the chemical species in equilibrium for each liquid phase (acid, base, ion pairs). The SI for each mineral under study was calculated according to Equation (1), which considers the term j (in contrast to the default calculation with PHREEQC ® ) representing the number of ions contained in the mineral formula concerned [START_REF] Paraskeva | Sandbed consolidation with mineral precipitation[END_REF][START_REF] Montastruc | Modélisation et optimisation d'un réacteur en lit fluidisé de déphosphatation d'effluents aqueux[END_REF].

SI = log IAP K sp 1/j ( 1
)
where IAP is the ionic activity product of the ion activities involved in the mineral precipitation, and K sp refers to the thermodynamic mineral precipitation constant at a given temperature. Deviation from the default database (Minteq v4) was proposed in order to include the thermodynamic data of some important minerals: struvite (MAP), amorphous calcium phosphate (ACP), hydroxydicalcium phosphate (HDP) and magnesium whitlockite (MWH) as shown in Table 2 [START_REF]NIST database: Searchable bibliography of Fundamental Constants[END_REF][START_REF] Wang | Modeling chemical and phase equilibria in geochemical systems using a speciation-based model[END_REF][START_REF] Shellis | Apparent solubility distributions of hydroxyapatite and enamel apatite[END_REF][START_REF] Ohlinger | Predicting struvite formation in digestion[END_REF][START_REF] Murray | Joint Expert Speciation System (JESS). An international computer system for determining chemical speciation in aqueous and non-aqueous environments[END_REF][START_REF] Frèche | Contribution à l'étude des phosphates de calcium[END_REF][START_REF] Maurer | Kinetics of biologically induced phosphorus precipitation in wastewater treatment[END_REF].

Results

Wastewater and process characteristics

The influent and effluent of each reactor were analysed and characterized as described in section 2, and the results are shown in Table 3. The processes could be considered to have reached the steady state as they had been operating for more than 1 year before the sampling period. All the bioreactors showed high organic removal efficiency, as more than the 95% of the chemical oxygen demand (COD) was removed in these systems. Whey and dairy wastewaters are rich in phosphate and proteins, reflected by a high organic nitrogen content [START_REF] Demirel | Anaerobic treatment of dairy wastewaters: A review[END_REF]. In anaerobic digesters, proteins are hydrolysed, explaining the decrease of COD and volatile suspended solids (VSS) and the increase of ammonium concentration in the effluents of each site.

In the aerobic reactors, organic compounds were oxidized to carbon dioxide, and ammonium was converted into nitrite and nitrates (nitrification), which were further converted into gaseous N 2 (denitrification). Phosphates were partially removed by enhanced biological phosphorus removal (EBPR).

Alkalinity increased in the anaerobic reactors during methane production and in the aerobic reactors during the denitrification processes. This contributed to the pH rise, which was also encouraged by stripping processes (carbon dioxide) in the aerobic reactors. Phosphate removal was observed in all the systems, probably due to precipitation processes in the anaerobic reactors, whereas both precipitation and biological phosphorus removal were shown to occur in the aerobic reactors [START_REF] Mañas | Biologically induced phosphorus precipitation in aerobic granular sludge process[END_REF].

For all sites, the mineral content of the suspended solids was higher in the effluent than in the influent and, simultaneously, calcium concentration in the liquid decreased in all the systems.

The high quantity of suspended solids in UASB processes was linked with the high mineral content (42.6-80%). In these reactors, mineral content seemed to be correlated to pH: the highest pH, for site 2, corresponded to the highest mineral content (80%); the lowest pH, for site 1, corresponded to the lowest mixed liquor mineral content (42.6%). Microscopic observations of the anaerobic effluent from site 2 showed that precipitated particles were visible in the reactor liquid phase (results not shown). In contrast, no minerals were found in the supernatant of the aerobic reactors. Finally, the ash content (sludge mineral fraction, SMF) of the different granules has been quantified in Table 3, indicating that, in aerobic systems, the quantity of minerals embedded in granules is strongly influenced by the process, as illustrated in GSBR 1 and GSBR 2: both reactors had similar mineral fractions in the mixed liquor (33.7% and 38.7%, respectively), but GSBR 2 had a higher (doubled) mineral content in the granules. At the same time, this Table 2. Thermodynamic constants of the main minerals considered for this study (modifications on the Minteq v4 database are indicated).

Parameter

Chemical formula Ksp value in modified database Ca/P C a /O M g /P CAL CaCO 3 6.35 [23] for Ic>0.02 8.48 [23] for Ic<0.02 -0.33 -ARAG CaCO 3 8.3 [24] -0.33 -DOL (ordered) CaMg(CO 3 ) 2 17.09 [ * * ] -0.17 -MWH* Ca 18 Mg 2 H 2 (PO 4 ) 14 104.4 [25] MAP* MgNH 4 PO 4 :6H 2 0 13.26 [26] --1.00 NEW MgHPO 4 :3H 2 O 5.8 [23,27] DCPD CaHPO 4 : 2H 2 O 6.62 [23] 1.00 0.25 -DCPA CaHPO 4 6.9 [28] 1.00 0.25 -OCP Ca 8 (HPO 4 ) 2 (PO 4 ) 4 ):5H 2 O 49.6 [28] 1.33 0.33 -HDP* Ca 2 HPO 4 (OH) 2 [START_REF] Montastruc | Modélisation et optimisation d'un réacteur en lit fluidisé de déphosphatation d'effluents aqueux[END_REF].60 [29] 2.00 0.33 -ACP* Ca 3 (PO 4 ) 2 :xH 2 O 28.92 [23] 1.50 0.38 -TCP Ca 3 (PO 4 ) 2 32.63 [27] 1.50 0.38 -HAP Ca 5 (PO 4 ) 3 (OH) 58.33 [23,26] 1.67 0.38 reactor was the one in which the EBPR process was most remarkable [START_REF] Mañas | Study and modelling of phosphorus removal and recovery processes for agro-food wastewater treatment and valorization with aerobic granules[END_REF]. In anaerobic sites, the sludge ash content was also different, varying from 28-81%. In UASB where SMF achieved the highest values (sites 1 and 2), removal efficiency problems were reported and the reactors needed to be re-seeded.

Analysis of mineral bioliths in granules

Figure 2 shows the SEM images taken from the different sectioned granule samples. SEM and EDX probes testing at different locations on the samples confirmed that almost all of the granules (except two: the black ones) presented inorganic mineral concretions. These precipitates were easily detectable due to their geometrical shape, brightness and low organic matter content. In the photographs, crystallized minerals appear lighter than the organic fraction. They were mainly observed inside the granules but, in some cases, precipitates were formed at the surface, as in Figure 2a and2b, in which a mineral layer envelops the anaerobic microbial granule. Finally, samples shown in Figure 2e and 2h did not present any sign of mineral deposition either embedded in, or surrounding, the bio-aggregate. Bioliths found in the anaerobic granules were randomly distributed (Figure 2c, 2d, 2f, 2g, 2i and 2j), although they formed a biofilm of at least 400 μm beyond the aggregate surface. The bioliths in aerobic granules (Figure 2k-2p) constituted a large solid fraction centred on the core, at least 300 μm from the surface layer for Figure 2k and2l, and 800 μm for Figure 2m-2p.

In the case of the granules in Figure 2a and 2b, the mineral shell that covered the aggregates was around 400-800 μm thick on average, which represented a considerable fraction of the minerals present, probably affecting the diffusion of nutrients and bacterial activity.

Analyses were carried out with EDX probes directed at the mineral clusters (marked with small crosses), revealing the major element composition and indicating the nature of the mineral formed (Table 4). A number of local analyses (at least seven) were carried out for each granule at different locations in the mineral clusters. Average values and standard deviations are shown in Table 4.

It was clear that, after oxygen, calcium was the major constituent of the mineral fraction, varying from 22-49% for anaerobic granules and from 17-38% for aerobic granules. The other major constituent was phosphorus, except for the granules collected in UASB reactor 2. Phosphorus content varied from 0.06-24% and from 7-15% for anaerobic and aerobic granules, respectively. The magnesium content of the clusters was smaller (<1%) and nitrogen was sparsely found in variable concentrations (0-4%) in some granules.

The data indicate that the molar Ca:P ratio varied from 1.25-1.68 in the different granules (except for those from site 2, in which no significant amounts of phosphorus were found). These values are evocative of several calcium phosphates with varying theoretical Ca:P ratios: octacalcium phosphate [Ca 8 (HPO 4 ) 2 (PO 4 ) 4 ):5H 2 O] (OCP) (1.33); amorphous calcium phosphate [Ca 3 (PO 4 ) 2 : xH 2 O] (ACP) (1.5); tricalcium phosphate [Ca 3 (PO 4 ) 2 ] (TCP) (1.5); and hydroxyapatite [Ca 5 (OH)(PO 4 ) 3 (OH)] (HAP) (1.67). For some samples, Ca:O ratios were also of the same order of magnitude as theoretical values of calcium phosphate or calcium carbonate (0.33-0.38, see Table 2), but the Ca:O ratio showed much greater variation than that of Ca:P, making its interpretation more difficult.

The solid phase most probably formed in the granules, according to their Ca:P and Ca:O molar ratios, are suggested in the last column of Table 4. Calcium phosphates ACP, TCP, HAP were the most probable solids in the granules, except for those from UASB 2, which seemed to contain calcium carbonate (Aragonite [CaCO 3 ] (ARAG) or calcium carbonate, calcite [CaCO 3 ] (CAL)). Almost all the aerobic granules had Ca:P ratios close to that of HAP, except for one sample from GSBR-2, in which the Ca:P ratio was closer to ACP (or TCP). As ACP and TCP are both possible precursors of HAP, further work [START_REF] Mañas | Parameters influencing calcium phosphate precipitation in granular sludge sequencing batch reactor[END_REF] revealed that ACP was the hydroxyapatite precursor in aerobic granules. At the anaerobic sites, results showed heterogeneity in the chemical composition of the different granules sampled for each site. Granules from anaerobic sites were different in colour and size (see Table 1), and the nature of minerals found inside aggregates were also different in a given reactor. For instance, at site 1 we found different granules containing calcium carbonate and calcium phosphates. At site 2, all granules containing mineral bioliths appeared to be made up of calcite or aragonite. Anaerobic granules from site 3 all contained calcium phosphates, probably ACP or TCP.

Calcium phosphate distribution during granule

growth: the case of GSBR By focusing on the granular sludge from aerobic systems (GSBR), it was observed that small granules were continuously generated in the reactor and grew progressively with microbial activity (this process is much slower in the case of anaerobic methanogenic bacteria, whose growth rate is more than 10 times lower than those of aerobic bacteria). Therefore, different aerobic granules with different sizes were sampled from two GSBR reactors (R1 = site 4, and R2 = site 5), assuming that the biggest granules would be more mature than the small ones. Only the central sections are shown in Figure 3, illustrating the evolution of the mineral formation inside the microbial aggregates from small granules to mature ones.

It can be noted that the solid mineral precipitated in the centre of the small granules and increased progressively, at the same time as microbial biofilm developed at the surface of the granule. In the biggest granules, successive rings of mineral were finally visible, indicating past growing periods (reminiscent of the rings of a tree trunk). Different mature granules from both reactors presenting a mineral ring-distribution were analysed with an EDX probe, as shown in Figure 4.

A detailed analysis with EDX probes was performed in two different zones of the mineral core of the granules: in the central zone and in the external rings, as indicated in Figure 4. The results show that mineral precipitates had slightly different compositions in the inner part compared with the external layer. In the granule shown in Figure 4a, the mean value of Ca:P ratio of the internal layer was close to that of HAP (1.69 ± 0.19) whereas the mineral in the outer layer showed a lower mean Ca:P ratio of 1.52 ± 0.20, close to that of the precursor ACP (theoretical Ca:P = 1.5). In the second example, shown in Figure 4b, there are three concentric layers. A lower Ca:P ratio was found in the outer layer of mineral (1.29 ± 0.05) whereas the inner part had a Ca:P molar ratio of 1.50 ± 0.16.

These results indicate a possible conversion from calcium phosphate precursors with lower Ca:P ratio (ACP, TCP or OCP) to the more stable calcium phosphate hydroxyapatite (HAP), with the highest ratio found in the centre (theoretical Ca:P ratio = 1.67). These results are consistent with the traditional idea that HAP formation is not the result of spontaneous nucleation but of a progressive conversion of less-stable calcium phosphates, indicating that a minimal retention time in the granule is necessary to convert the precursor phases (probably ACP, TCP, or OCP) into HAP.

Calculation of saturation index in the different reactors

The SI of the minerals that could precipitate were calculated with PHREEQC software according to the liquid composition of each reactor stream. The pH and temperature values used in the calculations were those of the reactor outputs. It was assumed that the conditions inside each reactor were similar to those of the outlet if proper mixing was imposed in the reactor, which, considering the different scale, is more realistic in the case of laboratoryscale reactors (sites 4 and 5) than in the full-scale UASB reactors (sites 1, 2 and 3).

The results (shown in Table 5) indicate the compounds with a positive SI, which were likely to precipitate. Concerning calcium phosphate, results confirmed that HAP, ACP, TCP and ordered dolomite (DOL) were systematically supersaturated in all the samples, which is in accordance with the analysis of the solid phase.

Calculations also showed that MAP was under-saturated in all the reactors, as were newberite [MgHPO 4 : 3H [CaHPO 4 ] (DCPA), both precursors of HAP, were found to be supersaturated in some anaerobic reactors but not in aerobic ones (GSBRs). Calcium carbonates, be they calcite (CAL) or aragonite (ARAG), were supersaturated in most of the systems, except for UASB 1. The highest SI value achieved was at site 2, where calcium carbonates had been detected in the solid phase. Crystals were never observed in the supernatant of the aerobic granular sludge process, in contrast to anaerobic sites where solid crystals were detected in some samples from site 2 (results not shown here). Carbonate saturation is encouraged by the accumulation of mineral carbon produced by microbial reactions. Higher SI values were observed for anaerobic site 2, at which the pH (7.4) was slightly higher than in other anaerobic processes (sites 1 and 3). In aerobic systems, because aeration encouraged carbon dioxide stripping and nitrification consumed alkalinity, inorganic carbon concentration was lower than in anaerobic reactors. However, the relatively high pH at which both GSBRs worked explained the super-saturation of calcium carbonate at sites 4 and 5.

The SI values in the effluent indicate the mineral that is still supersaturated after the process. However, due to a long retention time and possible rapid precipitation (especially in anaerobic systems), equilibrium can be reached in the reactors, leading to a reduction of SI (stabilized around zero). Thus, the variation of SI (namely SI) was calculated between the SI calculated for outlet concentrations and the SI calculated for the inlet concentrations of the volume control (each reactor).

SI = SI effluent -SI influent

Of all the minerals included in the simulation, only those with positive SI in least one stream were considered for the SI calculation in Figure 5. Thus, a SI < 0 could indicate a possible SI decrease in the effluent due to precipitation. Although alkalinity was produced during the anaerobic processes, a decrease of SI was observed in UASB 2, which indicated that calcium carbonate should precipitate, in accordance with previous local observations.

Discussion

Nature of precipitates: consistency between the local observations and the SI SEM-EDX analysis demonstrated that calcium phosphates

were the major precipitates found in the granules, both aerobic and anaerobic. More specifically, solid composition was close to those of HAP, ACP or TCP. This was consistent with the analyses of SI in the liquid phase, indicating that these minerals were systematically saturated.

Concerning other calcium phosphate precursors, only one sample (brown-type, S 1 _ana#4) showed Ca:P and Ca:O ratios that could implicate an OCP precursor. This seems consistent with the fact that pH was the lowest at site 1, and Gao and co-workers [START_REF] Gao | Modelling ion composition in simulated milk ultrafiltrate (SMUF). I: Influence of calcium phosphate precipitation[END_REF] have reported the formation of HAP through OCP precursor at acidic pH. However, of all the calcium phosphate precursors proposed in the literature for acidic pH (DCPD, DCPA and OCP), only OCP was not observed to be saturated in the liquid phase according to PHREEQC calculations.

Calcium carbonates were only observed in some granules, mainly at site 2, coinciding with the highest pH and alkalinity values among the anaerobic sites. In the aerobic reactors, despite pH values higher than in the anaerobic ones, alkalinity was reduced by the nitrification reactions, explaining the lower carbonate precipitation potential. Carbonates are well-known competitors with phosphates for calcium binding, competing for the active nucleation and crystal growth sites [START_REF] Van Langerak | Influence of phosphate and iron on the extent of calcium carbonate precipitation during anaerobic digestion[END_REF][START_REF] Plant | Precipitation of calcite in the presence of inorganic phosphate[END_REF]. Moreover, it is known that this competition is severely influenced by pH [START_REF] House | Inhibition of calcite crystal growth by inorganic phosphate[END_REF]. Working with digester supernatant, Battistoni et al. [START_REF] Battistoni | Phosphate removal in anaerobic liquors by struvite crystallization without addition of chemicals: Preliminary results[END_REF] reported that a pH between 7.0 and 8.5 would favour phosphate precipitation, whereas a higher pH (9-11) would favour carbonates. At dissolved concentrations higher than 20 μmol/L (which is the case at all industrial sites), P is assumed to inhibit calcite or aragonite precipitation [START_REF] Plant | Precipitation of calcite in the presence of inorganic phosphate[END_REF]. In this study, P and Ca concentrations measured in the liquid phase were relatively similar in all industrial reactors but pH, and alkalinity, was slightly higher at site 2. The simultaneous presence of carbonate or phosphate in the same reactor was also possibly due to local heterogeneities. Therefore carbonate would preferentially precipitate in granules, where the microbial activity would induce the right pH for carbonate deposition (or in zones were alkalinity accumulated). In contrast with calcium precipitates, no significant magnesium phosphate or magnesium carbonate was observed in the microbial granules. The case of struvite deserves particular attention. Struvite was never found in the granules despite the high concentration of ammonium and phosphorus in the anaerobic effluents. It was thermodynamically under-saturated in all of the liquid phases of the (aerobic or anaerobic) processes studied, due to relatively low magnesium concentration in the effluents. This can also be explained by the fact that pH in the UASB was not high enough to permit struvite precipitation. In contrast, struvite crystal formation was systematically observed in the UASB supernatant sample after aeration, during which pH rose to 8 due to carbon dioxide stripping (results not shown). Therefore struvite was observed in the supernatant of UASB granular sludge only when a transient pH increase was generated [START_REF] Ohlinger | Predicting struvite formation in digestion[END_REF].

It must also be noted that either CAL or ARAG was supersaturated in the GSBR (sites 4 and 5), whereas no calcium carbonates were found in the aerobic granules. This indicated either (1) the possible effect of precipitation inhibitors (e.g. phosphates coming from the EBPR process), or (2) ARAG or CAL precipitation in another zone (reactor walls, recirculation pipes) but not in the microbial granules. Another possibility would be the precipitation of calcium carbonate in the liquid phase, with possible nucleation on suspended solids or free bacteria (flocs), but this has not been demonstrated.

Regarding precursors of HAP in aerobic granules, the SI of calcium phosphates (DCPD, DCPA, HDP, ACP, TCP and HAP) decreased in all the aerobic systems, which can be explained by the precipitation of some of these compounds, also confirmed by previous granule analysis. Similarly, in the case of the anaerobic sites, it seems that HDP precipitation is to be discarded, contrary to the assumption of Maurer et al. [START_REF] Maurer | Kinetics of biologically induced phosphorus precipitation in wastewater treatment[END_REF].

Location of mineral bioliths: a possible role of microbial reactions?

The discussions above suggest that another important aspect is the location of the inorganic deposits in the different granular sludge processes. By modelling calcite precipitation, Langerak and co-workers [START_REF] Van Langerak | Impact of location of CaCO3 precipitation on the development of intact anaerobic sludge[END_REF] established different physical or chemical conditions for operating a UASB favouring precipitation in the liquid phase rather than in granules: 1) a low Ca:Na ratio; 2) small granule diameter; 3) a high mineral crystallization rate constant; and 4) an influent [Ca2+] < 390 mg/L. In our case, information provided about the industrial effluents of the different sites and the number of samples were not sufficient to confirm most of these statements (Ca:Na, granule size, etc.). However, from a general point of view, the location of mineral crystals certainly depends on both physicochemical and biological phenomena. The major one, as stated by Langerak et al., is probably the crystallization rate constant.

It should be noted that the mineral crystallization rate of HAP is clearly lowest in calcium phosphate according to the literature, and this form was shown to accumulate in the core of granules here. In contrast, the other forms (ACP, TCP, OCP), which could be formed rapidly, were mainly observed at the periphery of aggregates, and could also be formed rapidly in the supernatant [START_REF] Mañas | Parameters influencing calcium phosphate precipitation in granular sludge sequencing batch reactor[END_REF]. A first example was provided by the 'white' granules from UASB site 1 (S1_ana#01 and S1_ana#02), in which a mineral concretion was precipitated at the surface (ACP or TCP). This was also illustrated by the detailed analysis of granules from GSBR (sites 4 and 5), revealing that Ca:P ratios similar to those of HAP were mainly found in the central part of granules whereas more unstable but more rapidly formed phases (ACP, TCP, OCP) were found at the periphery.

Precipitation can be also related to the local conditions imposed by microbial reactions. Bacterial activity contributes to biomineralization by modifying local super-saturation, because ion and proton exchanges in the environment generate some gradients within the bio-aggregates. The spatial distribution of mineral clusters in the granules seems to show that local conditions in the core of microbial granules are favourable for calcium phosphate accumulation (especially HAP). Another observation (Figure 2) is that, for granules from aerobic reactors (GSBR), precipitates (bioliths) are found in the central part of the aggregates, whereas they are randomly distributed in the granules from anaerobic processes (UASB). A possible explanation is that local microbial modification of pH, and carbonate and phosphate concentrations could encourage this precipitation.

According to microbial analysis over cross-sections of anaerobic granules [START_REF] Batstone | Multidimensional modelling to investigate interspecies hydrogen transfer in anaerobic biofilms[END_REF][START_REF] Quarmby | An examination of the structure of UASB granules[END_REF], these bacteria are stratified as follows: acidogens are located in the outer part of the granules, while acetoclastic methanogens tend to form clusters in the central part. Hydrolysis, acidogenesis and acetogenesis release protons, while methanogenesis consumes protons (0.25 mmolH + release/1 mmol acetate or H 2 uptake). These observations lead us to think that a pH increase in the environment of methanogen clusters could generate favourable conditions for precipitation.

Similarly, in aerobic granular sludge processes, whereas nitrification takes place in aerobic zones of granules, denitrification consumes protons in their anoxic zones [START_REF] Wan | Alternating anoxic feast/aerobic famine condition for improving granular sludge formation in sequencing batch airlift reactor at reduced aeration rate[END_REF][START_REF] Mañas | Phosphorous recovery by inducing mineral phosphate precipitation in aerobic granular sludge process[END_REF]. Calcium phosphate precursors initially formed at the periphery are progressively converted into a stable form (HAP) in the core. Further work would be necessary to discover how microbial reactions could modify the local pH and so play a role in this precipitation phenomenon. In addition, another possible interaction would be due to polyphosphate accumulating bacteria (PAO), whose ability to release phosphate during anaerobic periods transiently increases the calcium phosphate saturation in their environment.

Consequences of precipitation

From a general point of view, the role of biomineralization in microbial functions remains a matter of debate. Some authors maintain that it is the accidental effect of a metabolic by-product that can cause cell disruption [START_REF] Knorre | Bacterial calcification in microbial sediments[END_REF], while others are convinced that it is a specific process with ecological benefits, such as providing better strength and resistance [START_REF] Ehrlich | Geomicrobiology: its significance for geology[END_REF][START_REF] Mcconnaughey | Calcification generates protons for nutrient and bicarbonate uptake[END_REF][START_REF] Beveridge | Role of cellular design in bacterial metal accumulation and mineralization[END_REF]. Accident or not, this phenomenon is reported to contribute favourably to the bioremediation field, where several applications for ion removal from wastewaters can be highlighted: removal of heavy metals from groundwater [START_REF] Warren | Biogeochemical controls on metal behaviour in freshwater environments[END_REF], and removal of radionucleotides [START_REF] Fujita | Strontium incorporation into calcite generated by bacterial ureolysis[END_REF] and calcium [START_REF] Hammes | Strain-specific ureolytic microbial calcium carbonate precipitation[END_REF] from water.

In aerobic GSBR, the biomineralization of calcium phosphates is a side process of dephosphatation that takes place simultaneously in these aggregates, contributing to an increased settling velocity and to the P removal yield [START_REF] Mañas | Biologically induced phosphorus precipitation in aerobic granular sludge process[END_REF]. Encouraging the precipitation inside granules instead of in the liquid phase could lead to other advantages, such as the ability to control spontaneous precipitation in pipelines and on walls, thus reducing fouling and operating costs [START_REF] Borgerding | Phosphate deposits in digestion systems[END_REF]. Langerak [START_REF] Van Langerak | Influence of phosphate and iron on the extent of calcium carbonate precipitation during anaerobic digestion[END_REF] found that, in anaerobic processes, the development of a high ash content in sludge contributed to biomass cementation and stabilization, which is an important parameter for operating UASB reactors. However, this process should be accurately controlled as negative consequences have also been reported. Kettunten and Rintala [START_REF] Kettunen | Performance of an on-site UASB reactor treating leachate at low temperature[END_REF] noted losses of biomass methanogenic activity with high ash content in the sludge, constituting a deterrent for the long-term stabilization of UASB reactors. In the industrial cases studied, when precipitation took place at the surface of the aggregates the methane production efficiency decreased, and the UASB reactor had to be restarted with new granules if sludge was not extracted regularly. In our case, both UASBs containing the higher SMF sludge were found to lose removal efficiency and thus needed to be restarted with fresh granules. This stresses the importance of removal efficiency losses relative to the bioavailability losses that occur at higher mineral fractions. At aerobic site 5, the sludge mineral content was also relevant (68%), and some instability problems (VSS decrease) were noted. SEM observations of the mineral fraction of aerobic granules revealed a porous honeycomb structure as can be seen in Figure 6.

The holes in the bioliths may have been due to bacterial colonies that disappeared (the diameters of the small holes in Figure 6b are evocative of the pore sizes that would be produced by such a phenomenon) or may have been formed by gaseous metabolite exchanges (CO 2 , N 2 , etc.). Thus, a compromise should be adopted and regular granule extraction ensured in order to operate stable, efficient GSBR systems. Thermo-chemical databases can be used to estimate SIs and give an indication of the precipitation potential. Nevertheless, predicting the location of precipitation is still a complex task involving both physicochemical driving mechanisms (kinetics) and microbially induced phenomena. Two recent reviews highlight some of the proteins and enzymes involved in biogenic mineral formation in bacteria [START_REF] Weiner | Biomineralization: A structural perspective[END_REF][START_REF] De Muynck | Microbial carbonate precipitation in construction materials: A review[END_REF]. From a modelling point of view, more work will be needed before we are able to predict the exact calcium phosphate precursors that finally form HAP and to control microbially induced phosphorus precipitation (MIPP) through the operating conditions in the reactor.

Conclusions

Local analysis of mineral precipitation in microbial granules from anaerobic and aerobic reactors allowed the following conclusions to be drawn:

• Calcium phosphates were the major precipitates found in the granules. SEM-EDX analysis demonstrated that their solid composition was close to those of hydroxyapatite (HAP), amorphous calcium phosphate (ACP) or tricalcium phosphates (TCP). This was consistent with the analysis of the SI in the liquid phase, which indicated that these minerals were systematically saturated in the liquid phase. • Calcium carbonate was only found in the granules from the anaerobic UASB 2 with the highest operating pH (treating industrial wastewater). Struvite was not found in the granules and it was thermodynamically under-saturated in all the processes studied, whether they were aerobic or anaerobic. • The spatial distribution of mineral clusters in the aerobic granules seemed to indicate that local conditions in the core of microbial granules were favourable for calcium phosphate accumulation (especially HAP), whereas other minerals (such as calcium carbonates) tended to appear in the supernatant. Results also indicate that calcium phosphate precursors initially formed at the periphery were progressively converted into a more thermodynamically stable form (hydroxyapatite) on the core. These phenomena could be explained not only by differences in the crystallization kinetics but also by the local pH modification within the granules due to microbial activity (anaerobic or anoxic).

To sum up, the supernatant composition can help to predict the nature of the bioliths developed in granular sludge, but it is not the sole determining factor as it does not explain the differences found among granules grown in the same reactor. This emphasizes the role of microbial reactions in all the mechanisms contributing to the biomineralization phenomenon.

Figure 1 .

 1 Figure 1. Images of the different granules sampled from: a) GSBR Laboratory_R1; b) UASB Industrial Site 1; c) GSBR Laboratory_R2; d) UASB Industrial Site 3. Scale bar = 2 mm length.

Figure 2 .

 2 Figure 2. Scanning electron microscopy images from the granules samples. a) S 1 _ana#01; b) S 1 _ana#02; c) S 1 _ana#03; d) S 1 _ana#04; e) S 1 _ana#05; f) S 2 _ana#06; g) S 2 _ana#07; h) S 2 _ana#08; i) S 3 _ana#09; j) S 3 _ana#10; k) S 4 _aer#12; l) S 4 _aer#13; m) S 4 _aer#14; n) S 5 _aera#15; o) S 5 _aer#16; p) S 2 _aer#17. Scale bar = 800 μm for (a, b, c, f, g, i, j, k, n, o, p); 600 μm for h, e, l, m; 400 μm for d.

Figure 2 .

 2 Figure 2. (continued)

Figure 3 .

 3 Figure 3. Binocular images of central slices from different granules of GSBR, classified from smallest to largest; a) S4_aer#18; b) S5_aer#19; c) S4_aer#20; d) S5_aer#21; e) S4_aer#22; f) S5_aer#23. Scale bar is 2 mm length.

Figure 4 .

 4 Figure 4. EDX analysis of the mineral layers in granules from GSBR. a) granule from R1; b) granule from R2; c) Inner ( ) and outer ( ) layer-patterns with EDX analysis from Figure 4a.

  2 O] (NEW), MWH and OCP. Finally, brushite [CaHPO 4 : 2H 2 O] (DCPD) and phosphate dicalcic anhydrous, monetite

Figure 5 .

 5 Figure 5. Scanning electron microscopy images of aerobic granules. Scale bar = 8μm.

Figure 6 .

 6 Figure 6. SI for the different minerals that can precipitate in the different reactors considered.

Table 1 .

 1 Classification of the granules sampled.

	Diameter	Legend in

Table 3 .

 3 Characterization of the influent and effluent streams of each bioreactor.

	Site 1	Site 2	Site 3	Site 4	Site 5
	UASB	UASB	UASB	GSBR-1	GSBR-2
	anaerobic	anaerobic	anaerobic	anoxic/aerobic	anaerobic/aerobic
	Influent	Effluent	Influent	Effluent	Influent	Effluent	Influent	Effluent	Influent	Effluent

Table 4 .

 4 EDX analysis of mineral clusters found in anaerobic and aerobic granules (average values from at least seven analyses for each granule): elemental composition (percentage in mass), molar ratios, most probable solid phase.

	Ca/P	Ca/O	Mineral

Table 5 .

 5 SI values for the mineral phases calculated with PHREEQC in the effluent.

	Mineral phase	UASB -site 1	UASB -site 2	UASB -site 3	GSBR -site 4	GSBR -site 5
	ARAG	-0.09	0.44	0.18	0.23	0.20
	CAL	-1.08	-0.55	-0.81	0.33	0.29
	DOL(ord)	0.02	0.49	0.15	0.18	0.14
	MWH	-2.72	-2.50	-2.78	-2.45	-2.48
	MAP	-0.27	-0.10	-0.45	-	-0.61
	NEW	-0.37	-0.46	-0.73	-0.94	-0.98
	DCPD	0.06	0.09	-0.04	-0.18	-0.20
	DCPA	0.18	0.22	0.10	-0.03	-0.05
	OCP	-5.63	-5.27	-5.71	-5.27	-5.33
	HDP	-0.24	0.00	-0.26	0.15	0.13
	ACP	0.25	0.55	0.26	0.73	0.70
	TCP	1.04	1.32	1.02	1.45	1.41
	HAP	0.92	1.23	0.92	1.44	1.41
	Ic	0.05	0.10	0.08	0.02	0.01
	pH T( • C)	6.67 33	7.4 30	6.88 29	8.41 21	7.85 21

Acknowledgements

The authors would like to thank the VALBIO Company and especially D. Auban for his helpful contribution to this work.


Yongchao Xu

Thierry Géraud

Laurent Najman

CONTEXT-BASED ENERGY ESTIMATOR: APPLICATION TO OBJECT SEGMENTATION ON THE TREE OF SHAPES

Keywords: Ratio-cut, Tree of shapes, Level lines, Active contours, Image segmentation

Image segmentation can be defined as the detection of closed contours surrounding objects of interest. Given a family of closed curves obtained by some means, a difficulty is to extract the relevant ones. A classical approach is to define an energy minimization framework, where interesting contours correspond to local minima of this energy. Active contours, graph cuts or minimum ratio cuts are instances of such approaches. In this article, we propose a novel efficient ratiocut estimator which is both context-based and can be interpreted as an active contour. As a first example of the effectiveness of our formulation, we consider the tree of shapes, which provides a family of level lines organized in a tree hierarchy through an inclusion relationship. Thanks to the tree structure, the estimator can be computed incrementally in an efficient fashion. Experimental results on synthetic and real images demonstrate the robustness and usefulness of our method.

INTRODUCTION

In natural images, significant contours are usually smooth and have a good contrast. Following the seminal work of Mumford and Shah [START_REF] Mumford | Optimal approximations by piecewise smooth functions and associated variational problems[END_REF], finding contours is often tackled thanks to an energy-based approach, as a compromise between some internal force (regularity) and some image-driven force (image contrast along the contours, data attachment, etc.) Among the most notable methods in this class, the snakes approach [START_REF] Kass | Snakes : Active contour models[END_REF] finds a local optimum of the energy, while Chan-Vese approach [START_REF] Chan | Active contours without edges[END_REF] finds a global optimum.

It can be observed in practice that local optima are usually too local, in the sense that only information along the curve are taken into account. Conversely, a global optimum takes the whole image into account and some details can be found difficult to be included in the final result. Let us also mention that the search space for the optimal curve is quite large and depends on many parameters.

The main contribution of this paper is the design of a ratio-cut energy evaluator that takes into account some context along the curve, by looking at a couple of regions around it. This estimator aims at assessing the possibility that the curve under scrutiny is the contour of some object. It thus can be used to choose, in a set of closed curves, for the ones that best represent the objects of the scene. If the curves are organized in a tree, as it is the case for example in any hierarchical segmentation method [START_REF] Najman | On the equivalence between hierarchical segmentations and ultrametric watersheds[END_REF], the search space is reduced, and it is then easier to find the objects: they are the minima of the estimator, when compared to their children and parent.

Recently, many authors (see for example [START_REF] Caselles | Topographic maps and local contrast changes in natural images[END_REF]) claim that meaningful contours coincide with segments of the level lines of the image. The inclusion relationship of these level lines gives birth to the tree of shapes [START_REF] Monasse | Fast computation of a contrastinvariant image representation[END_REF], a complete representation of the image that is invariant to changes of contrast. In this paper, we illustrate the soundness of our estimator on this kind of tree.

There exists several works that use the tree of shapes for image simplification and segmentation. In [START_REF] Ballester | Level lines selection with variational models for segmentation and encoding[END_REF], the authors propose to remove any level lines that, when removed, decrease the Mumford-Shah energy. In [START_REF] Cardelino | Region based segmentation using the tree of shapes[END_REF], the authors remove the level lines that enclose a region similar to its parent w.r.t. an histogram-based distance. They then select interesting regions by identifying parts of the tree having an homogeneous histogram. Both methods require an information update after each removal of a non-relevant level line; such an update mechanism is a major bottleneck of those methods. In [START_REF] Pardo | Semantic image segmentation using morphological tools[END_REF], the author proposes a segmentation algorithm that selects the perceptible level lines matching some criteria: number of Tjunctions, compactness, and contrast.

Papers [START_REF] Desolneux | Edge detection by helmholtz principle[END_REF] and [START_REF] Cao | Extracting meaningful curves from images[END_REF] are the closest ones to what we propose here. The authors define the meaningfulness of a given level line using the a contrario model. Only the smallest gradient along a level line and its length are used to estimate the meaningfulness of this line, based on the computation of a number of false alarms (we will call this method "NFA" in the following). This makes their estimator sensitive to noise. In [START_REF] Cao | Extracting meaningful curves from images[END_REF], they improve the method by introducing a multi-scale approach, less sensitive to noise. In this paper, our estima-tor is scale-invariant and designed from snake-like principles. We use the average of curvature along the curve as the internal force. A key contribution is the image force we propose, which integrates some contextual information. Eventually, we show that our estimator is robust both to noise and blur. Another advantage of our method is its efficiency for it has a quasi-linear time complexity.

The rest of this paper is organized as follows. Our proposed estimator is described in Section 2. How to use it on the tree of shapes is detailed in Section 3. In Section 4, we show some experimental results on synthetic and real images, and we conclude in Section 5.

CONTEXT-BASED ENERGY ESTIMATOR

The idea of snakes or active contours [START_REF] Kass | Snakes : Active contour models[END_REF] is to evolve a curve under the influence of internal forces coming from the curve itself and of external forces computed from the input image or added by the user to impose some constraints. Those forces are mapped into the respective terms of an energy E local = αE snk int +E snk ext +βE con whose minimization drives the curve. Given an input image u and a curve ∂τ (contour of a region τ , composed of pixel edges e), those energy terms are:

E snk int = e∈∂τ |curv (u)(e)| and E snk ext = - e∈∂τ |∇u(e)|,
where curv and ∇ are respectively the curvature and the gradient of u. This energy is thus local to the curve. Other approaches such as [START_REF] Chan | Active contours without edges[END_REF] show that, thanks to a variational approach, the curve can minimize a global energy that can be for instance the cartoon segmentation model [START_REF] Mumford | Optimal approximations by piecewise smooth functions and associated variational problems[END_REF]. Given a region R, let us consider the segmentation error:

V (u, R) = p∈R (u(p) -u(R)) 2
where u(R) is the mean value of u over R. When the image is segmented into the set of regions {R i }, the cartoon functional is:

E global (u, {R i }) = i V (u, R i ) + ν L(∂R i ),
with L denoting the length of a contour. Suppose now that we have decomposed the input image u into a set of regions {τ }. We need an energy that can be computed for every regions. Such an energy can express two kinds of information: a local one, associated with the region contour ∂τ , such as the smoothness term E snk int , and a boundary one such as the gradient term E snk ext of the snake energy. We replace that boundary energy by a context one, inspired by the error term of the cartoon functional. For that, given a curve ∂τ , we define the regions R ε in (∂τ ) and R ε out (∂τ ) as the sets of points of maximal distance ε from ∂τ , respectively inside and outside of the curve. Those two regions are illustrated by Figure 3 (b). The proposed external energy is:

E ext (u, ∂τ ) = V (u, R ε in (∂τ )) + V (u, R ε out (∂τ )) V (u, R ε in (∂τ ) ∪ R ε out (∂τ ))
. This energy is low when the segmentation error is much lower for two classes than for one class, meaning that the curve is an object contour. Thanks to the numerator, it is also inversely proportional to the object contrast. Note that this contextual energy introduces some spatial information that is not naturally present in curve-based representation of an image. On a set of curves of an image, Figure 1 shows that replacing the gradient energy E snk ext by this new formulation dramatically improves the evidence of an object presence.

We also propose to modify the internal energy from the snakes approach: it is normalized to make it invariant to scale:

E int (u, ∂τ ) = e∈∂τ |curv (u)(e)| / L(∂τ ).
Now, all the curves ∂τ are valued with the energy:

E = αE int + E ext + βE con ,
where the constraint energy aims at penalizing too small objects:

E con (u, ∂τ ) = 1 / L(∂τ ).

In our experiments we take α = 60, β = 2, and ε = 5.

APPLICATION ON THE TREE OF SHAPES

The method we propose is composed of three steps.

1. First the contents of the input image is described by a tree. Many tree-based representations of an image do exist (e.g. min/max tree, hierarchies, . . .). In this paper, we use the tree of shapes [START_REF] Monasse | Fast computation of a contrastinvariant image representation[END_REF], described in Section 3.1.

2. Second our context-based energy estimator is computed for each node of this tree.

3. Last we identify the significant local minima of the energy. Each node corresponding to such a minimum is a component whose contour is the one of an object.

We first describe the tree of shapes (Section 3.1), before giving some hints aiming at an efficient implementation (Section 3.2).

The Tree of Shapes

For any λ ∈ N, the upper level sets X λ and lower level sets X λ of an image u :

Z 2 → N are defined by X λ (u) = { p ∈ Z 2 | u(p) ≥ λ } and X λ (u) = { p ∈ Z 2 | u(p) ≤ λ }.
Both upper and lower level sets have a natural inclusion structure: ∀ λ ≤ µ, X λ ⊇ X µ and X λ ⊆ X µ , which leads to two distinct and dual representations of an image, respectively the max-tree and the min-tree.

Another tree has been introduced in [START_REF] Monasse | Fast computation of a contrastinvariant image representation[END_REF]. A shape is defined as a connected component of an upper or lower level set where its holes have been filled in. Thanks to the inclusion relationship of both kinds of level sets, the set of shapes gives a unique tree, called tree of shapes. This tree features an interesting property: it is invariant to contrast changes; put differently, it is a self-dual, non-redundant, and complete representation of an image. Furthermore, such a tree inherently embeds a morphological scale-space (the parent of a node/shape is a larger shape). An example on a simple image is depicted in Figure 2.

Making the Method

For all three steps of the method, we need to deal not only with image pixels but also with contours. We thus rely on a representation that handle both pixels and pixel edges. In other words, we materialize the elements what lie in-between pixels, as depicted in Figure 3.

Tree Computation. To compute the tree of shapes, we use an algorithm (unpublished yet) very similar to the one described in [START_REF] Berger | Effective component tree computation with application to pattern recognition in astronomical imaging[END_REF]. A first pass sorts the pixels by a propagation process starting from the image boundary. Then a second pass, in reverse order, build the tree while performing the union-find algorithm. This algorithm has a quasi-linear time complexity when pixel values have a low quantization.

Contours Information Computation.

During the union-find pass, contour information can be efficiently updated. As depicted in Figure 3 (a), when performing a union of two components (resp. yellow and blue) due to adding a pixel (gray), it is easy to know how to update the contour.

Regions Information Computation. In order to calculate the regions information efficiently, we approximate the inner Energy Computation. All energy terms can be computed incrementally during the union-find pass since they can be decomposed into linear (additive and subtractive) parts. The curvature, as a linear filter, is computed for every pixel edges in a preliminary step.

RESULTS AND COMPARISON

On Figure 1, one can see that the energy that we have defined (the blue curve) is a function that evolves rather smoothly upon the tree from a node to its parent (from left, a leaf, to right, the root node). Yet there exists many local minima and only a few of them effectively correspond to object contours. We thus filter the energy function in order to get rid of spurious minima [START_REF] Xu | Morphological filtering in shape spaces: Applications using tree-based image representations[END_REF]. The results obtained by our method on a synthetic image are shown in Figure 4(f) and they are com- pared to the ones of several related approaches. The NFA approach [START_REF] Cao | Extracting meaningful curves from images[END_REF] is sensitive to noise since the method relies on the minimum value of contrast along boundaries. This defect can be observed in Figure 1 where the NFA estimate (orange curve) does not evolve regularly enough. As a consequence, selecting relevant minima is hazardous and objects are not well located; see Figures 1 and4(b). That confirms the importance of taking into account some regional information. A quantitative error comparison between NFA and our method is given in Figure 5 to depict the robustness to noise and blur of both methods.

Figure 4(c) is the result obtained by "active contour without edges" [START_REF] Chan | Active contours without edges[END_REF], with many circles as initial contours; the bottom object is missed it is too similar to the background. That problem comes from the use of a global energy: such an object is not contrasted enough w.r.t. the rest of the image.

The approach of Ballester et al. [START_REF] Ballester | Level lines selection with variational models for segmentation and encoding[END_REF] relying on Mumford-Shah functional gives pretty good results; see Figure 4(d). Unfortunately there is a false object, the triangle boundary, that does not disappear when increasing the regularization strength parameter λ; see Figure 4(e). Instead of that, an actual object disappears.

Figure 6 presents the results of our method on two natural images. On the left image, the three vehicles are successfully identified but the roof of one car is missed since it is very similar to the background. On the satellite image, the buildings and their shadows are well segmented.

We have implemented the proposed method1 using our C++ image processing library [START_REF] Levillain | Why and how to design a generic and efficient image processing framework: The case of the Milena library[END_REF], available on the Internet as free software. Processing a 512×512 pixels image takes less than 0.5 second on a regular PC station.

)Fig. 1 .

 1 Fig. 1. (a): Energy estimator on a set of curves of an image, ordered by inclusion; snake energy is depicted in green, our proposed energy is in blue, and NFA is in orange. (b) and (c): the curves corresponding to significant energy minima.

Fig. 2 .

 2 Fig. 2. An image (left) and its tree of shapes (right).

Fig. 3 .Fig. 4 .

 34 Fig. 4. Comparison with three other methods.

Fig. 5 .

 5 Fig.5. Evolution of number of falsely segmented pixels (ordinate) w.r.t. increasing noise and blur (abscissa) for the synthetic image in the Figure4(a); NFA error evolution is depicted in orange and our method error in blue.

Fig. 6 .

 6 Fig. 6. Results on classical images.

Demo available on http://olena.lrde.epita.fr/ICIP20125. CONCLUSIONThis paper presented a segmentation approach based on the set of level lines given by the tree of shapes. A major contribution of this paper is a new energy functional, well-suited to characterize object contours. We have shown that taking into account a regional context, so that the energy is neither too local nor global, improves both the relevance and robustness of object detection, as compared to three state-of-the-art approaches. Last, we end up with an efficient segmentation scheme with quasi-linear time complexity. A major perspective of our work is to demonstrate its usefulness with other tree-based representations, to extend it to color and, more generally, multi-valued images.