## 2 Materials and Methods
### Automatic Skin Ulcer Segmentation  
This section describes the process of automatically identifying and outlining the boundaries of skin ulcers from standard digital photographs using advanced artificial intelligence (AI) techniques. The primary goal of this process was to accurately and objectively assess the wound's characteristics without relying on manual methods, which can be time-consuming, prone to human error, and often inconsistent. To achieve this, the method employed a state-of-the-art AI model known as YOLOv8-seg, a neural network specifically designed for tasks involving object detection and segmentation. This AI model was trained on a dataset of wound images to recognize and distinguish ulcer areas from the surrounding healthy skin or background. The training process involved exposing the model to various wound images, augmented with techniques like blurring, grayscale conversion, and contrast enhancement, to improve its ability to generalize across different wound types and imaging conditions. Once trained, the model processed each input photograph, identifying the wound and creating precise outlines or masks that delineated its boundaries. These automatically generated outlines served as a foundation for further analyses, such as calculating wound dimensions and integrating the data into three-dimensional models. By automating this initial step, the approach ensured a high degree of accuracy and reproducibility, making it an essential component for advanced wound assessment systems and clinical applications. The YOLOv8-seg network [23] was chosen since it has demonstrated significant effectiveness when applied to various medical applications, such as cancer detection [24; 25], skin lesion segmentation [26], and pill identification [27]. These applications have led to marked improvements in diagnostic accuracy, enabling more precise assessments and earlier detection. Additionally, the integration of such models has streamlined treatment processes, allowing for faster and more efficient therapeutic interventions. The underlying architecture is based on a Region-based Convolutional Neural Network (R-CNN), structured with alternating convolutional layers, pooling layers, and activation functions to extract relevant features from input data and perform object detection tasks. For the current application, we utilized the YOLOv8-seg model, a state-of-the-art variant of the YOLO framework, pre-trained on the large Common Objects in Context (COCO) dataset. This open-source model, available from Ultralytics, has been specifically designed to address challenges in real-time object detection and segmentation. In particular, the YOLOv8-seg version incorporates improvements for more precise object localization and segmentation, making it well suited for tasks that require high accuracy in distinguishing objects of interest within complex images. The Region Proposal Network (RPN) employed by YOLOv8-seg performs a critical function by first localizing the object of interest within an image using a bounding box. Once the object is localized, the network segments it from the background or other surrounding elements. This two-stage process, which involves object localization and segmentation, ensures that the model can effectively distinguish the target object with a high precision degree, even in cluttered environments. YOLOv8 uses the max pooling operation in its pooling layers to help reduce the spatial dimensions of the feature maps, which aids in capturing essential information while minimizing computational complexity. The intermediate layers of the network utilize the Sigmoid Linear Unit (SiLU) as the activation function, which introduces non-linearity and helps the network learn complex patterns more effectively (1). In the final layer, the sigmoid activation function is applied to produce the output of the model, ensuring that the results are appropriately scaled for binary classification tasks, such as determining the presence or absence of an object within a given region (2).