Full text
European Journal of Operational Research 302 (2022) 671–687 Contents lists available at ScienceDirect European Journal of Operational Research journal homepage: www.elsevier.com/locate/ejor Decision Support Segmentation of scanning-transmission electron microscopy images using the ordered median problem José J. Calvino c , Miguel López-Haro c , Juan M. Muñoz-Ocaña a , ∗, Justo Puerto b , Antonio M. Rodríguez-Chía a a Departamento de Estadística e Investigación Operativa, Universidad de Cádiz, Cádiz, Spain b IMUS, Instituto de Matemáticas de la Universidad de Sevilla, Sevilla, Spain c Departamento de Ciencia de los Materiales e Ingeniería Metalúrgica y Química Inorgánica, Universidad de Cádiz, Cádiz, Spain a r t i c l e i n f o Article history: Received 16 June 2021 Accepted 10 January 2022 Available online 15 January 2022 Keywords: Location Ordered median function Segmentation Clustering Mixed integer linear programming a b s t r a c t This paper presents new models for segmentation of 2D and 3D Scanning-Transmission Electron Microscope images based on the ordered median function. The main advantage of using this function is its good adaptability to the different types of images to be studied due to the wide range of weight vectors that can be cast. Classical segmentation models stand out for their ability to provide a segmentation of the original image very quickly and with low computational burden. However, they do not usually achieve high quality segmentations with a small number of clusters in order to classify the different elements which compose the structure represented in the image. The quality of the segmentation provided by our approach is analysed using different choices of the weight vector in some real instances. Moreover, improvements are proposed for the formulations to reduce the computational time needed to solve these problems by taking advantage of the weight vector structure. ©2022 The Author(s). Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license ( http://creativecommons.org/licenses/by-nc-nd/4.0/ ) 1. Introduction Nowadays, Nanoscience and Nanotechnology are of major relevance for the design of new nanomaterials with a wide range of applications in areas such as environmental protection, green energy sources and catalysis. These novel designs are based on the ability of controlling structure and morphology at nanometer scale. Scanning Transmission Electron Microscopy (STEM) has therefore become a powerful tool to rationalise the properties of nanomaterials. In this technique, the nanomaterials are studied by recording images of their projected structure (2D-STEM images) either in a specific tilt or by acquiring a tilt-series around a single axis with constant increment of angle. In the latter, the reconstructions of the whole set of 2D-STEM images provide information about the 3D structure, most commonly the morphology of the object (3D-STEM images). The intensity displayed in the pixels of the ∗Corresponding author. E-mail addresses: [email protected] (J.J. Calvino), [email protected] (M. López-Haro), [email protected] (J.M. Muñoz-Ocaña), puert[email protected] (J. Puerto), antonio.r[email protected] (A.M. Rodríguez-Chía). 2D images must at least maintain a monotonic relationship with thickness. By classifying the pixels in these images into groups of intensities it is possible to discriminate the different components which make up a material and quantify their morphological properties. For example, in a material composed of small particles dispersed on a surface, pixel classification (also known as segmentation) allows identification of the image areas or volumes corresponding to the particles as independent objects and further evaluation of their morphological features (e.g. size, shape or surface-to-volume ratio). Different clustering methods focusing on pixel classification can be found in the field of STEM ( Bai, Fan, & Dong, 2021; Gontar, Ozkaya, & Dunin-Borkowski, 2011 ). Otsu’s method became popular for its simplicity, classifying pixels by minimising the intra-class variance of their intensities ( Hindson, Saghi, Hernandez-Garrido, Midgley, & Greenham., 2011; Leary et al., 2012; Liu et al., 2020; Lopez-Haro et al., 2014 ). K-means clustering is also a widely used method to carry out segmentation of images, as it is one of the most effective methods to classify intensities ( Belianinov et al., 2015 ). These clustering procedures play an important role in the analysis of electron microscopy images, since a high quality segmentation determines the success of microscopic characterisation ( Yamamoto et al., 2014 ). The main advantage of these segmentahttps://doi.org/10.1016/j.ejor.2022.01.022 0377-2217/© 2022 The Author(s). Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license ( http://creativecommons.org/licenses/by-nc-nd/4.0/ )
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 tion methods is the ability to obtain solutions very quickly and with low computational burden. However, these models do not usually provide good classifications where there are few clusters or with noisy images, i.e., images where it is very difficult to distinguish between their different structures. In recent decades, there has been increasing interest in the literature in solving clustering problems with mathematical programming methods ( Hansen & Jaumard, 1997 ). Different objective functions are used for this purpose, such as minimising the maximum within-cluster distance ( Saglam, Salman, Sayin, & Turkay, 2006 ), minimising the sum of within-cluster distances ( Brusco, 2003 ) or minimising the sum of distances between each point and its cluster centre ( Bradley, Fayyad, & Mangasarian, 1999 ). This objective function combined with feature selection was also studied in Benati & García (2014) . See Benati, Puerto, & Rodríguez-Chía (2017) , Benati, Ponce, Puerto, & Rodríguez-Chía (2021) for the latest advances in the use of mixed-integer linear programming formulations for clustering problems. Following this line of research, in this paper we propose a new clustering method based on mathematical programming using the Discrete Ordered Median Problem (DOMP) as a criterion to segment STEM images. DOMP has attracted the attention of many studies in the area of discrete location, since it provides a unified framework for the most popular location problems used in discrete location literature (median, center, centdian, k -sum,...). The idea behind the objective function of this problem consists of applying a penalisation to each distance between a client and its corresponding service facility depending on its position in the whole sequence of sorted distances (unlike classical models such as median or center, where this penalisation is assigned to each client regardless of the magnitude of the distance to its service facility). This adds a ‘sorting’ to the underlying facility location problem, making formulation and solution much more challenging. There are many studies based on this function such as Kalcsics, Nickel, & Puerto (2003) , Ogryczak & Tamir (2003) , Nickel & Puerto (2005) , Boland, Domínguez-Marín, Nickel, & Puerto (2006) , Puerto (2008) , Marín, Nickel, Puerto, & Velten (2009) which introduce classical DOMP formulations, while Kalcsics, Nickel, Puerto, & Rodríguez-Chía (2010) , Labbé, Ponce, & Puerto (2017) , Aouad & Segev (2019) , Olender & Ogryczak (2019) , Blanco (2019) , Deleplanque, Labbé, Ponce, & Puerto (2020) , Espejo, Puerto, & Rodríguez-Chía (2021) , Marín, Ponce, & Puerto (2020) offer an overview of recent advances in DOMP. The goal of this paper is twofold. The first aim is to show that segmentations with the ordered median objective function provide high quality pixel classifications for certain choices of the weight vector. The second goal is to develop new formulations and improvements for DOMP with specific choices of the weight vector that allow us to solve the resulting optimisation problems in an efficient way. This paper is structured as follows: Section 2 introduces the notation needed to formulate segmentation problems within the DOMP framework; Section 3 proposes different improvements to DOMP formulations to reduce the computational time needed to obtain a high quality segmentation by taking advantage of the weighted vector structure in the objective function to be minimised; Section 4 provides alternative improvements to the formulations based on the idea developed in Ogryczak & Tamir (2003) ; Section 5 offers an extensive computational analysis of the different formulations and the improvements developed in this paper; in Section 6 this model is validated with different images and a way of quantifying the segmentations obtained is proposed; Section 7 outlines the main conclusions of this paper; and finally, for the sake of completeness, the formulations used to compare with the ones proposed in this paper are set out in the Appendix. 2. Image segmentation and the ordered median problem This section describes the elements that define image segmentation models and states the links to formulate these problems within the DOMP framework. Let us suppose we have an image with M ×Npixels to be segmented with the aim of identifying the elements which constitute the nanomaterial shown in the original image. Each pixel has a specific intensity which is an integer value in a range whose length will depend on the resolution (number of bits) of the image, for instance, between 0 and 2 8 or 0 and 2 16 . The smallest intensities of this range correspond to the lowest densities of the object represented in the image (close to black colour) and the largest intensities correspond to the greatest densities (close to white colour). Let us also assume that we have n different intensities and N := { 1 , . . . , n } . The number of pixels having the same intensity is referred to as the frequency of that intensity and the set of frequencies of an image is denoted as f := { f 1 , . . . , f n } . Segmenting an image consists of grouping its intensities into p (≤n ) different clusters. Each cluster is associated with an intensity which acts as its representative. Therefore, in terms of mathematical programming we can define the segmentation of an image as the choice/location of pcluster representatives and the allocation of each intensity to a cluster representative in such a way that some objective function is minimised. It is assumed that the set of candidate cluster representatives is the set of intensities. We define cluster jas the one having intensity jas its representative. Moreover, each intensity is allocated to only one cluster representative. Let d = (d ij ) i,j=1 , ... ,n be the n ×n intensity weighted distance matrix where d ij represents the intensity weighted distance for allocating intensity i to the cluster representative j. These intensity weighted distances are defined as the product of the frequency of the pixel intensity i (f i ) multiplied by the distance between intensities i and j, i.e. d ij = f i | i −j| . The distance between two intensities is obtained as the absolute value of the difference between both intensities, since they are on the real line ( | i −j| ). Let J ⊂N be the subset of pintensities selected as representatives of pdifferent clusters. We define d i (J) , i ∈ N as the intensity-allocation weighted distance of intensity i to a cluster representative in J. It is assumed that each intensity i is allocated to a representative such that j ∈ arg min k ∈ J d ik or in other words: d ij = d i (J) := min k ∈ J d ik . 2D and 3D-images are usually composed of different structures such as background, particles and support (materials which hold particles). Particles are usually characterised by intensities with low pixel frequencies in the original image because of their small size compared to the other structures of the image. Hence, if we consider the ordered vector of the intensity-allocation weighted distances, the first positions of that vector usually correspond to intensities associated with particles. We can therefore attempt to exploit this observation by applying a specific DOMP model with appropriate weights to achieve a good segmentation of images obtained with STEM. The intensity-allocation weighted distances are sorted to calculate the ordered median function where d ≤(J) := (d 1 ≤(J) , ... , d n ≤(J)) will be this vector, such that: d 1 ≤(J) ≤. . . ≤d n ≤(J) . The DOMP aims to minimise the ordered weighted average of vector ( d k ≤(J) ) with respect to a given set of λ-weights: min J⊂N | J| = p k ∈N λk d k ≤(J) , 672
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 Fig. 1. Segmentation of an 8 ×10 image with 5 intensities and 2 clusters. where λ= (λ1 , . . . , λn ) , with λk ≥0 , ∀ k ∈ N . Figure 1 shows an example of an image segmentation with five intensities grouped into 2 clusters. The above expression needs to be reformulated for its implementation in MIP solvers. There are several formulations involved in this task. The formulation F DOMP G proposed in Puerto, Ramos, & Rodríguez-Chía (2013) , Puerto, Ramos, Rodríguez-Chía, & Sánchez- Gil (2016) and Espejo et al. (2021) and the formulation F OT θintroduced in Marín et al. (2020) are known to have the best performance in terms of solution times when λ-vectors have repetitions (components with equal values). For the sake of completeness, we have included these formulations in Appendix A.1 and A.2 , respectively. 3. Specific formulations The application of the state-of-the-art DOMP formulations to segmentation problems allows us to solve medium size instances. The most promising formulations for these types of problems are described in Appendix A.1 and A.2 . However, still the CPU times required to solve these problems make them not competitive when compared with standard methods in the image segmentation area. For this reason, our goal is to improve their performance by exploiting specific aspects of the problem. Taking advantage of the particular λ-vector structure, we aim to provide new formulations that allow a reduction of the computational time required by the general formulations of the ordered median problem. Since the main goal of image segmentation techniques is the analysis of the particle characteristics contained in STEM experiments, these formulations will attempt to remove intensities that do not correspond to specific structures of the original image. These intensities could contain noise generated by the microscope when projections are recorded (intensities with the lowest frequencies). On the other hand, they could represent structures with larger sizes than particles. Therefore, to remove these intensities from the objective function, we attempt to assign the value 0 to the positions of the λ-vector where these intensities will hopefully be in the ordered intensity-allocation weighted distance vector and the value 1 to positions corresponding to relevant intensities. In this section we propose different specific criteria depending on the type of sample to be segmented: i) antik -centrum ( λ= (1 , ... , 1 , 0 , . . . , 0) ), which minimises the sum of the k -smallest components of the ordered intensity-allocation weighted distance vector, will be selected to segment images with small relevant features (smallest frequencies) and very large unimportant structures (largest frequencies), since hopefully the first and last positions of the ordered intensity-allocation weighted distance vector will correspond to the intensities with the smallest and largest frequencies, respectively; ii) ( k 1 , k 2 )-trimmed mean ( λ= (0 , ... , 0 , 1 , . . . , 1 , 0 , . . . , 0) ), which minimises the sum of components between the (k 1 + 1) th and the (n −k 2 −1) th positions of the ordered intensity-allocation weighted distance vector, will be applied to segment images where the k 1 -smallest and the k 2 - largest frequencies correspond to intensities that do not provide meaningful information about the image; and iii) ( k 1 , k 2 )-anti- trimmed-mean ( λ= (1 , . . . , 1 , 0 , . . . , 0 , 1 , . . . , 1) ), which minimises the sum of the first k 1 plus the last k 2 components of the ordered intensity-allocation weighted distance vector, could be used for images whose k 1 -smallest and k 2 -largest frequencies correspond to intensities that represent the most important structures. 3.1. Antik -centrum Let us suppose that the image to be segmented is made up of very small particles and the main aim is to detect only these particles regardless of the rest of the elements. Particles are usually in the first positions of the ordered intensity-allocation weighted distance vector, since there are fewer pixels with intensities associated with particles than pixels with intensities associated with the rest of elements of the image. That is, we are interested in assigning the intensities with the smallest intensity-allocation weighted distances in the best possible way. The antik -centrum problem may have a suitable structure for this situation, since the assignments with the smallest intensity-allocation weighted distances 673
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 penalise the objective function thanks to the non-zero values of λ-vector whereas the largest ones are hardly considered due to the zeros in the corresponding positions. This λ-vector assigns the value 1 to the first k -positions and zero otherwise, that is, λ= (1 , . . . , 1 , 0 , . . . , 0) . To give a formulation for the antik -centrum model, we define the allocation r-variables, such that r ij = 1 if intensity i is assigned to cluster representative jand r ij = 0 otherwise. The locations of representatives are controlled by y -variables, defined as y j = 1 if intensity jis selected as the representative of a cluster and y j = 0 otherwise. In what follows, for the sake of brevity, we will say that cluster jexists if y j = 1 . Taking advantage of the particular structure of the λ-vector in antik -centrum, we propose the following formulation for this problem: (F A k C ) min i,j∈N d ij r ij s.t. j∈N y j = p, (1a) r ij ≤y j , ∀ i, j ∈ N , (1b) j∈N r ij ≤1 , ∀ i ∈ N , (1c) i,j∈N r ij = k, (1d) r ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N . (1e) The objective function stands for the sum of the k -smallest components of the ordered intensity-allocation weighted distance vector. The equality constraint (1a) sets the number of cluster representatives to p. Constraints (1b) avoid allocating intensity i to j if jis not selected as cluster representative. Constraints (1c) ensure that each intensity is allocated to a maximum of one cluster. The equality constraint (1d) sets the number of allocations to k . Closest assignment constraints used in the formulation of Appendix A.2 (17d) are not included in the formulation, since the assignments with the n −k largest intensity-allocation weighted distances may be post-processed to be allocated to their closest clusters. Although r-variables may be relaxed, we have considered them as binary variables since they provided us lower computational times. In the rest of the formulations included in this paper we will proceed in the same way. We can adapt this formulation if there is more than one nonzero block in λ-vector (a block is defined as a set of consecutive non-null identical values in λ-vector). These blocks must be sorted in decreasing order, for instance λ= (2 , . . . , 2 , 1 , . . . , 1 , 0 , . . . , 0) . Consequently, we define as many sets of allocation variables as there are positive blocks. If there are two blocks with k 1 and k 2 elements which take the value of 2 and 1 respectively, rand s - variables will be defined to control each intensity allocation. The r-variables control the lowest k 1 th allocation weights and the s - variables state the following k 2 th ones. (F A k C2 ) min 2 i,j∈N d ij r ij + i,j∈N d ij s ij s.t. (1a) , r ij + s ij ≤y j , ∀ i, j ∈ N , (2a) j∈N (r ij + s ij ) ≤1 , ∀ i ∈ N , (2b) i,j∈N r ij = k 1 , (2c) i,j∈N s ij = k 2 , (2d) r ij , s ij , y j ∈ { 0 , 1 } ∀ i, j ∈ N . (2e) Constraints (2a) avoid allocating intensity i to jif jis not selected as cluster representative. Constraints (2b) ensure that each intensity is assigned to at most one cluster. The number of allocations controlled by rand s -variables are set to k 1 and k 2 by constraints (2c) and (2d) respectively. 3.2. (k 1 , k 2 ) -Anti-Trimmed mean If one is interested in identifying only the smallest particles together with the largest ones, in general, these particles will correspond to the intensities with the smallest and largest frequencies, respectively. As mentioned above, the smallest elements of the image are usually in the first positions of the ordered intensityallocation weighted distance vector and the largest ones are often in the last positions of the vector, which correspond to the background of the image. This situation fits to the structure of the (k 1 , k 2 ) -anti-trimmed mean model, since it aims to minimise the k 1 -smallest intensity-allocation weighted distances together with the k 2 -largest ones, i.e., λ=(1 , ... , 1 , 0 , . . . , 0 , 1 , . . . , 1) . We define three sets of allocation variables r ij , s ij and t ij , with i, j ∈ N . These variables take the value 1 if intensity i is allocated to cluster jand the value 0 otherwise. r-variables are used for controlling the allocations with the smallest intensity-allocation weighted distances, t-variables manage the largest ones and s -variables are used to allocate intensities with intensity-allocation weighted distances corresponding to positions in which λ-vector takes the value 0. A formulation for the (k 1 , k 2 ) -anti-trimmed mean model is as follows: (F (k 1 ,k 2 ) ATM ) min i,j∈N d ij r ij + i,j∈N d ij t ij s.t. (1a) , r ij + s ij + t ij ≤y j , ∀ i, j ∈ N , (3a) j∈N (r ij + s ij + t ij ) = 1 , ∀ i ∈ N , (3b) Ordering constraints (See Section 3.2.1) , (3c) i,j∈N t ij = k 2 , (3d) i,j∈N s ij = n −(k 1 + k 2 ) , (3e) r ij , s ij , t ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N . (3f) The objective function accounts for the k 1 -smallest plus the k 2 -largest intensity-allocation weighted distances. Constraints (3a) avoid allocating intensity ito jif jis not selected as cluster representative and (3b) ensure that each intensity is allocated to one cluster. Constraints (3c) ensure that any allocation using tvariables will have an intensity-allocation weighted distance larger than the ones associated with s -variables and will be described in Section 3.2.1 . Constraints (3b) together with (3d) and (3e) determine the number of allocations controlled by each set of variables. 674
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 3.2.1. Alternative ordering constraints for F (k 1 ,k 2 ) ATM formulation In this subsection we propose different ways of modelling ordering constraints, (3c) . These constraints allow us to model the order of the intensity-allocation weighted distances. Hence, this family of constraints ensures that the intensity-allocation weighted distances of assignments controlled by s -variables must be smaller than or equal to the ones controlled by t-variables. Below, we introduce different sets of constraints with the same purpose of ordering the assignments controlled by s and t-variables. In Section 5 a preliminary computational study is carried out to choose the ordering constraints with the best performance to solve the F (k 1 ,k 2 ) ATM formulation. First family: This allocation order may be controlled by a big Mvalue to force that the intensity-allocation weighted distance of each s -variable assignment is smaller than or equal to the one of each allocation controlled by t-variables. Hence, these constraints may be written as follows: j∈N d ij s ij ≤(1 − j∈N t i j ) M i + j∈N d i j t i j , ∀ i, i ∈ N . (4a) The value of M i has been set to the maximum intensity-allocation weighted distance of intensity i , i.e., M i = max j∈N d ij . Constraints (4a) may be reinforced by including on the left side the sum of the intensity-allocation weighted distances of assignments controlled by r-variables, obtaining: j∈N (d ij s ij + d ij r ij ) ≤(1 − j∈N t i j ) M i + j∈N d i j t i j , ∀ i, i ∈ N . (4b) Second family: In what follows we consider a different way of modelling the ordering constraints without using big Mvalues. To do so, we define the following constraints: (n −k 1 −k 2 ) t ij ≤ k,l∈N: d kl <d ij s kl , ∀ i, j ∈ N . (5a) These constraints force that the intensity-allocation weighted distances of the n −k 1 −k 2 assignments controlled by s -variables must be smaller than the intensity-allocation weighted distance of every assignment controlled by t-variables. The number of assignments controlled by r-variables may be included in (5a) , since, if t ij = 1 then, the total number of assignments controlled by rand s - variables with intensity-allocation weighted distances smaller than d ij must be larger than or equal to n −k 2 : (n −k 2 ) t ij ≤ k,l∈N: d kl <d ij (s kl + r kl ) , ∀ i, j ∈ N . (5b) Third family: An alternative way of modelling the ordering constraints is as follows: k 2 s ij ≤ k,l∈N: d kl >d ij t kl , ∀ i, j ∈ N . (6a) These inequalities ensure that the number of assignments controlled by t-variables must be equal to k 2 and they must have intensity-allocation weighted distances larger than the allocations controlled by s -variables. Fourth family: The following constraints state the maximum number of assignments controlled by rand s -variables. If t ij = 0 , then the number of assignments with intensity-allocation weighted distances larger than or equal to d ij must be smaller than or equal to n −k 2 . Moreover, if t ij = 1 , there can be no assignments controlled by rand s -variables with intensity-allocation weighted distances larger than d ij . These constraints may be written as follows: k,l∈N: d kl ≥d ij (s kl + r kl ) ≤(1 −t ij )(n −k 2 ) , ∀ i, j ∈ N . (7a) The values of t-variables may be added for intensity i if the intensity-allocation weighted distance is smaller than or equal to d ij : k,l∈N: d kl ≥d ij (s kl + r kl ) ≤(1 − l ∈N: d il ≤d ij t il )(n −k 2 ) , ∀ i, j ∈ N . (7b) Fifth family: Another way to order each assignment is to define two variables ( u max and U min ) which take the maximum intensityallocation weighted distance value of the assignments controlled by r-variables and the minimum value of the ones controlled by t-variables, respectively. Four sets of ordering constraints are included in the F (k 1 ,k 2 ) ATM formulation: d ij (1 − k ∈N r ik − k ∈N t ik ) ≤(1 −y j + k ∈N: d ik <d ij y k ) M + U min , ∀ i, j ∈ N , (8a) d ij y j + (1 −y j ) M + ( k ∈N r ik + k ∈N t ik ) M ≥u max , ∀ i, j ∈ N , (8b) k ∈N r ik d ik ≤u max , ∀ i ∈ N , (8c) 1 − k ∈N t ik M + k ∈N t ik d ik ≥U min , ∀ i ∈ N . (8d) Constraints (8a) and (8b) ensure that the maximum and minimum intensity-allocation weighted distance of each assignment controlled by s -variables must be smaller than or equal to U min and larger than or equal to u max , respectively. Constraints (8c) and (8d) state the maximum intensity-allocation weighted distance of assignments managed by r-variables and the minimum intensityallocation weighted distance of assignments controlled by tvariables, respectively. 3.3. (k 1 , k 2 ) -Trimmed mean Let us now suppose that we are interested in segmenting an image where the intensities with the smallest and largest number of pixels do not provide useful information. These unimportant intensities usually represent noise (lowest frequencies) and the background (highest frequencies). Therefore, we need to find a model that does not consider the smallest intensity-allocation weighted distances together with the largest ones in the objective function. The (k 1 , k 2 ) -trimmed mean model adapts well to this situation as it minimises intensity-allocation weighted distances excluding the k 1 -smallest and k 2 -largest ones, i.e., λ= (0 , . . . , 0 , 1 , . . . , 1 , 0 , . . . , 0) . To formulate this specific model, proceeding in a similar way to F (k 1 ,k 2 ) ATM , we define two sets of allocation variables rand s . The r-variables which do not contribute to the objective function control the k 1 -smallest intensity-allocation weighted distances and the s -variables control the n −(k 1 + k 2 ) following ones. This model may be written as follows: (F (k 1 ,k 2 ) TM ) min i,j∈N d ij s ij s.t. (1a) , r ij + s ij ≤y j , ∀ i, j ∈ N , (9a) j∈N (r ij + s ij ) ≤1 , ∀ i ∈ N , (9b) 675
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 Ordering constraints (See Section 3.3.1) , (9c) i,j∈N r ij = k 1 , (9d) i,j∈N s ij = n −(k 1 + k 2 ) , (9e) r ij , s ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N . (9f) The objective function provides the sum of assignments with intensity-allocation weighted distances larger than the k 1 th position and smaller than the n −k 2 th position in the ordered intensity-allocation weighted distance vector. Constraints (9a) ensure that each intensity is associated with a cluster that exists. Constraints (9b) force that each intensity is allocated to at most one cluster. Constraints (9c) ensure that the intensity-allocation weighted distances of assignments controlled by r-variables are smaller than the ones controlled by s -variables. The number of allocations made by r-variables and s -variables are given by (9d) and (9e) , respectively. 3.3.1. Alternative ordering constraints for F (k 1 ,k 2 ) TM formulation In this subsection, we analyse different ways of modelling ordering constraints (9c) . These families of constraints aim to model the order of assignments controlled by rand s -variables in a similar way to the F (k 1 ,k 2 ) ATM formulation. We have proposed different ordering constraint families and a preliminary computational study is carried out to select the family that shows the best performance in the F (k 1 ,k 2 ) TM formulation (see Section 5 ). First family: The first set of ordering constraints proposed to state the assignments controlled by rand s -variables such that intensity-allocation weighted distances of assignments managed by r-variables must be smaller than or equal to the ones controlled by s -variables. This can be written as follows: j∈N d ij r ij ≤(1 − j∈N s i j ) M i + j∈N d i j s i j , ∀ i, i ∈ N , (10a) where M i = max j∈N d ij . Second family: Similarly to the F (k 1 ,k 2 ) ATM formulation, constraints (10a) may be replaced by the following ones which also state the order of each assignment: k 1 s ij ≤ k,l∈N: d kl <d ij r kl , ∀ i, j ∈ N . (11a) These constraints ensure that the number of allocations with intensity-allocation weighted distances smaller than d ij controlled by r-variables must be larger than or equal to k 1 if s ij = 1 . Constraints (9d) are removed from the F (k 1 ,k 2 ) TM formulation, since the number of allocations controlled by r-variables is stated in constraint (11a) . Computational results have been obtained with this set of constraints. Valid inequalities to manage the order of allocations may also be included in the formulation: (n −k 1 −k 2 ) r ij ≤ k,l∈N: d kl >d ij s kl , ∀ i, j ∈ N . (12a) These constraints set as n −k 1 −k 2 the number of assignments controlled by s -variables. Each one must have an intensityallocation weighted distance larger than the intensity-allocation weighted distances of each assignment controlled by r-variables. 4. New formulations based on the dualisation of the k-sum problem Ogryczak & Tamir (2003) developed a formulation for the ordered median problem using the dual of the problem that maximises the sum of k values of a set of n values ( k -sum problem). Although this formulation has a good performance due to the reduced number of variables, it can only be extended to λvectors whose components are given in non-decreasing order, i.e., 0 = λ0 ≤λ1 ≤···≤λn . It requires a set of allocation variables x ij , with i, j ∈ N , defined as x ij = 1 if intensity i is assigned to cluster jand x ij = 0 otherwise, ∀ i, j ∈ N . In addition, the w ik - and z k - variables correspond to the dual variables of the problems that maximise the sums of k values for each i ∈ N . The formulation is given by: (F OT ) min k ∈N (λN−k +1 −λN−k )(kz k + i ∈N w ik ) s.t. (1a) , x ij ≤y j , ∀ i, j ∈ N , (13a) j∈N x ij = 1 , ∀ i ∈ N , (13b) w ik + z k ≥ j∈N d ij x ij , ∀ i, k ∈ N , (13c) x ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N , (13d) w ik ≥0 , ∀ i, k ∈ N , (13e) z k ∈ R , ∀ k ∈ N . (13f) The k th addend of the objective function namely kz ik + i ∈N w ik , represents the dual objective function of the problem that maximises the sum of k intensity-allocation weighted distances, and consequently, the telescopic sum of these addends when the weights are given in a non-decreasing way provides the ordered objective function. Constraints (13a) prevent each intensity being allocated to a cluster representative that does not exist. Moreover, constraints (13b) ensure that the allocation of each pixel is unique. Constraints (13c) are used to build the dual from the maximisation problem to calculate the sum of the k -largest weights. The F (k 1 ,k 2 ) ATM and F (k 1 ,k 2 ) TM formulations require less computational time than the generic ordered median formulation. However, they still need a high computational time to solve large size instances. For this reason, we have exploited some aspects of the F OT formulation to provide alternatives that permit to solve the aforementioned instances in smaller computation times. 4.1. OT- (k 1 , k 2 ) -Anti-Trimmed mean Let λ=(1 , ... , 1 , 0 , . . . , 0 , 1 , . . . , 1) be the λ-vector corresponding to the (k 1 , k 2 ) -anti-trimmed mean model, where the first and second blocks of ones have k 1 and k 2 elements, respectively. The k 1 -smallest intensity-allocation weighted distances are minimised by using the antik -centrum criterion and the k 2 -largest intensityallocation weighted distances are minimised by exploiting the rationale behind the OT formulation to solve the k 2 -centrum problem. Hence, r-variables are defined to control the assignments with the k 1 -smallest intensity-allocation weighted distances and x - variables are used to apply the OT criterion to minimise the sum 676
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 of the k 2 -largest intensity-allocation weighted distances: (F (k 1 ,k 2 ) ATM OT ) min j,k ∈N d jk r jk + k 2 z + i ∈N w i s.t. (1a), (9d), (13a), (13b) , w i + z ≥ j∈N d ij x ij , ∀ i ∈ N , (14a) r ij ≤x ij , ∀ i, j ∈ N , (14b) x ij , r ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N , (14c) w i ≥0 , ∀ i ∈ N , (14d) z ∈ R . (14e) The first term of the objective function computes the k 1 - smallest intensity-allocation weighted distances and the sum of the k 2 -largest ones are computed by the second term. Constraints (14a) relate primal and dual variables associated with the formulation that minimises the sum of the k 2 -largest assignments. Constraints (14b) set x jk = 1 if r jk takes the value 1, since, in contrast to r-variables, which control k 1 assignments, x -variables are involved in each of the n allocations due to constraints (13b) . 4.2. OT- (k 1 , k 2 ) -Trimmed mean We define λ= (0 , . . . , 0 , 1 , . . . , 1 , 0 , . . . , 0) where the first block of zeros contains k 1 elements and the second block of zeros is composed of k 2 elements. Thus, Ogryczak and Tamir’s formulation is applied to the first n −k 2 elements of λ-vector. To achieve this, the number of allocations controlled by x -variables will be set as n −k 2 : (F (k 1 ,k 2 ) TM OT ) min (n −k 1 −k 2 ) z + i ∈N w i s.t. (1a), (13a), (14a) , i,j∈N x ij = n −k 2 , (15a) x ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N , (15b) w i ≥0 , ∀ i ∈ N , (15c) z ∈ R . (15d) The objective function implements Ogryczak and Tamir’s formulation to the first n −k 2 components of λ. Constraints (15a) set the number of allocations controlled by x -variables, i.e., the number of assignments must be equal to n −k 2 . 5. Computational results This section provides a detailed computational analysis of the alternative formulations proposed for the different choices of the λ-vector in the discrete ordered median problem. Our focus is on the application of DOMP to segment electron microscopy images recorded during the structural characterisation of nanomaterials with potential applications in environmental catalysis. Therefore, Fig. 2. (a) corresponds to a 3D-STEM image and (b) is a 2D-STEM image. Both have been used to assess the performance of the different formulations. we have restricted ourselves to meaningful choices of λ-vectors which are valid for this application. This analysis allows us to determine which formulations are the most efficient to solve the proposed segmentation problems. As is usual in the STEM field, the computational experience is carried out in simulated instances. Generating real experiments is highly time-demanding and consequently the time needed to obtain a large number of instances would not be affordable. The idea is to generate synthetic images (phantoms) with fully known features (e.g., sizes, shapes, intensities) that are close to real systems studied in STEM ( Staniewicz & Midgley, 2015; Tovey et al., 2019 ). Figure 2 shows the procedures to generate the phantoms selected to implement the computational studies of the formulations and validation of the proposed models (see Section 6 ). We have decided to segment these images because of their importance in the field of nanoscience and nanotechnology. It is important to note that both phantoms represent complex nanomaterials which have potential applications in the field of heterogeneous and environmental catalysis (see Liu & Corma, 2018 ). Thus, high quality segmentations of the components that make up such systems are essential not only to obtain an accurate quantification but also to be able to link the structural properties at nm-scale to their chemical or physical behaviour (see López-Haro et al., 2018 ). In particular, these datasets simulate 3D-STEM ( Fig. 2 (a)) and 2D-STEM ( Fig. 2 (b)) images. Both images are composed of a background (pixels close to black colour), the support (pixels with grey colours) and the particles (pixels close to white colour). Supports are necessary in STEM experiments to hold the nanometric objects, since these particles cannot be analysed individually due to their microscopic sizes. The goal for segmenting these images is to identify most of the particles to quantify their properties. To obtain Fig. 2 (a), a 3D phantom was generated to simulate a nanocatalyst, and the shapes, sizes and intensities of these structures are related with the characteristics of a real nanocatalyst. Once the phantom had been generated, four different 3D-STEM images were reconstructed using a classical reconstruction algorithm by considering projections from -70 to 70 degrees obtained every 5, 10, 15, and 20 degrees (see Midgley, Ward, Hungría, & Thomas, 2007 ). Figure 2 (b) simulates a 2D projection provided by electron microscopes before applying a reconstruction algorithm (2D-STEM image). Four instances were created by modifying the support structure and the location, number and sizes of every particle within the image. Supports were obtained by generating 3D surfaces very similar to the structures that hold the particles in these types of experiments. Particles were represented by spheres whose centres (x, y, z) were obtained by generating uniformly distributed values between 0 and 512 pixels for each dimension. Values related to the radius of these spheres were calculated with a uni- 677
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 Table 1 Different ordering constraints included in the F (k 1 ,k 2 ) ATM formulation. (4a) (4b) (5a) (5b) n p Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes 128 2 3201.88 (1) 1.14 99.94 22550.75 1524.01 0 99.94 11612.5 7208.06 (4) 99.99 99.88 8079.75 7311.02 (4) 99.99 99.94 4560.75 128 3 4423.04 (1) 4.58 99.93 30106.75 1837.45 0 99.93 10774.75 7207.14 (1) 99.98 99.85 6210.50 - - - - 128 4 5445.62 (2) 28.66 99.90 36150.25 2111.39 0 99.90 19921 7205.35 (4) 99.98 99.77 9085.75 - - - - 128 5 7200.97 (4) 70.06 99.15 42022.75 6208.16 (3) 46.34 99.91 45656.75 7206.14 (4) 99.99 99.76 8425.25 - - - - 256 2 7200.90 (4) 97.61 99.86 1214.25 7200.57 (4) 99.94 99.76 0 - - - - - - - - 256 3 7202.06 (4) 97.54 99.88 1658 7200.56 (4) 99.63 99.73 1670.75 - - - - - - - - 256 4 7201.61 (4) 98.30 99.89 648.75 7201.23 (4) 99.74 99.73 2218.5 - - - - - - - - 256 5 7201.12 (4) 98.78 99.89 428 7201.44 (4) 99.76 99.67 86.33 - - - - - - - - (6a) (7a) (7b) (8a), (8b), (8c), (8d) 128 2 1127.49 0 34.05 1165.25 7227.16 (4) 99.76 99.94 1546.75 7207.51 (4) 99.75 99.60 3.5 7201.19 (4) 0.7815 99.95 859252.25 128 3 1250.88 0 40.50 2371.25 7208.01 (4) 99.84 99.92 1926.50 7213.70 (4) 99.74 99.43 503.5 7202.15 (4) 99.90 99.94 170940.25 128 4 1284.98 0 64.41 833 7207.35 (4) 99.87 99.89 2349.50 7205.43 (4) 99.77 99.13 16.5 7201.99 (4) 99.67 99.90 399771 128 5 6735.35 (3) 46.84 74.35 12269.5 7247.24 (4) 99.84 99.89 2456.50 7204.15 (4) 99.68 99.05 229.75 7204.99 (4) 99.88 99.89 223942.33 256 2 - - - - - - - - - - - - - - - - 256 3 - - - - - - - - - - - - - - - - 256 4 - - - - - - - - - - - - - - - - 256 5 - - - - - - - - - - - - - - - - form distribution between 3 and 8 pixels. After creating these 3D structures, they were projected on the horizontal plane to obtain 2D-STEM images. The instances to be segmented were generated with different numbers of intensities to study the performance of every formulation with different instance sizes (128, 256, 512, and 1024 intensities) and four values of pfor each instance were selected (2, 3, 4, and 5 clusters). Moreover, k , k 1 and k 2 parameters were set depending on the size of the instances: k was set to n 2 , where n is the number of intensities of the image under study, i.e., k was set to 64, 128, 256, and 512 to segment an image with 128, 256, 512, and 1024 intensities, respectively; meanwhile, k 1 and k 2 were both set to approximately n 10 , i.e., k 1 = k 2 = 10 , 25 , 50 , and 100 for 128, 256, 512, and 1024 intensities, respectively. These choices correspond to a preliminary computational analysis over different experiments, where the values of these parameters always reported very good performance. All the formulations were implemented in MATLAB R2020b and solved with CPLEX 12.10 thanks to the API that links both codes. All the experiments were performed on an Intel Xeon W-2245 workstation, 256 Gb RAM, NVIDIA Quadro RTX 40 0 0. The time for solving each instance was limited to 7200 CPU seconds. All the tables report the average of 4 instances and the number of instances for which the optimal solution was not obtained within the time limit is denoted using a superscript. Moreover, ‘-’ means that more than 2 h were required to obtain a feasible solution for each of the 4 instances. 5.1. Finding the best ordering constraints for F (k 1 ,k 2 ) ATM and F (k 1 ,k 2 ) TM A preliminary computational study was carried out to select the most efficient ordering constraint family described in Sections 3.2.1 and 3.3.1 using the instances introduced above with 128 and 256 intensities (see Tables 1 and 2 ). The first two columns contain the number of intensities and clusters, respectively. The rest of the table is divided into different blocks. Each one of them reports the time needed to obtain the optimal solution in seconds, the gap between the best solution and the best bound (Gap BB), the gap between the optimal solution of the integer problem and the optimal solution of the linear relaxation (Gap LR), and finally, the number of nodes explored in the branching tree by each formulation. If the optimal solution is not obtained with any formulation, the best solution found among all the formulations is chosen to compute Gap LR. In Table 1 , we can see that constraints (6a) provide the best computational times to solve the F (k 1 ,k 2 ) ATM formulation for 128 intensities, but instances with 256 intensities are not solved before 7200 s. Alternatively, constraints (4a) and (4b) provided feasible solutions for 256 intensity instances. Therefore, constraints (4b) will be included in our segmentation model, since these constraints solve instances with 128 intensities in less time than constraints (4a) . As in the F (k 1 ,k 2 ) ATM formulation, we also analysed the results provided by the different ordering constraints included in the F (k 1 ,k 2 ) TM formulation. These computational results are shown in Table 2 , which shows that the best computational times to solve the F (k 1 ,k 2 ) TM formulation for 128 intensities are given by constraints (12a) . However, this family of constraints does not even provide feasible solutions for instances with 256 intensities. For this reason, constraints (10a) were chosen to carry out the computational study for F (k 1 ,k 2 ) TM . 5.2. Comparing formulations Table 3 shows the computational results obtained applying the two best formulations existing in the literature to solve the antik -centrum problem, F DOMP G and F OT θ(see Appendix A.1 and A.2 , respectively, for more details about these formulations), compared with the one proposed in Section 3.1 using 3D-STEM images. The F DOMP G formulation only solved instances with 128 intensities. The F OT θformulation has provided segmentation up to 512 intensities and the computational time was significantly reduced. Nevertheless, this formulation could not provide solutions of instances with 1024 intensities in less than 7200 s. Finally, the F A k C formulation reported the best performance, reducing the computing time substantially to obtain the optimal solution of instances with 128, 256 and 512 intensities. Moreover, instances with 1024 intensities were only solved in less than ten minutes with the F A k C formulation. All the formulations provided very good linear relaxation values with gaps smaller than 0.3% and the Nodes columns in the table show that most of the instances were solved in the root node. Table 4 provides the computational results obtained by applying F DOMP G , F OT θand F A k C formulations to the antik -centrum problem to segment 2D-STEM images. This table is organised in the same way as Table 3 and the results obtained show the performance of the formulations is similar to what was observed for 3D-STEM images. 678
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 Table 2 Different ordering constraints included in the F (k 1 ,k 2 ) TM formulation. (10a) (11a) (12a) n p Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes 128 2 600.24 0 32.97 8055.25 899.69 0 33.76 1882.5 931.17 0 24.75 3475.50 128 3 3333.32 0 37.70 115815.75 3181.24 0 34.73 14403.25 1899.87 0 27.39 10398.75 128 4 5653.98 (2) 6.45 39.46 94996.5 4862.83 (1) 1.68 32.65 24,553 1794.43 0 25.55 13302.25 128 5 4207.94 0 40.71 52518.25 5219.34 (1) 4.11 31.32 26,188 1296.91 0 24.77 11,954 256 2 7204.33 (4) 79.24 65.83 2737.75 - - - - - - - - 256 3 7206.98 (4) 89.67 63.78 0 - - - - - - - - 256 4 7204.99 (4) 76.06 63.89 1.25 - - - - - - - - 256 5 7206.05 (4) 68.66 58.76 480.75 - - - - - - - - Table 3 Computational results of the F DOMP G , F OT θand F A k C formulations to solve the antik -centrum problem using 3D-STEM images. F DOMP G F OT θF A k C n p Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes 128 2 315.57 0 0.11 0 13.71 0 0.11 0 0.43 0 0.11 0 128 3 264.52 0 0 0 13.21 0 0 0 0.31 0 0 0 128 4 268.09 0 0 0 15.03 0 0.06 0 0.33 0 0.06 0 128 5 240.85 0 0 0 13.01 0 0 0 0.29 0 0 0 256 2 - - - - 121.01 0 0.10 0 16.16 0 0.10 0 256 3 - - - - 132.79 0 0.01 0 17.39 0 0.01 0 256 4 - - - - 114.15 0 0.01 0 15.81 0 0.01 0 256 5 - - - - 117.93 0 0 0 13.41 0 0 0 512 2 - - - - 1014.45 0 0.05 5.5 110.77 0 0.11 0 512 3 - - - - 1830.42 0 0.01 0 109.64 0 0.01 0 512 4 - - - - 1643.14 0 0 0 99.02 0 0 0 512 5 - - - - 1470.52 0 0 0 101.52 0 0 0 1024 2 - - - - - - - - 661.56 0 0.28 10.25 1024 3 - - - - - - - - 669.84 0 0 0 1024 4 - - - - - - - - 583.23 0 0 0 1024 5 - - - - - - - - 564.76 0 0 0 Table 4 Computational results of the F DOMP G , F OT θand F A k C formulations to solve the antik -centrum problem using 2D-STEM images. F DOMP G F OT θF A k C n p Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes Time Gap BB Gap LR Nodes 128 2 217.39 0 0 0 20.20 0 0 0 0.58 0 0 0 128 3 207.42 0 0 0 19.85 0 0 0 0.58 0 0 0 128 4 178.39 0 0 0 20.7 0 0 0 0.55 0 0 0 128 5 169.50 0 0 0 20.94 0 0 0 0.53 0 0 0 256 2 5985.12 (2) 48.30 0 0 217.69 0 0 0 26.14 0 0 0 256 3 5824.79 (2) 47.43 0 0 202.04 0 0 0 29.20 0 0 0 256 4 5915.04 (2) 48.02 0 0 210.63 0 0 0 17.86 0 0 0 256 5 5125.26 (1) 24.15 0 0 236.43 0 0 0 22.05 0 0 0 512 2 - - - - - - - - 138.77 0 0.01 0 512 3 - - - - - - - - 156.35 0 0.02 0 512 4 - - - - - - - - 155.42 0 0.02 0 512 5 - - - - - - - - 133.40 0 0.08 190.25 1024 2 - - - - - - - - 617.91 0 0.02 0 1024 3 - - - - - - - - 642.72 0 0.02 0 1024 4 - - - - - - - - 634.04 0 0.04 38 1024 5 - - - - - - - - 497.77 0 0.04 284 Tables 5 (3D-STEM images) and 6 (2D-STEM images) show the computational times, gap and nodes needed to solve the (k 1 , k 2 ) -trimmed mean problem using F DOMP G , F (k 1 ,k 2 ) TM , F OT θ, and F (k 1 ,k 2 ) TM OT (see Appendix A.1 and A.2 for more details of the F DOMP G and F OT θformulations, respectively). The F OT θand F (k 1 ,k 2 ) TM OT formulations provided optimal solutions for larger instances than those provided by F DOMP G and F (k 1 ,k 2 ) TM . Instances with 256 and 512 intensities were solved applying F OT θand F (k 1 ,k 2 ) TM OT formulations within the time limit. It is worth highlighting that the computational times to obtain optimal solutions provided by F (k 1 ,k 2 ) TM OT are one order of magnitude lower than the time needed by F OT θ. For the case of instances with 1024 intensities, although F (k 1 ,k 2 ) TM OT did not provide optimal solutions for most instances within 7200 s, it reports feasible solutions with a small gap. The number of instances without any solution obtained within 7200 s is shown in parenthesis. In this case, the Gap LR values are larger than those obtained for the F A k C formulation, and very few instances are solved in the root node (see the Nodes column). Tables 7 and 8 report the computational results with the (k 1 , k 2 ) -anti-trimmed mean problem for 3D-STEM and 2D-STEM images, respectively. In contrast to the F DOMP G formulation, which 679
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 Table 9 Dimensions of the F DOMP G (Appendix A.1), F OT ( Section 4 ) and F OT θ(Appendix A.2) formulations, where K + = { k ∈ N : k > 0 } and K −= { k ∈ N : k < 0 } . Variables Constraints x y u v w zθ(1a) (13a) (13b) (13c) (16a) (16b) (16c) (16d) (17a) (17b) (17d) F DOMP G n 2 n |I| ·|H| |I| ·|H| - - - 1 n 2 n - |H| (|I| −1) ·|H| (|I| −1) ·|H| |I| ·|H| - - - F OT n 2 n - - n 2 n - 1 n 2 n n 2 - - - - - - - F OT θn 2 n - - n ·| K + | | K + | n 2 ·| K −| 1 n 2 n n 2 - - - - | K −| n 2 ·| K −| n 2 values and sorting its components in increasing sequence. Let H be the number of different nonzero elements of the intensityallocation weighted distance matrix and H := { 1 , . . . , H} . The ordered intensity-allocation weighted distance vector is built as follows: d (0) = 0 < d (1) < . . . < d (H) := max { d ij : i, j ∈ N } . Let h ∈ Hand k ∈ I, we define the set of binary variables u kh which take the value of one if the ( k j=1 αj + k −1 j=1 βj + 1) th intensityallocation weighted distance is at least d (h ) and the value of zero otherwise. In addition, variables v kh give the number of allocations in the k th block between positions k j=1 αj + k −1 j=1 βj + 1 and k j=1 (αj + βj ) with a weight higher than d (h ) . Thus, the ordered median problem with blocks is formulated as follows: ( F DOMP G ) min k ∈I h ∈H γk (d (h ) −d (h −1) ) v kh s.t. (1a), (13a), (13b) k ∈I αk u kh + k ∈I v kh + αI+1 ≥ i ∈N j∈N: d ij ≥d (h ) x ij , ∀ h ∈ H, (16a) u kh ≥u k −1 ,h , ∀ k = 2 ··· , I, h ∈ H, (16b) βk −1 u kh ≥v k −1 ,h , ∀ k = 2 ··· , I, h ∈ H, (16c) v kh ≥βk u kh , ∀ k ∈ I, h ∈ H, (16d) x ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N , (16e) u kh ∈ { 0 , 1 } , ∀ k ∈ I, h ∈ H. (16f) v kh ∈ Z ∩ [0 , βk ] , ∀ k ∈ I, h ∈ H. (16g) The objective function is the ordered sum of the intensitiesallocation weighted distances. Constraints (16a) guarantee that the number of intensities with an intensity-allocation weighted distance greater than or equal to d (h ) is either equal to the number of allocations with an intensity-allocation weighted distance at least d (h ) whenever v Ih > 0 or less than or equal to αI+1 otherwise. Constraints (16b) control that u kh must be greater than or equal to u k −1 ,h . Upper and lower bounds of variables v kh are given by constraints (16c) and (16d) respectively. A2. OT θFormulation Marín et al. (2020) introduce a formulation of the ordered median problem based on the rationale that explains the original OT formulation ( Ogryczak & Tamir, 2003 ) (see Section 4 ). Differently from the original OT formulation, this one is valid for any λvector structure, non necessarily monotone. Let k = λk −λk −1 . It requires new variables θk ij that take the value of 1 if the intensityallocation weighted distance of assigning intensity i to cluster jis sorted in position k and 0 otherwise. Then, the formulation that results is: (F OT θ) min k ∈N: k > 0 k (n −k + 1) z k + i ∈N w ik + k ∈N: k < 0 k i ∈N j∈N d ij θk ij s.t. (1a), (13a), (13b), (13c) , i ∈N j∈N θk ij = n −k + 1 , ∀ k ∈ N : k < 0 , (17a) θk ij ≤x ij , ∀ i, j, k ∈ N : k < 0 , (17b) θk ij ≥0 , ∀ i, j, k ∈ N : k < 0 , (17c) a : d ia >d ij x ia + y j ≤1 , ∀ i, j ∈ N , (17d) w ik , z k ≥0 , ∀ i, k ∈ N : k > 0 , (17e) x ij , y j ∈ { 0 , 1 } , ∀ i, j ∈ N . (17f) The first term of the objective function contains the sum of the (n −k + 1) th greatest intensity-allocation weighted distances multiplied by k for k ∈ N such that k > 0 . The second term contains the sum of the remaining (n −k + 1) th greatest intensityallocation weighted distances multiplied by k for k ∈ N such that k < 0 . Constraints (17a) state the number of allocations controlled by variables θk ij and (17b) force that every allocation managed by θk ij is also controlled by x ij . Finally, the family of constraints (17d) ensures the allocation of each intensity to the closest cluster. To have an idea of the complexity of the different formulations, we show in Table 9 a comparative of the number of variables and constraints needed to formulate the F DOMP G , F OT (see Section 4 ) and F OT θ. A3. Validation of the (k 1 , k 2 ) -anti-trimmed mean model. In this Appendix, a 2D-STEM image with a low density of particles supported on a continuous thin layer is segmented by using the (k 1 , k 2 ) -anti-trimmed mean model. This 2D-STEM phantom image represents an example of nanomaterials used in devices for alternative energy, see Fig. 9 . This new instance contains a small amount of particles and low noise, then we are interested in the smallest and largest intensity-allocation weighted distances. Ideally, the smallest intensity-allocation weighted distance will correspond to the ones of particles and the largest ones to those of the background. Therefore, taking λ=(1 , ... , 1 , 0 , . . . , 0 , 1 , . . . , 1) the resulting segmentation model attemps to identify two different structures: particles and background with a low level of noise. Hence, we only need 2 clusters to classify the intensities (see Fig. 9 ). 686
J.J. Calvino, M. López-Haro, J.M. Muñoz-Ocaña et al. European Journal of Operational Research 302 (2022) 671–687 References Aouad, A. , & Segev, D. (2019). The ordered k-median problem: Surrogate models and approximation algorithms. Mathematical Programming , 1–29 . Bai, F. , Fan, M. , & Dong, L. (2021). Image segmentation method for coal particle size distribution analysis. Particuology, 56 , 163–170 . Belianinov, A. , Vasudevan, R. , Strelcov, E. , Steed, C. , Yang, S. M. , Tselev, A. , . . . Kalinin, S. (2015). Big data and deep data in scanning and electron microscopies: Deriving functionality from multidimensional data sets. Advanced Structural and Chemical Imaging, 1 (6) . Benati, S. , & García, S. (2014). A mixed integer linear model for clustering with variable selection. Computers & Operations Research, 43 , 280–285 . Benati, S. , Ponce, D. , Puerto, J. , & Rodríguez-Chía, A. M. (2022). A branch-and-price procedure for clustering data that are graph connected. European Journal of Operational Research, 297 (3), 817–830 . Benati, S. , Puerto, J. , & Rodríguez-Chía, A. M. (2017). Clustering data that are graph connected. European Journal of Operational Research, 261 , 43–53 . Blanco, V. (2019). Ordered p-median problems with neighbourhoods. Computational Optimization and Applications, 73 (2), 603–645 . Boland, N. , Domínguez-Marín, P. , Nickel, S. , & Puerto, J. (2006). Exact procedures for solving the discrete ordered median problem. Computers & Operations Research, 33 (11), 3270–3300 . Bradley, P. S. , Fayyad, U. M. , & Mangasarian, O. L. (1999). Mathematical programming for data mining: Formulations and challenges. Journal on Computing, 11 , 217–238 . Brusco, M. J. (2003). An enhanced branch-and-bound algorithm for a partitioning problem. British Journal of Mathematical and Statistical Psychology, 56 , 83–92 . Deleplanque, S. , Labbé, M. , Ponce, D. , & Puerto, J. (2020). A branch-price-and-cut procedure for the discrete ordered median problem. INFORMS Journal on Computing, 32 (3), 582–599 . Espejo, I. , Puerto, J. , & Rodríguez-Chía, A. M. (2021). A comparative study of different formulations for the capacitated discrete ordered median problem. Computers & Operations Research, 125 , 105067 . Gontar, L. C. , Ozkaya, D. , & Dunin-Borkowski, R. E. (2011). A simple algorithm for measuring particle size distributions on an uneven background from TEM images. Ultramicroscopy, 111 (2), 101–106 . Hansen, P. , & Jaumard, B. (1997). Cluster analysis and mathematical programming. Mathematical Programming, 79 , 191–215 . Hindson, J. C. , Saghi, Z. , Hernandez-Garrido, J. C. , Midgley, P. A. , & Greenham, N. C. (2011). Morphological study of nanoparticle-polymer solar cells using high-angle annular dark-field electron tomography. Nano Letters, 11 (2), 904–909 . Hubert, L. , & Arabie, P. (1985). Comparing partitions. Journal of Classification, 2 , 193–218 . Kalcsics, J. , Nickel, S. , & Puerto, J. (2003). Multifacility ordered median problems on networks: A further analysis. Networks, 41 (1), 1–12 . Kalcsics, J. , Nickel, S. , Puerto, J. , & Rodríguez-Chía, A. M. (2010). Distribution systems design with role dependent objectives. European Journal of Operational Research, 202 , 491–501 . Labbé, M. , Ponce, D. , & Puerto, J. (2017). A comparative study of formulations and solution methods for the discrete ordered p-median problem. Computers & Operations Research, 78 , 230–242 . Leary, R. , Saghi, Z. , Armbrüster, M. , Wowsnick, G. , Schlögl , Robert, T. , . . . Midgley, P. (2012). Quantitative high-angle annular dark-field scanning transmission electron microscope (HAADF-STEM) tomography and high-resolution electron microscopy of unsupported intermetallic gapd 2 catalysts. The Journal of Physical Chemistry, 116 (24), 13343–13352 . Liu, K. , & Corma, A. (2018). Metal catalysts for heterogeneous catalysis: From single atoms to nanoclusters and nanoparticles. Chemical Reviews, 118 , 4981–5079 . Liu, L. , Lopez-Haro, M. , Lopes, C. W. , Rojas-Buzo, S. , Concepcion, P. , Manzorro, R. , . . . Corma, A. (2020). Structural modulation and direct measurement of subnanometric bimetallic PtSn clusters confined in zeolites. Nature Catalysis, 3 (8), 628–638 . Lopez-Haro, M. , Guetaz, L. , Printemps, T. , Morin, A. , Escribano, S. , Jouneau, P. H. , . . . Gebel, G. (2014). Three-dimensional analysis of nafion layers in fuel cell electrodes. Nature Communications, 5 (1) . López-Haro, M. , Tinoco, M. , Fernández-Garcia, S. , Chen, X. , Hungria, A. B. , Cauqui, M. A. , & Calvino, J. J. (2018). A macroscopically relevant 3D-metrology approach for nanocatalysis research. Particle & Particle Systems Characterization, 35 , 1700343 . Marín, A. , Nickel, S. , Puerto, J. , & Velten, S. (2009). A flexible model and efficient solution strategies for discrete location problems. Discrete Applied Mathematics, 157 (5), 1128–1145 . Marín, A. , Ponce, D. , & Puerto, J. (2020). A fresh view on the discrete ordered median problem based on partial monotonicity. European Journal of Operational Research, 286 (3), 839–848 . Midgley, P. A. , Ward, E. P. W. , Hungría, A. B. , & Thomas, J. M. (2007). Nanotomography in the chemical, biological and materials sciences. Chemical Society Reviews, 36 (9), 1477–1494 . Murugan, K. , Daniel, F. , Shanmugaraja, T. , Venkatesh, T. , Siddarthraju, K. , Dhivya Devi, R. , & Supriya, M. (2020). A critical review on medical image processing techniques. Journal of Critical Reviews, 7 (5), 576–580 . Nickel, S. , & Puerto, J. (2005). Location theory - a unified approach . Springer Verlag . Ogryczak, W. , & Tamir, A. (2003). Minimizing the sum of the k largest functions in linear time. Information Processing Letters, 85 (3), 117–122 . Olender, P. , & Ogryczak, W. (2019). A revised variable neighborhood search for the discrete ordered median problem. European Journal of Operational Research, 274 (2), 445–465 . Puerto, J. (2008). A new formulation of the capacitated discrete ordered median problems with {0, 1}-assignment. Operations research proceedings 2007 . Springer Berlin Heidelberg . Puerto, J. , Ramos, A. B. , & Rodríguez-Chía, A. M. (2013). A specialized branch & bound & cut for single-allocation ordered median hub location problems. Discrete Applied Mathematics, 161 (16), 2624–2646 . Puerto, J. , Ramos, A. B. , Rodríguez-Chía, A. M. , & Sánchez-Gil, M. C. (2016). Ordered median hub location problems with capacity constraints. Transportation Research Part C: Emerging Technologies, 70 , 142–156 . Saglam, B. , Salman, F. S. , Sayin, S. , & Turkay, M. (2006). A mixed-integer programming approach to the clustering problem with an application in customer segmentation. European Journal of Operational Research, 173 (3), 866–879 . Staniewicz, L. , & Midgley, P. A. (2015). Machine learning as a tool for classifying electron tomographic reconstructions. Advanced Structural and Chemical Imaging, 1 , 9 . Tovey, R. , Benning, M. , Brune, C. , Lagerwerf, M. J. , Collins, S. M. , Leary, R. K. , . . . Schönlieb, C. B. (2019). Directional sinogram inpainting for limited angle tomography. Inverse Problems, 35 (02), 024004 . Yamamoto, Y. , Arai, S. , Esaki, A. , Ohyama, J. , Satsuma, A. , & Tanaka, N. (2014). Statistical distribution of single atoms and clusters of supported Au catalyst analyzed by global high-resolution HAADF-STEM observation with morphological image-processing operation. Microscopy, 63 (3), 209–218 . 687