## 2 Visual Saliency Estimation
### Multi-Level Optimization Criterion  
When estimating saliency, the most salient pixels sought are included among those used for reference. However, including salient pixels among the reference pixels can significantly modify the value of the descriptors. Depending on the case, the saliency estimated at each point can be over- or underestimated by the number and intensity of the salient points in the zone considered. For example, the salient points of the surface may have their saliency levels underestimated when are compared, in terms of distance, with points of the surface that have the same salience as themselves. If these points are salient, they probably have similar characteristics, and therefore similar descriptors. On the other hand, the non-salient points of the surface have their saliency levels increased because, although their characteristics are far from the salient ones, they are used as a reference. To overcome this problem, we propose the level factor saliency optimization method described in Equation (2). This method allows both the standard deviation and the mean of the saliency of the reference pixels used for the saliency computation to be reduced by removing the outliers (high saliency values). The method, which is illustrated in Figure 6, begins with an initialization step in which the saliency of the pixels studied must be estimated for the first time. A percentage of pixels is then removed based on the deviation from the mean of a distribution of points considered to be normal, corresponding to the most salient points of the reference pixels, before iterating the calculation of the distance with the remaining reference pixels.  
\[F(X,y,z) \equiv X(y\leq P_{z}(y)), \tag{2}\] \[X^{SP_{z}} \equiv F(X,Mahal(X,X),z),\] \[Mahal^{SP_{z}}(Y,X) \equiv Mahal(Y,X^{SP_{z}}),\]  
\[\text{where}\left\{\begin{array}{l}P_{z}(y)\text{ is the z-th percentile of }y\\ X(condition)\text{ correspond to the value of }X\text{ for which the condition is met}\\ F\text{ is the filter function}\\ z\text{ is the percentage of value to filter}\end{array}\right.\]  
Figure 5: Saliency maps derived from an RTI acquisition with an exposure time (\(E_{t}\)) of 125 ms on a polished watch dial with micro-scratches of different amplitudes: (**a**) Saliency from geometric descriptors and (**b**) Saliency from statistic descriptors.  
The percentage of pixels to remove is a parameter of the method, and is defined by the user beforehand. This parameter can be defined automatically to ensure that the standard deviation or the mean of the saliency of the reference pixels is close to a desired value. Figure 7 shows the effect of the choice of the percentage when using the level factor saliency estimation method; the higher the percentage, the greater the dynamics of the saliency. This increase in dynamics allows better visual observation of surface anomalies on the saliency maps, and helps with the segmentation and classification of surface anomalies.  
Level factor saliency filters out salient pixels with a certain percentage. Moreover, it is possible to compress the saliency information from several level factors into a single saliency called the multi-level saliency. Multi-level saliency is computed from the weighted sum of differents factor levels of saliency, as described in the Equation (3). In our case, the weight of a level factor saliency corresponds to its entropy in order to take into account the disparity of the saliency information [35]. The results of multi-level saliency can be seen in Figure 8.  
\[Mahal^{SP_{Z}}(Y,X)\equiv\frac{1}{\sum_{i=0}^{N}w_{i}}\sum_{i=0}^{N}Mahal^{SP_ {Z_{i}}}(Y,X)\times w_{i} \tag{3}\]  
where \(\left\{\begin{array}{l}Z\text{ is the vector of factors level}\\ w\text{ is the vector of weight associate to }Z\\ N\text{ is the length of }Z\text{ and }w\end{array}\right.\)  
Figure 6: Diagram of level factor visual saliency.