DermArtifactDB: a multi-label dataset for artifact annotation in public dermoscopic image repositories
Abstract
Dermoscopy is a widely adopted, non-invasive imaging technique that plays a crucial role in the early detection and clinical assessment of skin lesions (1). Its effectiveness, however, depends on the quality of the acquired images. In clinical practice, dermoscopic images often contain visual artifacts, such as hair, ruler markings, dark corners, bubbles, or ink traces, which are not part of the lesion itself. These artifacts can affect the visual appearance of the lesion, modifying color and texture patterns and complicating both clinical assessment and automated image analysis (2; 3; 4; 5). Consequently, artifacts are considered an important factor contributing to noise and bias in computer-aided diagnosis (CAD) systems, impacting model interpretability, robustness, and diagnostic performance (6; 7).Although interest in automated dermoscopic image analysis has increased, publicly available datasets specifically focused on artifact annotation remain limited. Public datasets, including International Skin Imaging Collaboration (ISIC)-2019 (8; 9), PH2 (10), and Derm7pt (11), contain images with visible acquisition artifacts, but they are primarily used to train models for skin lesion classification and do not include explicit labels for artifact presence or type. The lack of artifact annotations introduces several limitations. First, it limits the ability to study how artifacts affect model performance and interpretability.Second, it hinders the development of preprocessing methods to detect and mitigate artifacts. Third, although multiple artifacts often co-occur within the same image, existing datasets rarely capture this multi-artifact scenario, and most studies (4; 7; 12; 13) instead focus on individual artifacts.To date, only a limited number of studies have addressed the annotation of dermoscopic artifacts. Bissoto et al. (6) introduced manual artifact annotations for investigating dataset bias and spurious correlations, quantifying how artifacts act as confounding factors for lesion classification. They labeled small subsets of two dermoscopic datasets: 2,594 images from ISIC 2018 (out of more than 12,000 available images) and 872 images from the Dermoscopic Atlas (out of 1,746). While this work demonstrated the relevance of artifact-aware analysis, the annotation methodology is limited in scope, as it relies on fully manual labeling applied to small subsets of the available data. In addition, the absence of a defined and reproducible annotation procedure limits its scalability and reuse. More recently, Bissoto et al. (14) extended this line of research by training per-artifact classifiers on previously introduced manual annotations. These classifiers were then applied to infer artifact presence in larger datasets such as ISIC-2019. Although this strategy enabled large-scale analysis, the annotations correspond to classifier output scores (probabilistic predictions) rather than verified binary ground-truth labels derived from systematic expert annotation.Moreover, these predictions are reported only for a single dataset and lack expert validation, which may lead to discrepancies with the true artifact labels, especially for difficult-to-detect artifacts.To address these limitations, we introduce DermArtifactDB, a unified and standardized dataset that provides multi-label annotations for seven dermoscopic artifacts (hair, ruler markings, ink markings, patches, dark corners, gel borders, and gel bubbles). These annotations are provided for the complete image sets of three widely used public repositories (ISIC-2019, PH2, and Derm7pt), comprising 20,211 images in total (19,000 from ISIC-2019, 1,011 from Derm7pt and 200 from PH2). For each image, DermArtifactDB provides one image-level binary label per artifact category (presence/absence of each of the seven artifacts), amounting to 141,477 labels. These labels do not indicate where each artifact is located within the image, and no pixel-level segmentation masks or region annotations are provided. As the images come from these public datasets, our contribution lies not in the images themselves but in the standardized, expert-validated artifact metadata, together with the annotation pipeline and dataset-level statistics released with it. The annotations were generated using a robust data-driven pipeline that combines classical imageprocessing detectors, deep learning-based segmentation models, a transformer-based multi-label detector (C-Tran ( 15)), and expert manual review with clinical oversight. This multi-phase design was developed to ensure annotation consistency and reliability across all three datasets. DermArtifactDB enriches existing dermoscopic repositories with artifact-level metadata, enabling the study of artifact distribution, diversity, and co-occurrence, and supporting the development of more transparent, interpretable, and robust CAD systems.This section describes the data sources and the multi-phase annotation framework used to construct the proposed dermoscopic artifact dataset. The methodology follows the four-phase pipeline shown in Figure 1, encompassing data collection, classical automatic artifact detection, transformer-based artifact detection, and expert manual review.The annotation pipeline relies on two independent detection stages (Phases 2 and 3 in Figure 1), followed by expert review (Phase 4 in Figure 1). Phase 2 is an ensemble of artifact-specific detectors: six of them (dark corners, ruler markings, patches, gel border, gel bubbles, and ink markings) rely on classical imageprocessing techniques and are fully specified by the parameters reported in their respective subsections (see Sections 2.2.2-2.2.7) to ensure reproducibility. Two deep learning segmentation models are additionally used within this stage, namely an ensemble of segmentation networks for hair detection (see Section 2.2.1) and a Double U-Net that segments the skin lesion to reduce false positives in the patch detector (see Section 2.2.4). Phase 3 is an independent detector based on a C-Tran multi-label transformer (see Section 2.3) that jointly predicts the seven artifact categories. The architectures and training configurations of all learned models are detailed in full in the corresponding subsections below. The hair-segmentation code is publicly availablefoot_0 , the C-Tran detector builds on the publicly available reference implementation of The proposed artifact-annotated dataset integrates dermoscopic images from three public datasets: ISIC-2019, PH2, and Derm7pt. None of the three repositories provides labels for the presence or type of acquisition artifacts, precisely the gap addressed by DermArtifactDB.These datasets comprise thousands of images acquired from multiple clinical centers, dermatology departments, and imaging devices, providing a heterogeneous representation of real-world dermoscopic acquisition conditions. All datasets contain fully anonymized skin lesion images, and no patient-identifiable metadata was processed. This diversity supports the development of generalized artifact-aware algorithms.Seven artifact categories were selected based on their prevalence in dermoscopic imaging and their documented impact on both clinical interpretation and CAD systems (3). Each category corresponds to a distinct visual pattern often observed in dermoscopic images:• Hair: Filaments that partially occlude the lesion surface and introduce texture variations (2; 4).• Dark corners: Darkened peripheral regions caused by illumination fall-off from the circular dermatoscope lens. These underexposed areas typically appear near the image edges and may partially obscure lesion boundaries (17).• Gel border: Bright or translucent ring-shaped structures formed by the interaction between contact gel and the dermatoscope's illumination (2).• Gel bubbles: Circular specular bubbles trapped within the gel interface, characterized by high reflectance and sharp boundaries (2).• Ruler markings: Straight, high-contrast linear structures originating from measurement tools placed near the lesion (12).• Ink markings: Irregular colored traces (typically blue or black) introduced during clinical examination (7).• Patches: Colored adhesive markers placed on the skin near the lesion during image acquisition, varying in shape and color (6).Figure 2 shows representative examples of the seven dermoscopic artifact categories considered in this work, using images from the ISIC-2019 dataset. Each subfigure shows the typical visual appearance and variability within a given artifact class. In addition, subfigure (h) highlights the co-occurrence of multiple artifacts within the same image, reflecting the multi-label nature of real-world clinical acquisitions. The first phase of the annotation pipeline consists of artifact-specific detection modules. Six of them (dark corners, ruler markings, patches, gel border, gel bubbles, and ink markings) rely on classical imageprocessing techniques, while hair detection employs deep learning-based segmentation models due to the morphological complexity of this artifact, as described in Section 2.2.1. This step provides an initial estimate of artifact presence in each image. For each artifact, three complementary detectors are applied in parallel, all targeting the same artifact type while capturing different aspects of its visual appearance, such as color, geometry, or intensity. This design allows the method to handle the variability in how a given artifact appears across patients, imaging devices, and acquisition conditions. For each artifact category k, the outputs of the three detectors d(k) 1 , d(k) 2 , d (k)3 ∈ {0, 1} were aggregated using a majority-voting rule. An artifact was considered present when at least two of the three detectors provided a positive response; otherwise, it was considered absent. Accordingly, the output of this phase (Phase 2) is, for each image, a seven-dimensional binary vector indicating the presence or absence of each artifact category. The intermediate binary masks produced by the individual detectors are generated only as part of the detection process and are not part of the released annotations. The detectors for each artifact are defined as follows:Hair detection was addressed using an ensemble of three deep learning segmentation models (Attention U-Net ( 18), Dense U-Net (19), and Attention Dense U-Net (20)), selected to capture the high morphological variability of hair structures, following our previous hair-removal work (4). Each model k ∈ {1, 2, 3} produces a binary mask M (k) ∈ {0, 1} H×W , where H and W are the height and width of the image. Hair presence was quantified using the hair density ratio:R (k) hair = 1 HW H i=1 W j=1 M (k) ijAn image was labeled as containing hair ifR (k)hair > τ hair , where τ hair was empirically selected in the range [0.01, 0.05] and set to 0.03. Final predictions were obtained via majority voting across the three models. Dark corners correspond to underexposed regions located at the edges of dermoscopic images, typically caused by the dermoscopic lens geometry (17). Detection was performed using three complementary detectors in the HSV, YCrCb, and CIELAB color spaces.For each color space, the image was thresholded to obtain a binary mask highlighting low-luminance pixels near the image borders. The image was then divided into four quadrants: top-left, top-right, bottomleft, and bottom-right. For each quadrant, rows and columns along the image borders were analyzed. For every border row or column, we computed the proportion of pixels classified as dark:f border = number of dark pixels in row/column number of pixels in row/column A border region was considered dark if f border ≥ τ border . The threshold τ border was empirically selected by evaluating values in the range [0.005, 0.05], with the final value set to 0.01. This choice allowed detection of subtle vignetting effects while remaining robust to noise. The final label was obtained by majority voting across the three color-space detectors.Ruler markings were detected by identifying straight line segments using the probabilistic Hough transform (21). To account for variability in ruler appearance and image resolution, three complementary detectors were used with different parameter configurations, including accumulator thresholds in the range [50, 150] and minimum line lengths in [10,25] pixels. The final configurations were set to accumulator thresholds of 50, 100, and 150, and minimum line lengths of 10, 15, and 25 pixels for the three detectors, respectively. The probabilistic Hough transform represents each detected line as a finite segment defined by two endpoints, (x 1 , y 1 ) and (x 2 , y 2 ). This formulation is appropriate for dermoscopic images, where the straight edge of a ruler typically appears as multiple fragmented segments rather than as a single continuous line. Due to the rigid linear structure of a ruler, all fragments belonging to the same ruler are expected to share a common orientation. The orientation of each segment was therefore computed as follows:θ = arctan y 2 -y 1 x 2 -x 1The dominant direction θ * was estimated as the most common orientation among the detected segments, and only segments satisfying |θ -θ * | < τ tol were retained. The tolerance parameter was selected in the range [5 • , 15 • ], with τ tol = 10 • . A positive detection was assigned if at least one set of aligned segments was identified, and final labels were obtained via majority voting.Patches were detected using three color spaces (HSV, YCrCb, and CIELAB). These detectors were designed to capture the warm (yellow, orange, red) and cool (green, blue) chromatic tones that are characteristic of adhesive markers. To reduce false positives, lesion regions were first segmented