Introduction
Capillaroscopy is a simple, non-invasive, inexpensive and repeatable method of assessing the structure of the nailfold capillaries. It has found its widest application in rheumatology, where it is used to differentiate the primary and secondary Raynaud syndrome, as well as diagnostics and monitoring of systemic sclerosis (SSc) and other diseases within its spectrum [1–4]. Vascular lesions are also described in the course of other rheumatological diseases, such as rheumatoid arthritis (RA), antiphospholipid (APS) or primary Sjögren’s syndrome (pSS), as well as non-rheumatic diseases such as diabetes mellitus (DM), arterial hypertension (AH), and coronavirus disease 2019 (COVID-19) [5–8]. It is crucial to note that the study’s value lies in the fact that the structure of the vessels remains practically unchanged from early youth to late senility. This highlights the clinical significance of even minor changes. Although the test is simple, proper assessment of the images requires knowledge and experience. It is estimated that the agreement between researchers regarding the presence or absence of scleroderma pattern microangiopathy and assessment of its progression exceeds 80%, even among researchers with low experience [9]. Compatibility is lower in more detailed assessment of the vessel’s structure. In the capillary classification, categorizing as normal, abnormal and not evaluable, the agreement does not exceed 70%. This indicates that the capillaroscopic examination is highly burdened by the subjective assessment of the researcher [10, 11]. Considering the subtlety of changes observed in diseases other than the spectrum of SSc, the impact of experience and a subjective assessment of the researcher on the result obtained causes the examination to lose its clinical usefulness. For this reason, it seems extremely important to develop systems enabling one to obtain objective and repetitive results, making wider standardization possible. Along with the rapid development of technical capabilities, tools based on artificial intelligence can help achieve more detailed standardization of imaging analysis, especially in radiology [12]. They will allow for more detailed and objective tracking of capillary reconstruction and can increase the popularity of the study. Although capillaroscopy is one of the necessary elements of the diagnostics of SSc [13], it is still not widely available. As demonstrated in a survey conducted by Eden et al. [14], up to 60% of rheumatologists do not have access to capillaroscopy or do not perform examination. Automatization of assessment and shortening its time can have a positive impact on its popularization and increase its clinical usefulness.
The aim of the present study was to validate automated software for classifying the nailfold capillaroscopy as normal or pathological and counting (detecting) the number of vessels per millimetre.
Material and methods
We selected 100 normal and 100 pathological nailfold capillaroscopy images. The photos were obtained from the archives of the Rheumatology Department. The original examination was performed with Dinolite MEDL4N Pro and photos were taken in 200× zoom. Pathological images contained pattern abnormalities typical as well as nonspecific for scleroderma. All of the images were analysed manually. In dedicated working software the region of interest (ROI) and separate capillaries were marked (Fig. 1).
Based on data from the working program, the neural network was trained using the fast.ai library [15], based on PyTorch technology. The ResNet-34 deep residual neural network was chosen for the normal/pathological binary classification task. For calculating the number of capillaries per mm the image object detection was performed using the YoloV3 Darknet algorithm [16]. The dataset was split into training, validation and test sets, using the proportion 70/20/10. Due to the small number of images, 10-fold cross-validation with validation and test set was used. The YoloV3 was trained specifically on the given database of the capillaroscopy images, without using a pretrained model, due to the specific nature of the medical images.
Data analysis
The results were calculated using bespoke, author-made software using the Python programming language and Numpy/Scikit-learn packages. The compatibility between the manual assessment of nailfold capillaroscopy images and the result obtained during the automatic analysis was investigated per rater through intraclass correlation coefficient (ICC) and reported with the 95% confidence interval.
The meaning of the parameters is as follows:
IOU – Intersection over Union – it is a classic, state-of-the-art measure used in object detection – the area of intersection of real and ground truth capillaries is divided by the area of union of these images. A value of IOU higher than 50% is generally considered as a good result;
PCDI – the number of correctly detected capillaries divided by the number of all ground truth capillaries, with IOU higher than 50%.
Results
The results obtained in neural network training were compared to the results obtained in manual analysis by an experienced clinician. Figures 1 and 2 show a window of working software for the designation of the first line and individual capillaries, and graphical presentation of accuracy in capillary counting by automatic software.
Compliance in the field of image classification as correct/pathological between manual and automatic assessment was evaluated. The sensitivity of the automatic tool was 89.0%, specificity 89.4% for the training group, in validation 89.0% and 86.9% respectively. In the course of further research, the neural network was taught to count the capillaries in the first line of the nail shaft, using the Darknet YOLOv3 algorithm. The following parameters of the automatic image assessment accuracy were evaluated: intersection over union 50.82%, precision of correctly detected images 56.37%; precision of ground truth images detected within region of interest 78.03%; precision of real images detected within region of interest 96.48%.
Discussion
The presented data are the early results of experiments to create a fully automatic tool for assessing capillaroscopic images. Obtaining precision of 96.48% despite using images of various quality and visibility of capillaries suggests that the tool created will be a source of reliable and repetitive data. Although the capillaroscopy examination is technically easy, many difficulties can arise from interpretation of the obtained image, which requires experience and meticulousness. The subjectivity of image assessment has been a focus of researchers’ interest since the 1990s. Firstly, an attempt was made to objectify the measurements of vascular loops using a semi-automatic system that allows for the measurement of capillary width at its various points and assessment of the shape of the assessed loop [17]. Over the past twenty years, several assessment systems have been created, with the main function being to distinguish patients suffering from SSc from healthy people or presenting the primary Raynaud syndrome. However, these systems lack the capability to count individual pathological changes [18–21]. Some tools allow further assessment of the class of microangiopathy [22, 23]. A few of the developed tools have the capability of automatic or semi-automatic counting of capillaries [19, 24–26] and some also count the number of haemorrhages and megacapillaries [27]. Only the program of Garaiman et al. [28] refers the results to the currently obligatory rating standards, compatible with The European Alliance of Associations for Rheumatology (EULAR; formerly European League Against Rheumatism) recommendations from 2016 [10] and 2022 [2]. However, the described software is not available. The ability to count the standard described capillary pathologies is also a feature of a tool created by Berks et al. [20]. However, the result is a cumulative model for diagnosing scleroderma microangiopathy, combining the average values of vessel width, their maximum width, density, shape, and disorganization points created for the purposes of testing. In addition to the tools described above, there are only two aimed at diagnosing diseases other than SSc. The first aimed at the diagnosis of juvenile dermatomyositis [29] and the second diagnosis of late diabetes mellitus complications [30]. The currently available literature lacks reports on the development of artificial intelligence for analysing capillaroscopic images of adult patients suffering from inflammatory myositis, systemic lupus erythematosus, pSS, or other diseases in which vascular lesions were described. Except for the Shah et al. [30] study cited above, the tools available in the literature, in the vast majority of cases, do not provide the number of abnormal capillaries, which would allow further, objective research on the use of capillaroscopy in diagnostics and follow-up of diseases other than SSc. Despite the potential for wider use of capillaroscopy thanks to the use of AI tools, the test results obtained in this way should never be separated from a full assessment of the patient’s clinical history and without a critical assessment of the physician performing the test.
While the current results prove to be satisfactory for the moment, further plans assume performing classification of multiple different characteristics of capillaries, and to achieve the proper distinction between the classes, a much bigger database must be constructed, including examples of all the vessel structures. Also, it should be noted that use of deep learning neural networks requires application of sophisticated, advanced and therefore expensive computing resources (including high-performance graphics processing units, GPUs). Therefore, extending the database would most certainly increase the time and cost of the process of neural networking learning.
Conclusions
The present study is the beginning of work on software that enables the repetitive and detailed assessment of capillaroscopic images based on the latest achievements of modern technology, specifically the widespread use of artificial intelligence as a tool supporting daily clinical practice. Unlike previously described tools, in addition to assessment of the presence or absence of scleroderma pattern and its progression, the proposed system will allow for numerical analysis of implemented images. Furthermore, its use is not limited to patients with suspected SSc. Accurate and repeatable numerical values of individual pathological changes can allow a detailed analysis of microcirculation changes in diseases where the reconstruction of the vessels is less characteristic than in SSc like RA, pSS, and also DM, or AH. The possibility of quickly analysing a large number of capillaroscopic images and obtaining a detailed numerical result will make it possible to expand research on the usefulness of capillaroscopy also in diagnostics and assessing the progression of other diseases in the course of which the capillaries are rebuilt.