{'fraction_non_alphanumeric': 0.03211321268199755, 'fraction_numerical': 0.010776976459382229, 'mean_word_length': 5.079748510919921, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Local Intensity Order Transformation for Robust Curvilinear Object Segmentation

Segmentation of curvilinear structures is important in many applications, such as retinal blood vessel segmentation for early detection of vessel diseases and pavement crack segmentation for road condition evaluation and maintenance. Currently, deep learning-based methods have achieved impressive performance on these tasks. Yet, most of them mainly focus on finding powerful deep architectures but ignore capturing the inherent curvilinear structure feature (e.g., the curvilinear structure is darker than the context) for a more robust representation. In consequence, the performance usually drops a lot on cross-datasets, which poses great challenges in practice. In this paper, we aim to improve the generalizability by introducing a novel local intensity order transformation (LIOT). Specifically, we transfer a gray-scale image into a contrast-invariant four-channel image based on the intensity order between each pixel and its nearby pixels along with the four (horizontal and vertical) directions. This results in a representation that preserves the inherent characteristic of the curvilinear structure while being robust to contrast changes. Cross-dataset evaluation on three retinal blood vessel segmentation datasets demonstrates that LIOT improves the generalizability of some state-of-the-art methods. Additionally, the cross-dataset evaluation between retinal blood vessel segmentation and pavement crack segmentation shows that LIOT is able to preserve the inherent characteristic of curvilinear structure with large appearance gaps. An implementation of the proposed method is available at https://github.com/TY-Shi/LIOT.


I. INTRODUCTION
Curvilinear structures often appear in biomedical analysis. Their segmentation is very important in applications like retinal fundus disease screening [1], [2], early detection of vessel diseases, and in biometric authentication systems [3]- [5]. In parallel, curvilinear structures also appear in pavement crack segmentation, which is useful for road condition evaluation and road maintenance [6].
Compared to general object segmentation, curvilinear structure segmentation faces some particular challenges [7]: 1) thin, long, and tortuosity shapes; 2) inadequate contrast between curvilinear structures and the surrounding background; 3) uneven background illumination; 4) various image appearances. To cope with these challenges, classical curvilinear object segmentation methods [6], [8]- [22] mainly focus on T  designing specifically engineered features. They usually adopt filters or some morphological tools to capture one or more specific features from images. Such hand-crafted feature-based methods usually require careful parameter tuning, which is difficult to handle a wide variety of complex curvilinear structure segmentation. Most recent methods [24]- [40] leverage deep learning [41]- [44] for curvilinear object segmentation and have achieved significant improvement over previous methods. These methods mainly focus on designing various network architectures or loss functions to improve the segmentation performance. Despite the high in-dataset accuracy for the state-of-the-art methods, they usually do not generalize well to images with different image appearances. For instance, as illustrated in Fig. 1, one may achieve good results on the image similar to the training dataset. The segmentation accuracy greatly drops on the same image with slightly changed contrast. Yet, the inherent characteristic of curvilinear structure (e.g., darker than the context) holds for both images. This implies that the generalizability of curvilinear object segmentation methods still remains challenging. Designing a robust method that captures the inherent property of curvilinear structure is of great interest.
In this paper, we aim to address the above issue and focus on improving the generalizability of current deep learning-based methods in segmenting curvilinear objects. Instead of directly arXiv:2202.12587v1 [eess.IV] 25 Feb 2022 operating on the original image, we introduce a novel image transformation called Local Intensity Order Transformation (LIOT), which is a representation dedicated to curvilinear structure and invariant to the increasing change of image contrast. Specifically, we compare the intensity order of a given pixel to the values of its nearby neighbors (e.g. along with the four horizontal and vertical directions within a certain distance). In this way, we transform the original image into a new four-channel one, which does not depend on the absolute intensity value but the relative intensity order to capture the inherent characteristic of the curvilinear structure. An example of segmentation on LIOT is illustrated in Fig. 1. LIOT is robust to contrast changes, yielding very similar segmentation result for the original image and the one with contrast change.
The main property of the proposed LIOT is the robustness to curvilinear characteristic and contrast change. LIOT simply changes the input and can be plugged into any deep learningbased method. Since the main goal of this paper is not to develop a powerful pipeline that outperforms all other methods in segmenting curvilinear objects, we simply apply LIOT to the recent method IterNet [23] and conduct cross-dataset experiments on four datasets: DRIVE [45], STARE [46], CHASEDB1 [47], and CrackTree [6]. These cross-dataset experiments demonstrate that the proposed contrast-insensitive LIOT is simple yet effective to help deep learning-based methods to capture the characteristic of the curvilinear structure, and improves the generalizability of existing methods.
The main contribution of this paper is as follows: 1) We propose a novel image transform method that captures the inherent characteristic of curvilinear structures and is invariant to the increasing change of image contrast; 2) The spirit of using LIOT as input to the deep learning-based method enables the model to express a better generalization and to be more robust to non-targeted universal adversarial perturbations.
The rest of this paper is organized as follows. We shortly review some related works in Section II. The proposed method is then detailed in Section III, followed by extensive experimental results in Section IV. Finally, we conclude and give some perspectives in Section V.

II. RELATED WORK
Curvilinear structure segmentation has been widely exploited recently. We first review some representative classical and deep learning-based methods for curvilinear object segmentation in Section II-A. A review of some related works on leveraging intensity order-based information, in particular variants of census transform and intensity order-based feature description, are discussed in Section II-B. The comparison of the proposed LIOT with some related works is depicted in Section II-C.

A. Curvilinear object segmentation
Before the era of deep learning, curvilinear object segmentation pipelines [6], [8]- [22] are usually based on different techniques ranging from hand-crafted filters to machine learning approaches. Most recent methods shift to deep neural networks to directly learn effective features from the training data. Some of these methods are categorized and detailed in the following.
Classical methods: Classical curvilinear object segmentation methods mainly rely on extracting engineered features. For instance, Koller et al. [8] introduce a method based on a nonlinear combination of linear filters, with an edge-detection approach. Carlotto et al. [9] combine directional filter to enhance low-contrast curvilinear. In [10], the authors leverage pixel intensity and 2D Gabor wavelet transform for retinal blood vessel segmentation. In [11], the authors develop the line operator to construct a feature vector for supervised classification using the support vector machine. AI-Diri et al. [12] segment vessels in retinal images with a related active contour model. Marìn et al. [13] utilize a 7-D vector for pixel representation. Xiao et al. [15] propose to replace the low-level Gaussian kernel with a bi-Gaussian to detect curvilinear structures. The orientation analysis of gradient vector fields has been proposed for retinal blood vessel segmentation in [47]. Obara et al. [14] propose a contrast-independent approach to identify curvilinear structures based on oriented phase congruency. Krylov et al. [16] develop a stochastic approach for line segment extraction. Vicas et al. [18] use a structure tensor to extract meaningful low-level information for curvilinear structures. In [19], the authors rely on graphbased representations for reconstructing curvilinear networks. Merveille et al. [20] and [48] segment curvilinear structures by ranking the orientation responses of operators. Strisciuglio et al. [21] propose a novel operator for the delineation of curvilinear structures in images. Merveille et al. [22] propose a mixed gradient operator for segmentation task.
Deep learning-based methods: Deep learning-based methods learn features from the training data and significantly improve the performance of curvilinear object segmentation. For example, the neural network is used for retinal blood vessel segmentation in [24], which does not depend on the carefully engineered feature. Maninis et al. [25] propose a unified framework of retinal image analysis that jointly performs both retinal blood vessel and optic disc segmentation. In [27], Yan et al. propose a joint segment-level and pixel-wise loss for retinal blood vessel segmentation. Luan et al. [28] develop the Gabor convolution networks to reinforce the robustness of learned features against orientation and scale changes. Guo et al. [32] present a multi-scale deeply supervised network with short connections, achieving good cross-dataset results. In [33], Cherukuri et al. propose a deep model with regularization under geometric priors. Mosinska et al. [29] propose a multi-task learning of curvilinear structure segmentation and path classification. Wang et al. [30] propose a context-aware spatio-recurrent network for segmenting curvilinear structure. Lei et al. [31], [35] propose a channel and spatial attention network based on U-Net, effectively extracting curvilinear structures from three biomedical imaging modalities. Ma et al. [49] introduce a novel coarse-to-fine vessel segmentation network with the ability to separately detect thick and thin vessels. Dey [34] introduces a subpixel convolution and a feature fusion technique for retinal blood vessel segmentation. The distance field of tubular objects [50], [51] has been (a) CT [57] (b) SP-CT [58] (c) SCT [59] (d) LIOT Fig. 2: Comparison of LIOT with variants of census transform, which compare the intensity order between white pixels and the red one in the center for CT and Sparse CT (SP-CT).
proposed to improve the segmentation performance. Some recent methods [26], [52]- [55] aim to improve the topological mistakes by proposing topology-aware loss for curvilinear object segmentation. The method in [56] focuses on developing powerful network architecture for curvilinear object segmentation by leveraging boundary as a geometric constraint to refine feature.

B. Census transform and intensity order-based feature description
Census Transform (CT) [57] is a non-parametric local transform, which is originally defined as an ordered set of comparisons of pixel intensity in local 3 × 3 neighborhood. Froba et al. [60] propose the MeanCT that leverages the mean intensity of the neighborhood to increase the robustness. Ambrosch et al. [61] propose a SparseCT which uses a subset of pixels within the region of a larger neighborhood. Chang et al. [58] also propose a sparse CT Mini-census. In [62], Fife et al. propose generalized census transform (GCT) to define a family of masks in a 5 × 5 neighborhood with different levels of sparsity. Similarly, the center symmetric CT (CSCT) [63] compares a pair of pixels within the census window. The star census transform (SCT) [59] extends GCT by defining masks of symmetrical sequences of connected edges, of equal length, forming star-shaped scan-patterns around the center. Ahlberg et al. [64] propose a genetic algorithm to find a new and powerful Census Transform method. Yu et al. [65] adopt the census transform to calculate the illumination characteristics for tree reconstruction optimization. Lai et al. [66] also use census transform in medical imaging. Ramírez et al. [67] apply the census transform operator for audio-visual emotion recognition, owing to its robustness to monotonic changes.
Apart from the variants of census transform, some works [68]- [73] also share the similar idea with the proposed LIOT on leveraging the local intensity order information, but with different purposes (local feature description [68]- [70] and image classification [71]- [73]).

C. Comparison with related works
LIOT Versus Classical methods: Classical methods rely on engineered features to extract curvilinear structure. Therefore, these methods usually require careful parameter tuning and are hard to generate good performance in a wide variety of complex curvilinear object segmentation. The proposed LIOT can leverage a deep convolutional neural network (CNN) to Fig. 3: Overview of the proposed LIOT for curvilinear object segmentation. We transform an input image to a 4-channel intensity-order-based image, which is then fed into a segmentation network.
learn more effective features. LIOT can be plugged into any CNN architecture for curvilinear object segmentation.
LIOT Versus Deep learning-based methods: Most deep learning-based methods for curvilinear object segmentation are mainly inspired by recent CNN-based object/image segmentation methods. They usually focus on improving the indataset segmentation accuracy by improving feature learning, and ignore the limited cross-dataset performance due to the appearance gap between different datasets. This hinders the transferability to other similar curvilinear object segmentation. The proposed LIOT aims to capture the inherent characteristic of curvilinear objects, and thus to improve the generalization performance in various curvilinear object segmentation for deep learning-based methods.
LIOT Versus Census transform and intensity orderbased feature description: The proposed LIOT is in spirit similar to the census transform, which is a non-parametric transform that depends on the relative intensity ordering instead of absolute intensity values. This makes them invariant to increasing contrast changes. As shown in Fig. 2, compared with variants of census transform, the proposed LIOT is specifically designed for the curvilinear object that captures the curvilinear structure from four directions. Compared with the simple intensity order comparison between the center pixel and its surrounding neighborhood pixels for census transform, the horizontal and vertical long-range pixels capture better the inherent property of curvilinear objects having usually thin and long structures. The LIOT also differs with the intensity orderbased feature description methods in how to define the pairs of pixels for intensity order comparison. Besides, to the best of our knowledge, we are the first to combine intensity order information and deep-learning for robust curvilinear structure segmentation, which enables the model to express a better generalization and to be more robust to non-targeted universal adversarial perturbations.

A. Overview
Curvilinear objects have entirely different color distributions and backgrounds for different application scenarios. Such an appearance gap makes it difficult for the algorithm to accurately segment different curvilinear objects in different images. Thus, a general method to improve the generalizability for curvilinear segmentation algorithms is required. For that, we introduce a novel image transformation LIOT based on the relative intensity order between each pixel and its perpendicular neighbors. Such a transformation does not depend on the absolute value of each pixel, and is thus more robust to contrast changes. The overall pipeline of the proposed method is depicted in Fig. 3. We first convert the given image into a gray-scale one. Then we rely on the local intensity order to compute four directional binary codes, forming a 4-channel image that captures the curvilinear structure characteristic. We then feed this contrast invariant 4-channel image into a segmentation network.

B. Local intensity order transformation
Though different curvilinear object images may have various contrast and intensity distribution, the curvilinear structure is always darker (without loss of generality, we can invert the image when the curvilinear structure is brighter) than the context. Based on this property, we propose a novel and robust representation called LIOT that converts an input gray-scale image into a 4-channel intensity-order-based image. More precisely, as illustrated in Fig. 4, for each pixel p in the domain Ω of an image f , we compare the value of f (p) with each group of 8 neighboring pixels {n i s | i = 1, . . . , 8} (with Euclidean distance to p ranging from 1 to 8) lying perpendicular to p, where s ∈ {l, r, t, b} denotes left, right, top, and bottom side of p, respectively. This results in four 2D 8-bit images, where the i-th bit of each converted 2D image f s on p corresponds to the binary code given by the intensity order between f (p) and f (n i s ). These four 2D images of directional binary codes are concatenated together, composing Formally, for each direction side s ∈ {l, r, t, b}, we compute the corresponding image f s of directional binary codes on each pixel p as follows: where is larger than f (n i s ), otherwise 0. As depicted in Eq. (1), the proposed transformation is irrespective of absolute intensity values, and only depends on the relative intensity order. LIOT captures the "darker than" property of curvilinear structure and is invariant to increasing change of contrast. This makes LIOT more robust to appearance differences for images from different applications. Therefore, LIOT can improve the generalizability of curvilinear object segmentation methods.

C. Network architecture
Since the major goal is to improve the generalizability of existing CNN-based methods, we do not aim to develop a powerful network that outperforms other methods. Instead, we simply apply LIOT with the recent IterNet [23] by changing its input channel to the 4-channel image given by LIOT. Iternet is a U-Net like encoder-decoder model that adopts U-Net as the base module and combines three mini U-Nets. Each mini U-Net uses feature maps from its precedent module with fewer parameters than U-Net. IterNet also adds skipconnections from the base U-Net to all mini U-Nets and the connections among the mini U-Nets. We simply change the first convolution layer channel from 3 to 4-channel for adapting LIOT inputs, and keep the following layers the same as the original IterNet [23].

D. Training objective
We leverage the network depicted in Section III-C to segment the curvilinear object. The loss is the same as that in IterNet [23]. The network parameters are optimized with the sigmoid cross-entropy loss, defined as: where y i represents the binary indicator (0 or 1) whether the pixel i belongs to the ground-truth curvilinear object, and p i is the predicted probability that the pixel i is a foreground pixel. During the testing phase, we convert the original gray-scale image to a 4-channel LIOT image, and feed LIOT into the segmentation network to compute the final probability map.

IV. EXPERIMENTS
We evaluate the proposed method on four widely adopted datasets: DRIVE [45], STARE [46], CHASEDB1 [47], and CrackTree [6]. A short description of these datasets and adopted evaluation protocol are given in Section IV-A. Some implementation details are then depicted in Section IV-B. To demonstrate the generalizability of the proposed LIOT, we conduct four types of evaluations: 1) In-dataset evaluation in Section IV-C to demonstrate that the proposed LIOT does not significantly decrease the performance on original images; 2) In-dataset evaluation on images with universal adversarial perturbations (see Section IV-D) to show that LIOT is more robust to universal adversarial attacks; 3) Cross retinal dataset evaluation in Section IV-E, showing that LIOT generalizes better to images with small domain gap; 4) Evaluation on cross-dataset between Retinal and CrackTree dataset (see Section IV-F), proving that LIOT is more robust to large domain changes. In Section IV-G, we also show some results of applying LIOT trained on the retinal dataset to images with very different types of curvilinear structures, further demonstrating the generalizability of LIOT. CrackTree [6]: The CrackTree dataset contains 206 800×600 pavement images with different kinds of cracks having curvilinear structure. The whole dataset is split into 160 training and 46 test images. Following [26], we dilate the annotated centerlines by 4 pixels to form the ground-truth segmentation. As shown in Fig. 10, the multiple shadows and cluttered background make the segmentation a challenging task.
Images with curvilinear objects may have different image resolutions, and thus have varied thickness (in terms of pixels) of curvilinear structure. To cope with such a scale gap, for the retinal images, we first resize each image to a similar scale based on the size of the field of view (FOV) and image size. Specifically, we keep the image size of DRIVE unchanged, and resize the images in STARE, CHASEDB1 accordingly. Precisely, we resize STARE images from 700 × 605 to 554 × 479, and CHASEDB1 images from 999 × 960 to 584 × 561. The images in the CrackTree dataset are resized to 512 × 512. These size settings are used for both baseline methods and the proposed method. For retinal images, since LIOT requires a total order between pixel values, we thus convert the resized color image to a gray-scale one by selecting its green channel.
Evaluation protocol: Following the classical evaluation protocol for curvilinear object segmentation, we first compute the true positives (TPs), false positives (FPs), false negatives (FNs), and true negatives (TNs) for the segmentation result. Then, the classical accuracy (Acc), sensitivity (Se), specificity (Sp), area under the receiver operating characteristics curve (AUC), and F1-score are used to evaluate the performance. Besides, we also adopt the connectivity [74]: and # C (S) denotes the number of connected components in the ground-truth and segmented result, respectively. #(S G ) stands for the number of pixels in the ground-truth segmentation. This connectivity metric reflects the curvilinear structural continuity and is useful for branching analysis, further assessing the effectiveness of the proposed LIOT. We compute the metrics in the field of view area for retinal datasets: DRIVE, STARE , and CHASEDB1. For the CrackTree dataset, the metrics are computed on the whole image. For all methods on all involved datasets, we report the results by using the optimal segmentation threshold based on the F1-score.

B. Implementation details
We adopt classical data augmentation strategy to increase the training data and avoid over-fitting. Specifically, we randomly rotate images from -180 to 180 degrees, and shear from -0.1 to 0.1. We also flip images with the horizontal and vertical direction. Then, images are randomly shifted from -0.1 to 0.1, and randomly zoomed from 0.8 to 1.2. Finally, we randomly crop the augmented images to 128 × 128.
Since the major goal is not to develop a powerful network that outperforms other methods, we simply apply LIOT with the recent IterNet [23]. Following [23], we employ a batch size of 32 to train the network using cross-entropy loss for 1000 epochs. To further demonstrate the usefulness of the proposed LIOT, we also conduct experiments by using the topological loss (Topo) [52]. We adopt Adam [75] with a learning rate of 0.001 to optimize the network. For Topo [52] method, we set different optimal weights for the topological loss term on different datasets: 0.005 for DRIVE, 0.001 for CHASEDB1 and STARE, and 0.01 for CrackTree. For census [57] method, we choose the window size 3×3 as the original census definition and do not set any other parameters because the census is a non-parametric local transformation. During inference, overlapping image patches are extracted with a stride equal to 8.

C. In-Dataset evaluation
The proposed LIOT converts the original image into a relative order-based representation, which may lose some information on the image content. From this point of view, though the proposed LIOT mainly focus on improving the generalization performance for deep learning-based methods, we first conduct experiments on in-datasets: DRIVE, STARE, CHASEDB1, and CrackTree to show that the proposed LIOT does not significantly decrease the performance for the ability of model itself.
Some qualitative results are illustrated in Fig. 5. LIOT performs similarly with the baseline model, but usually has more false positives, which can find evidence in the original image, but are ignored in the ground-truth annotation. This is because that LIOT mainly focuses on the inherent characteristic (e.g., darker than the context) of curvilinear structure, and thus captures more objects having curvilinear structure. This may also explain why LIOT achieves slightly worse results than the baseline model on retinal images in terms of quantitative evaluation depicted in Table I. On the retinal datasets, LIOT is slightly worse than the baseline model, but performs much

D. In-dataset evaluation on images with perturbation
It is well known that deep learning-based models are highly vulnerable to adversarial perturbations, which may pose security problems for deep learning-based curvilinear object segmentation methods. In this section, we evaluate the robustness of the proposed LIOT against such adversarial perturbations.
For that, we adopt the non-targeted universal perturbations by GAP [76] to generate adversarial perturbations. As shown in Fig. 6, these perturbed images resemble the original images. We apply LIOT on the perturbed images and feed it to the trained model. Some qualitative results are given in Fig. 6. Though the perturbed images mislead both the trained baseline model and the model trained on LIOT, LIOT is more robust.
The quantitative evaluation is depicted in Table II. The proposed LIOT outperforms the baseline model by a large margin (up to 47.8%) in terms of all metrics. The proposed LIOT can effectively retain the inherent characteristic of curvi-  linear structure from the images with non-targeted universal adversarial perturbations, demonstrating the robustness of the proposed LIOT.

E. Cross retinal datasets evaluation
We now evaluate the proposed LIOT by conducting crossretinal dataset validation between the DRIVE, STARE, and CHASEDB1 dataset. Some qualitative illustrations are shown in Fig. 7. As depicted in this figure, LIOT is able to correctly segment most retinal blood vessels, especially those of low contrast. The direct segmentation on the original image fails to retrieve those thin and low contrast retinal blood vessels. For instance, as depicted in Fig. 7(b), the model trained on DRIVE, using LIOT can accurately segment most retinal blood vessels, including the segments (blue pixels in the cropped region on the right side) of very low contrast and ignored even by the manual annotation. In fact, though these segments have very low contrast, we can still find cues in the original image and they are indeed retinal blood vessels. This demonstrates that LIOT is more robust to contrast changes. Indeed, as depicted in Fig. 1, the baseline method poorly segments the retinal blood vessels for the contrast changed image, on which LIOT still performs similarly with the original image. Thus, LIOT can improve the generalizability of some deep learning-based methods in segmenting retinal blood vessels.
The quantitative cross retinal dataset evaluation of LIOT is depicted in Table III. We randomly divide three times DRIVE, STARE, and CHASEDB datasets into train/test images, and we train the corresponding model three times. The mean and standard errors are reported. Compared with the baseline method of IterNet [23] which directly operates on the original image, LIOT outperforms or is on par with the baseline model in terms of classical pixel-level metrics: Se, Acc, AUC, and F1-score for all set of cross-dataset evaluation. LIOT has better mean values and smaller standard errors in most cases. LIOT is also competitive with other state-of-the-art methods [24], [27], [32], [33], [77] dedicated for cross-retinal dataset evaluation. On average, LIOT performs much better than the baseline model and census transform based on all metrics except Sp. In particular, LIOT features a high sensitivity regime, which is important in clinical usage. Some "false positives" that are retinal blood vessels of low contrast and ignored by the manual annotation (described above) may degrade a bit the other classical metrics, such as the Sp. Therefore, LIOT may even perform slightly better in practice.
It is noteworthy that LIOT not only improves the pixellevel metrics, but also boosts the segmentation performance on the vessel network level. Specifically, as shown in Table III, LIOT consistently outperforms the baseline models in terms of connectivity metric. This implies that LIOT improves the integrity of the segmentation effect because connectivity assesses the fragmentation degree between the segmentation result and the ground truth. Besides, the connectivity is also an important clue for clinicians to calculate the complexity and density of branching of the retinal vascular tree to measure patient's condition [78]. Therefore, LIOT is also potentially useful for clinical disease diagnosis.
Though the goal is not to demonstrate that simply changing the input image by the proposed LIOT on a baseline method can outperform all other methods, as depicted in Table III, the experimental results show that the proposed method is competitive with all other methods [24], [27], [32], [33], [77] under cross-dataset validation, demonstrating the potential of the proposed LIOT in segmenting retinal blood vessels for a wide daily clinical usage.

F. Cross CrackTree and retinal datasets evaluation
In addition to cross retinal dataset (with small domain gaps) validation depicted in Section IV-E, We also evaluate the  proposed LIOT by conducting cross-dataset validation between the retinal datasets and CrackTree dataset. To the best of our knowledge, no previous research has investigated capturing the inherent characteristic of curvilinear structure for such large appearance gaps.
Cross-dataset validation from CrackTree to retinal datasets: As shown in Fig. 10, the CrackTree dataset has a great appearance gap with retinal images. We first apply the model trained on the CrackTree dataset to segment retinal blood vessels. Some qualitative retinal blood vessel segmenta-tion results using the model trained on the CrackTree dataset are given in Fig. 8. The proposed LIOT roughly segment the curvilinear structure in retinal images. From this figure, we can observe that LIOT preserves the inherent characteristic of curvilinear structure in retinal images. LIOT is also able to segment the curvilinear structure from various contexts. On the contrary, the baseline method can not capture the curvilinear structure of such large appearance gaps. The direct segmentation on the original image fails to retrieve most retinal blood vessels. These are common results as most deep-learning More precisely, as depicted in Fig. 9, for the model trained on CrackTree, using LIOT can accurately capture most retinal blood vessels, including those blue pixels which are of very low contrast and ignored by the manual annotation. Such an effect is difficult to achieve by general methods, especially in a simple way like LIOT. This demonstrates that LIOT is robust to contrast changes and is able to capture the inherent curvilinear structure.
The quantitative evaluation is shown in Table. IV. Compared with the baseline method, our proposed LIOT outperforms them by a large margin in terms of Se, AUC, and F1-score. Specifically, the proposed LIOT improves the baseline method by 34.5% to 54.0% in F1-score, significantly outperforming the baseline method. From the quantitative results given in Table V, the proposed LIOT makes the gap between Crack-Tree and the retinal dataset much smaller than the baseline method. Thus, LIOT significantly improves the generalization performance of the baseline method, especially for the dataset that has curvilinear structures with great appearance gaps.

Cross-dataset validation from retinal to CrackTree dataset:
We also evaluate the proposed LIOT on CrackTree using the model trained on the retinal datasets. The CrackTree dataset has a great appearance gap compared with the retinal datasets, and also has multiple shadows in the context. Though this makes such cross-dataset segmentation a challenging task, the proposed LIOT still successfully segments most curvilinear  structures in the CrackTree dataset. Some qualitative results are illustrated in Fig. 10. As shown in Fig. 10(b), LIOT is also able to extract curvilinear structure with the shadow influence. The quantitative compassion with the baseline method under this cross-dataset setting is given in Table. IV. LIOT achieves very competitive performance with the baseline method. Specifically, compared with the baseline model, LIOT achieves significant improvements, ranging from 26.2% to 45.4% in terms of F1-score. From the quantitative result given in Table V, the proposed LIOT makes the gap between retinal and crack images much smaller than the baseline method.
From the qualitative results shown in Fig. 8 and Fig. 10, and   Table. IV and Table. V, the proposed LIOT is capable to capture the curvilinear structure in various curvilinear object datasets. This demonstrates the generalization ability of the proposed LIOT. Simply changing the original input images with LIOT can help deep learningbased methods express a better generalization in various curvilinear object segmentation.

G. Generalization to images with different curvilinear objects
To further demonstrate the generalizability of the proposed LIOT, we also apply the model trained on the DRIVE dataset to images with different types of curvilinear structures: material grains, ceiling grids, table lines, tree's growth rings, and hair. As illustrated in Fig. 11, though the adopted model is trained on the retinal images having very different appearances from these test images, LIOT can still successfully segment these curvilinear structures of different types. Whereas, the baseline model trained on the original images fails to extract many curvilinear structures and has many false positives. This illustrative experiment further implies that LIOT is able to capture the inherent characteristic of curvilinear objects, and can thus improve the generalizability of existing deep learningbased models for curvilinear object segmentation.

V. CONCLUSION
In this paper, we aim to improve the generalization ability of current deep learning-based curvilinear object segmentation methods. For that, we propose the LIOT that converts a grayscale image to a novel representation that is invariant to increasing contrast changes. LIOT is built on the intensity order between pairs of pixels, and thus does not depend on the absolute intensity values. Such intensity-order based representation captures the inherent property of curvilinear objects (e.g., curvilinear structure darker than the context). Despite its simplicity, LIOT is rather robust to non-targeted universal adversarial perturbations. Besides, extensive crossdataset experiments on three widely adopted retinal blood vessel segmentation datasets and CrackTree dataset demonstrate that LIOT can improve the classical segmentation pipeline that directly operates on the original image. Therefore, LIOT forms a simple yet effective way to improve the generalization performance of different models. To the best of our knowledge, LIOT is a first simple attempt to improve the generalizability of curvilinear object segmentation from the aspect of image transformation. More sophisticated image transformation is worthy of further investigation for robust curvilinear object segmentation.