An object-based approach to support the automatic delineation of magnetic anomalies

The intensive use of geophysics in archaeological investigations demands new ways of fast and meaningful data interpretation. With the increasing size and complexity of magnetometer data, manual identification and delineation of magnetic anomalies becomes a time-consuming activity. In this respect, our study introduces a new approach to automate this laborious procedure, implemented as a ready-to-use tool within the eCognition software. The approach relies on a multiresolution segmenta-® tion (MRS) algorithm, which is applied on a single layer containing magnetic values. Magnetic anomalies are automatically identified and delineated at three levels of scale. Magnetic anomalies are thus classified as potential archaeological features. The degree of departure from a normal distribution is adjustable at 0.5 and 1 standard deviation (SD), respectively. The approach was tested on magnetometer images of a buried medieval village in the west of Romania. The data were acquired along parallel profiles covering six squares of 100 m × 100 m each. We have deliberately selected this magnetic map because it is not the top in terms of magnetic results and it provides staggers (due to data acquisition in 100 m grids) to show that if this algorithm works on this magnetic map, it will work defiantly on those where archaeological structures/anomalies are even more regulated. The tested scenes indicated accurate results, displaying positive-and negative-valued magnetic anomalies with levels of detail almost similar to manually delineated anomalies. Our approach is simple to apply. Being implemented as a customized process for the eCognition ® software, the tool attached to the article repository has a significant potential to support interpretation of any type of image obtained through geophysical measurements and we consider it an aid for large-scale surveys.


| INTRODUCTION
Due to the fast development of technologies and instruments, the use of geophysical surveys in archaeology has become indispensable and even less expensive than archaeological excavation (Cardarelli & Di Filippo, 2009). Ultimately, the multidisciplinary approach represents not only a truly helpful instrument for archaeologists, but a precious resource for the administrative departments dealing with the protection of historical heritage as well.
Within the context of non-invasive archaeological research, magnetometer survey is a widely used method, with relevant and sometimes even spectacular results. Grosso modo, this method measures the Earth's magnetic field variations in the proximity of the surface. However, the use of fire, production of ceramics and bricks, processing of metals or certain biological processes that modify the chemical composition of soil create local magnetic anomalies detectable by magnetometers (Kvamme, 2006). The collected data will be processed into magnetograms, i.e. maps of magnetic values across a prospected area.
A magnetic investigation produces a variety of results, from a very sharp delimitation of buried structures to blurry images able only to detect the position, form or the structure of an interesting element inside an archaeological site.
For many years researchers have consider various techniques in 'terracing' the magnetometer data and trying to transform the magnetic values into homogeneous regions (Cordell & McCafferty, 1989).
Recently, advances in this field were made by Florio and Lo Re (2018) using clustering techniques by creating algorithms allowing an automatic selection of number and the centre value of each class. Similar techniques were used for automatic classification of electrical resistivity tomography (ERT) data (Ward, Wilkinson, Chambers, Oxby, & Bai, 2014).
Image segmentation is currently employed to automate identification and delineation of target objects from raster datasets as for instance magnetic resonance imaging (MRI) (García-Lorenzo, Francis, Narayanan, Arnold, & Collins, 2013) or satellite imagery (Hay, Castilla, Wulder, & Ruiz, 2005). A plethora of image segmentation techniques and algorithms have been designed [for a comprehensive review see Vantaram and Saber (2012)], which basically aim at partitioning raster data into relatively homogeneous regions. Ideally, these homogeneous regions (also known as image objects or segments) are faithful representations of the target objects. In the last decades, geographical object-based image analysis (GEOBIA) has emerged as a discipline devoted to automation of extracting geospatial information from raster data (Blaschke et al., 2014;Hay & Castilla, 2008).
While (semi)automated alternatives to manual delineation are relatively well-established in other fields, archaeology has only recently begun adopting them (Davis, 2019;Traviglia & Torsello, 2017). Such techniques have proved useful in several archaeological branches as airborne laser scanning (Cerrillo-Cuenca, 2017;Davis, Lipo, & Sanger, 2019;Freeland, Heung, Burley, Clark, & Knudby, 2016;Inomata et al., 2017;Sevara & Pregesbauer, 2014;Wang, Hu, Wang, Ai, & Zhong, 2017;Witharana, Ouimet, & Johnson, 2018), predictive modelling (Verhagen & Dr aguţ, 2012), detecting looting activities (Agapiou, Lysandrou, & Hadjimitsis, 2017;Lasaponara & Masini, 2018), and feature classification (Magnini & Bettineschi, 2019;Sevara & Pregesbauer, 2014). We have identified only two studies devoted to automating anomaly extraction from magnetometer data with the help of image segmentation techniques. Salguero, Prat, Moreno, and Romero (2011) employed a mean shift algorithm to segment magnetic anomalies from a magnetic survey carried out in Gilena (Seville province, Spain). This study showed that a mean shift algorithm is a useful alternative to k-means, as it does not require a priori knowledge of the number of classes that occur in the image. As mean shift is a 'spatially blind' algorithm, i.e. segments only in the attribute space (Vantaram & Saber, 2012), a spatial contiguity of the resulting objects is not expected; it remains to be determined whether and to which degree the lack of a spatial constraint impacts the segmentation of magnetometer images. Pregesbauer, Trinks, and Neubauer (2014) segmented magnetometer data surveyed at Kleinrötz (Lower Austria) and found that an object-oriented approach can classify archaeological anomalies with an accuracy of 93% (the accuracy matrix of features).
While the potential of segmentation to automate the analysis of magnetometer data has been clearly demonstrated in the cited works, operational solutions or clear methods are still missing in archaeology.
This study is introducing a methodology to automate classification of magnetic anomalies from magnetometer surveys of archaeological sites. Based on this methodology, we propose a 'ready-to-use' tool that processes magnetograms and exports the classified anomalies as vectors compatible with any geographic information system (GIS).

| STUDY SITE AND DATA
The study was conducted on the best preserved medieval village in south-western Romania, Malşoc 'Turkish ditch' (Figure 1.) The detailed geophysical approaches (data acquisition, data processing) and the archaeological interpretation of the study site were published in Hegyi, Urdea, Floca, Ardelean, and Onaca (2019). The geophysics allowed us to associate this site with a medieval village mentioned at the beginning of the fourteenth century named Machalaka. The geophysical outcomes are important for the local history because, as we stated before, highlighting what could be the first controlled attempt for village systematization in Banat Region, south-western Romania (Hegyi et al., 2019).
The magnetic map is the result of the interpolation process of the magnetic data collected with a total field magnetometer G858 from Geometrics within six gridseach grid covering 1 ha. The points were acquired with two sensors in horizontal configuration at a distance of 1 m. Each sensor recorded the variations of the total magnetic field at a height of about 30 cm above ground. The dynamic of magnetic data from Figure Figure 1 was set between −16 nT (white) to 16 nT (black).
Each anomaly displayed in Figure Figure 1(c) represent an archaeological feature related to the fortified structure and also to the extent of the medieval village (Hegyi et al., 2019). For producing the magnetic map a few steps were followed in MagMap, MagPick, TerraSurveyor and Surfer: (a) merging the grid data; (b) deslope; (c) zero-mean travers; (d) high-pass filter (Hegyi et al., 2019).
We have deliberately selected this magnetic map because it is not the top in terms of magnetic results and it provides staggers (owing to data acquisition in 100 m grids) to show that if this algorithm works on this magnetic map, it will work defiantly on those where archeological structures/anomalies are even more regulated.

| METHODS
The approach includes image segmentation, classification, computer implementation, and accuracy assessment.
Our method represents a way to delineate the anomalies within an image derived from geophysical data and does not interact directly with the raw data obtained in the field. In this respect, it is very important to apply the method on the final image obtained after a thorough processing of the magnetometer data. Also knowing the geophysical nature of the data represented in the processed images is an important step due to the complexity of associating magnetic anomalies with archaeological features. In other words, to obtain an accurate representation of the anomalies within an image to be later on delineated with the method we propose the user should refer to the vast literature in the field of the magnetic measurements in archaeology (Aitken, 1958;As andulesei, 2011;Aspinall, Gaffney, & Schmidt, 2008;Campana & Piro, 2008;Eppelbaum, 2011;Fassbinder, 2015;Gaffney & Gater, 2003;Kvamme, 2006;Linington, 1963;Lowrie, 2007;Milsom, 2003;Reynolds, 2011;Schmidt et al., 2015;Scollar, Weidner, & Segeth, 1986;Von Frese & Noble, 1984).

| Image segmentation
A multiresolution segmentation (MRS) algorithm (Baatz & Schäpe, 2000), as implemented in the eCognition ® software (Trimble Inc., 2015), was employed to partition the image into homogeneous regions. MRS grows adjacent pixels into objects as long as a homogeneity threshold is not exceeded. Homogeneity is made up of both pixel values (colour) and geometric characteristics (shape), in a userdefined proportion: weighting pixel values strongly results in objects that are spectrally 'pure', while a larger weight on shape would rather homogenize the geometry of the image objects. The homogeneity threshold, called scale parameter (SP), is defined by the user and controls both internal homogeneity and size of the image objects: the larger the SP value, the larger and less homogeneous image objects would result. By setting various SP values, an image can be segmented at multiple scale levels, which can be either independent, or hierarchically integrated.
To automate the setting of the SP, a data-driven algorithm called Estimation of Scale Parameters (ESP 2) (Dr aguţ, Csilik, Tiede, & Eisank, 2014) was employed. This is an automated version of an algorithm (Dr aguţ, Tiede, & Levick, 2010) that evaluates the homogeneity of image objects based on local variance (Woodcock & Strahler, 1987) and guides the segmentation to the most statistically-significant results according to the characteristics of a given image. ESP 2 produces three scale levels of image objects in a bottom-up approach, from the smallest objects in Level 1 to the largest objects in Level 3. In this study, ESP 2 was run with the default parameters, except for shape, which was set to 0.1, i.e. without optimization of geometry (Dr aguţ et al., 2010). negative (< − 1 SD) or extreme positive (> 1 SD). We consider these values to be the most optimal for the magnetic maps as a value larger than 1 SD would be too large for identified relevant anomalies of archaeological purposes while values smaller than 0.5 SD create artificial anomalies or noise.

| Computer implementation
Classification and segmentation were implemented as a ready-to-use algorithm within the eCognition ® 9 software package with the Cognition Network Language (CNL). This modular programming language F I G U R E 2 Proposed workflow to identify magnetic anomalies within the magnetic map F I G U R E 3 Screenshot of the graphical user interface of the tool, implemented as a process in the eCognition ® software environment provides image objects handling in a vertical and horizontal hierarchy (Tiede et al., 2011). The graphical user interface (Figure 3)

| Accuracy assessment
The results of the tool in the study area were evaluated both geometrically (segmentation) and thematically (classification).
To evaluate the accuracy of the segmentation results, we created reference polygons by manually delineating a number of 191 anomalies in the test magnetic map. The reference polygons (Figure 4) used in accuracy assessment were drawn by a random user, with basic knowledge in geophysics, considering the fact that most archaeologists are not specialized in interpreting geophysical data, and we did not warn them not to be influenced by the already segmented results of which we were aware. Considering that the algorithm will classify the segmented vectors based on the SD and some non-archeological anomalies are very similar to archaeological anomalies, the user was asked to draw everything he considered to be an anomaly even if it is not of archaeological interest.
The outputs were compared to manually digitized polygons using a minimum mutual spatial overlap threshold of 50%. To evaluate the accuracy, we used the following goodness metrics, proposed by Clinton, Holt, Scarborough, Yan, and Gong (2010) would be achieved with a value of one. To compute these metrics, we used a customized algorithm, implemented by Eisank, Smith, and Hillier (2014). Image segments that delimit the set of reference polygons are identified through 'image object links' (Trimble, 2015) which have the role to establish spatial connections between two autonomous sets of objects (here: classified polygons and reference polygons).
To derive important information regarding the classification results, an error matrix, including four items, was used: overall accuracy (OA), user's accuracy (UA), producer's accuracy (PA), and Kappa coefficient (KIA). OA represents the rate between the number of objects correctly classified and the total number of classified objects (Congalton, 1991). UA indicates the probability of a pixel from output classification to belong to the same class in reference classification, while PA represents the probability that a pixel from the reference classification is assigned to the same class in the output classification (Congalton, 1991). KIA is used to quantify the difference between the classified map and samples (Cohen, 1960).

| RESULTS
The best results were achieved on the first segmentation level, where the classified magnetic anomalies match best with the manually drawn ones ( Figure 5). On the second segmentation level only large anomalies were identified, while the third level highlighted the general con-  Table 1, grouped by classes. With regard to the shape of the anomalies, Table 1 indicates that most of the segmented anomalies tend to have a rectangular fit (1 is an ideal rectangle). This trend is observed in the positive anomalies (we consider to be the values representing the dwellings) that have a reduced asymmetry (1 is the value for ideal symmetry).
Evaluating the segmentation accuracy, the ESP 2 tool produced best anomalies delimitation at the first segmentation level, where the tool identified an SP of 293. From the 191 reference anomalies (manually drawn), 169 were identified as corresponding on the first level, with a minimum spatial overlap of 50%. Less satisfying segmentation results were achieved on the second (SP 513) and third level (SP 613), which led to high percentages of under-estimated areas ( Figure 6).
Detailed information about the segmentation results including accuracy metrics can be found in Table 2.
Samples for precision evaluation are represented by the 169 anomalies visible on Level 1 (manually drawn). In this regard, only the anomalies corresponding to those manually drawn anomalies of Level 1 were verified for accuracy. The segmentation and classification take into account even those anomalies which have not been considered of archaeological interest or on a small range distance they have distinct polarization. For example, if the user draws a dipolar anomaly as a single anomaly (a house that can give positive and negative values due to a particular magnetization), the algorithm will create two or more segments (vectors) depending on the distribution of the value. The anomalies can be easily managed in any GIS software when exported as a vector (in shape file) (merged, deleted and analysed because the polygons retain the specific characteristics given in eCognition after using the algorithm we propose).

| DISCUSSIONS
For more complex geomagnetic analyses users have the possibility not to use the default classification parameters, by changing the weight of SD. We tested both 0.5 and 1 SD approaches and the obtained results were quite different. In the case of 0.5 SD approach, the number of classified objects was almost double compared to the default classification type (Figure 7).
By analysing the two classification approaches, the best results were achieved on 1 SD, producing an overall accuracy of 0.93. The 0.5 SD approach was less precise, with an overall accuracy of 0.78. This is due to the lower impact of SD, where the classification is based more on mean magnetic values than on SD. Complete statistical information about classification accuracy is provided in Table 3.  the dwellings have a rectangular fit with a close symmetry and a density which describe a medium level of pixel compactness (Figure 9).
Of course, the attribute can differ according to the nature of the archaeological site and the user has the possibility to select various shapes and structural attributes to be exported after finalizing the segmentation process. We selected only elliptic fit, rectangular fit, asymmetry and density because we consider these to be the most common for most of the prospected sites.

| CONCLUSIONS
Although object-oriented analyses have been successfully used in archaeological science, especially the LiDAR (light detection and ranging) analyses, our study proposes a new methodology for the use of object-based image analysis (OBIA) instrumentation and, moreover, a method of delineating magnetometer anomalies in archaeology. The tool we offer comes packaged in an easy-to-use interface and offers the ability to analyse various data sets at an accuracy chosen by the user. In this way, the user can decide on the magnitude classification of magnetic anomalies and can export them as vectors to various geospatial software packages where further and meaningful analyses can be made. At the same time, the user has the possibility to make a series of statistical analyses based on the geometrical data related to each anomaly. Our methodology can be used in the development of tools useful in investigating other types of geophysical data such as ER, ERT or groundpenetrating radar (GPR).
This study comes with the algorithm patch which can be used for free by anyone. In the future, our desire is to upgrade this patch into an open-source plugin for Quantum GIS.