1 Introduction

Rheumatoid arthritis (RA) is a chronic inflammatory connective tissue disease, in which the immune system gets confused and starts to attack the body’s healthy tissues that lead to cartilage, bone, and periarticular tissue damage. It is estimated that the number of registered cases per year varies between 20 and 50 per 100,000 inhabitants of European countries [1]. RA may occur at any age; however, the highest incidence is observed in people over 40 years of age, three times more often in women [2, 3, 4]. The most affected by RA disease are hands, specifically proximal interphalangeal joints, metacarpophalangeal joints, and wrist [5]. The main symptoms of rheumatoid arthritis are joint pain, swelling, warmth, redness, and stiffness, which can be reduced by using novel techniques for better diagnostics, and appropriate treatment. Currently, the diagnosis of RA is based on the 2010 revised criteria of the American College of Rheumatology (ACR) [6], which includes clinical and laboratory parameters. In patients with an equivocal clinical examination, the diagnosis is often supported by medical images findings [7,7,8,10, 11]. However, there are multiple drawbacks associated with available imaging, including cost, accessibility, patient comfort, safety, and reliability. The technique which may present excellent potential in RA diagnostics is infrared thermography (IRT). In medical applications, it is considered as a sensitive, non-invasive, and accessible method for monitoring the severity of the inflammation in animals and humans [12,11,14]. Based on several articles from 2010–2019, the authors of previous related research used passive and active thermography in medical applications such as breast cancer, diabetes neuropathy, and peripheral vascular disorders detection [14,13,14,17]. Also, in Raynaud’s phenomenon, infrared thermography was widely used to define potential endpoints in therapeutic trials [18]. In rheumatologic diseases, thermography with a cold provocation was applied [19,18,21]; this can be reasonable because inflamed tissue woven reacts differently to a thermal stimulus due to increased synovial vascularization of the joints affected by this disease [22,21,24]. Despite the fact that the cold provocation was applied in many applications and a wide range of variation of this procedure has been published, elaboration procedures related to the cold challenge test applied for rheumatoid arthritis patients is the first necessary step in defining standard procedures in those group of patients. Previous measurement protocols [25,24,27] designed to assess the inflammation in rheumatoid arthritis patients have focused on measuring the digital response of the blood vessels to a cold provocation and rewarming of the whole hand, rather than simply monitoring the temperature of the fingers. In this case, various methods of determining the area of interest were used to find patterns characteristic of RA in thermovision measurements. Frize and others [28] made thermograms of the hands, wrist, and knee joints in a group of healthy participants and patients with RA. Regions of interest were selected manually from grayscale images, using anatomical areas as reference points to locate the synovium. The analysis of temperature differences between patients and healthy subjects was carried out based on statistical parameters. Statistically significant differences were observed for MTP2, MTP3, and PIP3 joints. In [29], Suma et al. used a threshold-based image segmentation in which an optimal threshold value was manually selected by trial and error method, and based on that, hot spot region was segmented. However, the manual method of determining the region of interest (ROI) is burdened with the risk of omitting a part of the inflamed area or defining too wide the area that includes healthy tissue. Therefore, Snekhalatha et al. [30, 31] determined ROI automatically and examined the temperature of the palm for RA patients and healthy people by using k-means method, fuzzy c-means, and expectation maximization (EM) algorithm to quantify disease changes. Statistically significant higher temperatures were observed for the joints: MTP2 and MTP3 in RA patients compared with the control group. Due to of different approaches of inflammation detection in RA patients, this study aimed to investigate whether the use of infrared thermography and measurement of temperature profiles along the hand fingers could detect the inflammation status and improve the diagnostic accuracy of the cold provocation test (0 °C for 5 s) and rewarming test (23 °C for180 s) in RA patients. As part of implementing this aim, the study required the following: (a) design of a suitable protocol to record thermal imaging data; (b) development of a processing method for region of interest identification; (c) variability evaluation of finger temperature on cold stress and during rewarming; (d) evaluating temperature as a discriminator between individuals with or without RA.

2 Methods

2.1 Subjects

The study was performed at Bialystok Medical University (Rheumatology and Internal Diseases Clinic) in the period 01/2017–06/2018. The measurement was taken for 30 patients selected from a total group of 59 patients hospitalized due to rheumatoid arthritis (RA) (mean age = 56.5 years, standard deviation = 13.0 years). Each of the subjects was qualified to one of the six following biological therapy: certolizumab + MTX, etanercept + leflunomide, etanercept + MTX, etanercept + MTX + sulfasalazine, adalimumab + MTX, rituximab + MTX, tocilizumab + MTX, golimumab + MTX. Qualification for treatment, drug dosing regimen, and drug administration was consistent with the B.33 drug program: treatment of rheumatoid arthritis and juvenile idiopathic arthritis with aggressive disease. The criteria for subject’ inclusion in the study were as follows: age over 18 years, duration of anti-rheumatic therapy over 1 year. The exclusion criteria were age below 18 years old, consumption of alcohol or caffeinated drinks 24 h, smoking 2 h before the procedure, and exercise 1 h before the study. Twenty-two healthy volunteers (mean age = 49.8 years, standard deviation = 7.5 years) were involved in this study as a control group. The inclusion criteria for healthy subjects were no diseases found and aged 18 to 65 years. The patients participated in the study with their consent, according to the declaration of Helsinki. The Polish Regional Committees have approved this study for Medical and Health Research Ethics (Medical University of Bialystok, No. R-I-002/16/2016).

2.2 Measurement protocol

All infrared thermal image recordings were carried out in the same room at Bialystok Medical University at Rheumatology. A primary demographic parameter and the participants’ age, height, weight, and BMI were collected. The thermograms on the dorsal aspect of the hand fingers for each subject were taken with the FLIR thermal imaging camera E60bx (Systems Inc., USA) with a resolution of 320 × 240 pixels and thermal sensitivity of < 0.05 °C. The measurement conditions were as follows: air humidity 55%, emissivity 0.98, air and ambient temperature 23 ± 1 °C. Before image acquisition, all subjects were asked to sit for 15 min in a temperature-controlled room to adjust to the laboratory temperature. All thermographic images were made in the same place at the same time of the day (approximately 1:00 p.m.). In the seated position, a 30-s baseline hand skin temperature was recorded two times per patient; then, subjects were instructed to immerse both hands up to the wrist in water thermostatically controlled at 0 °C for 30 s; the procedure allowed a local skin temperature drop of 4–5 °C. Immediately following the hand-immersion period, the subject removed their hands from the water, and the rewarming period was for 180 s; it was found a thermal stabilization. The water temperature was continuously monitored with a digital thermometer and controlled with a mercury thermometer before each measurement. The water temperature was maintained within 0.5 °C of the target value with the administration of additional ice. A diagram of the setup for the data recording is provided in Fig. 1.

Fig. 1
figure 1

A schematic diagram of the experimental set up

Two videos per patient were taken for fingers from the dorsal side, because in the literature, the vascular anatomy of the dorsal side of the hand has not been studied in detail [32].

2.3 Image processing

The video and image processing was carried out using Matlab package (MathWorks, Natick, MA, USA). The procedure included a few steps (Fig. 2). In the first step, the thermograms were converted into a greyscale image.

Fig. 2
figure 2

Infrared thermal image processing scheme

The pre-processing included an image smoothing and denoising using an average and median filter with a 3 × 3 mask, respectively. In the aim of improving the image, gamma correction was applied. Then, binarization was performed using the Balanced Histogram Thresholding (BHT) algorithm, extracting the background image B = {cx, y} and the hand H = {cx, y} where H ∩ B = 0. The optimal threshold value was defined by probability density functions (histograms):

$$ \left\{\begin{array}{l}{t}_{\mathrm{lim}}={h}^{\prime }(t)\\ {}{\tau}_{\mathrm{lim}}={h}^{\prime}\left(\tau \right)\end{array}\right.. $$
(1)

The hand was obtained by combining pixels that fulfilled the following criteria:

$$ H=\left\{\left.{c}_{x,y}\kern0.5em \right|\kern1.5em {t}_{x,y}>{t}_{\mathrm{lim}},\kern1.5em {\tau}_{x,y}>{\tau}_{\mathrm{lim}}\right\}. $$
(2)

The morphological processing of the image was based on the combination of two fundamental procedures: erosion and dilation. In the second step, the image was subjected to the process of skeletonization using an iterative algorithm for extracting the finger axis [33]. The iterative algorithm based on the DFS (depth-first search) method was the last stage of segmentation (Fig. 3).

Fig. 3
figure 3

Modified depth-first search algorithm

The modified depth-first search procedure is presented as follows:

  • STEP 1: Searching of the vertices. The points are divided into three groups. The points with more than two neighboring become the vertices of a graph, and those with only one nearby become the extreme vertices of a graph.

  • STEP 2: Generation of the edges. The points with two neighboring are combined in the edges of the graph. The edges of a graph with two extreme vertices are deleted; the edges of a graph with one extreme vertex are the extreme edges.

  • STEP 3: Selection of entry points. The extreme edges are selected from the set of extreme edges and are associated with the end of five fingers and one axial line of the wrist. The angle between any pair of fingers should not exceed 180°, and the angle between a wrist and any of fingers should be less than 90°. The algorithm goes to the fifth step if only six extreme edges are selected, the extreme vertices of which become entry points. All the other extreme vertices remain nameless.

  • STEP 4: Specification of the entry points. The selected extreme edges are combined into two different groups (fingers and wrist) if more than six extreme edges were selected. Then, the maximum distance between the extreme vertices in opposing groups as well as the minimum distance from an image border is checking. The extreme vertices of the six or more extreme edges become the entry points.

  • STEP 5: Building a palm model. The entry points are a wrist, a thumb, a little finger, middle finger, index finger, and ring finger. The graph is traversed by the recursive method, but an order of neighboring vertices visiting is variable (Fig. 4). The choice of this order depends on which finger or wrist the entry point is associated with. A route of traverse consists of edges. A route is considered false if it ends at a nameless extreme vertex. A route is recognized as true if the ratio of its length to palm size is anatomically proportional or ends by touching another true route. The edges lying on the true routes are combined into broken lines and become a model of the palm. The algorithm is complete if there are only six entry points.

Fig. 4
figure 4

Variable order of neighboring vertices visiting

  • STEP 6: Competition of palm models (Mi : i = 1, 2, …, n| n > 1). The fifth step of the algorithm is performed several times if there are more than six entry points. The resulting palm models are evaluated according to several criteria, including the mandatory touch of all routes \( \left({R}_1^i,{R}_2^i,\dots, {R}_6^i\right) \) with each other, and the minimum number (k) of short segments creating a deviation from a straight line. The algorithm is complete if the only winner of the competition is determined.

$$ \exists i:{R}_1^i\cup {R}_2^i\cup \dots \cup {R}_6^i\ne 0\mid k\to \min . $$
(3)
  • STEP 7: Averaging of uncompetitive palm models. The routes are being averaged if the winner of the competition has not been determined. The algorithm is complete if the averaged routes differ from each of the averaged routes \( \left(\overline{M}\right) \) by less than 5%:

$$ \forall i:\overline{M}={M}_1\backslash {M}_2\backslash \dots \backslash {M}_n\mid 0.95\cdot {M}_i\le \overline{M}\le 1.05\cdot {M}_i. $$
(4)

2.4 Statistical analysis

Method reproducibility was the coefficient of variation (%CV = σ/μ × 100). Data from infrared thermography were plotted to investigate whether they were normally distributed. Where data appeared to differ significantly from a normal distribution, the Mann-Whitney U test was used (Statistica 13.1, StatSoft, Krakow, Poland). A value of p < 0.05 was considered to be statistically significant. Differences between groups over time for infrared thermography were investigated using two-way analysis of variance. The diagnostic accuracy was investigated using receiver operating characteristics (ROC) analysis to establish the optimum outcome metric for distinguishing between groups that minimized the false-positive and false-negative results. The area under the ROC curve was also derived and tested to determine if this were significantly greater than 0.5. Sensitivity and specificity were also defined from the ROC analysis.

3 Results

The demographics (age, BMI) and clinical (disease duration, erythrocyte sedimentation rate (ESR), C-reactive protein (CRP), red blood cells (RBC), white blood cells (WBC), platelet (PLT), and the disease activity score 28 (DAS28)) for the healthy and RA patients recruited to this study are included in Table 1.

Table 1 Mean (SD) value of demographic and clinical data of typical and RA subjects

Coefficient of variation (CV) was 0.04%. A comparison between right and left fingers showed no significant difference in temperatures (p > 0.05), so for further analysis, the dominant hand was used (Fig. 5). The temperatures recorded were baseline (T1), post-cooling (T2), and post-rewarming (T3).

Fig. 5
figure 5

Thermograms images: a) baseline, b) post-cooling, c) post-rewarming

The dynamic temperature of fingers profiles was corresponded to thumb, index finger, middle finger, ring finger, and little finger. Outcomes were the minimal and maximal: baseline temperature (T1), the temperature post-cooling (T2), and the temperature post-rewarming (T3) (Fig. 6).

Fig. 6
figure 6

The mean (SD) of maximum and minimum temperatures of finger profiles of RA patients and healthy participants

The temperatures at baseline were better discriminators between RA patients and healthy than the temperatures measured directly post-cooling and post-rewarming. However, the differences were not statistically significant (p > 0.05). Afterwards, the difference between the maximum and minimum temperature Tmax-Tmin along the axis of each finger for the baseline, post-cooling, and post-rewarming was calculated (Table 2).

Table 2 The mean difference Tmax-Tmin (SD) from the finger profiles of RA patients and healthy participants

The statistically significant difference for the thumb, index finger, middle finger, and ring finger was observed (p < 0.05) post-cooling and post-rewarming. The diagnostic accuracy of the infrared measurements for the same challenge was also investigated for each of the outcome parameters at each time point. The sensitivity, and area under the ROC curve for the settling period and three-time points during recovery are presented in Table 3. The best values of classification parameters were obtained for the thermogram post-cooling (Fig. 7).

Table 3 The ROC curve (AUC) of difference between Tmax-Tmin post-cooling
Fig. 7
figure 7

Comparison of ROC curves representing RA threshold values determined from the value of the Tmax-Tmin of fingers post-cooling

The statistically significant predictors were four fingers: thumb, index finger, middle finger, and ring finger (p < 0.05). There were no significant differences between the areas under the ROC curve for little finger (p > 0.05). ROC curves were established, being a graphical sensitivity characteristic as a function of the inverse of specificity.

The curves representing the fingers are above the line representing the function x = y, which show that the thumb, index finger, middle finger, and ring finger are predictors better than the random predictor and suggest that these fingers may be useful diagnostically.

4 Discussion

The literature shows that a hot spot is correlated with an increase in local blood flow [32,31,34]. The main focus of this study was to investigate whether the use of infrared thermography and measurement of temperature profiles along the hand fingers could detect the inflammation. Therefore, we looked for patients with different disease duration and compared them with an age-matched group of healthy adults. In this study, we compared measuring max (Tmax) and min (Tmin) temperature as well as the difference between Tmax-Tmin skin in three stages: baseline, post-cooling, and post-rewarming to investigate which may be the most useful diagnostically. The approach presented in this study is different from the proposed by the other authors. Snekhalatha et al. [30] examined hand temperature distribution of RA patients and healthy people and used k-means segmentation algorithms to quantify inflammatory lesions. In [35], Pauk et al. discriminated patients with moderate and high disease activity based on DAS28 [35]. Ring [36] studied Raynaud’s phenomenon; the ring determined the differences between specific areas. In the current paper, we found that the baseline temperature of fingers in RA patients is not statistically significantly different from healthy participants (p > 0.05). However, the use of a cooling test allowed for increasing the temperature contrast between the maximum and the minimum temperature (Tmax-Tmin) along the fingers axis.

Dynamic infrared thermography, which is used in our approach involves thermal provocations tests [37]. Previously, it was used in investigating circulatory disturbances, especially in the hands such as vasospastic disorders seen in Raynaud’s phenomenon [25, 27, 38]. According to the measurement protocol, it has been reported that using infrared thermography with a water temperature of 5 °C for 1 min gives a good sensitivity, specificity, positive predictive value, and negative predictive value for the diagnosis of digital vasospasm [27]. In [39], the authors used a cold provocation test in water 15 °C for 5 min; it was not found to be statistically significantly different patients from controls. Ring [36] used a cooling time of 60 s in water temperature from 0 to 20 °C for Raynaud’s phenomenon. Laskar and Harada [40] proposed the cold water immersion test for diagnosing hand-arm vibration syndrome in temperature 10 °C and 15 °C in immersion time 1, 5, and 10 min. When the infrared measurement technique was applied to our population with our cold provocation test in water 0 °C for 5 s, there was a tendency for the mean Tmax-Tmin temperatures to be lower by 4–5 °C. The rewarming process was 180 s because after the time there was a tendency to the temperature stability. The temperature Tmax-Tmin measured along the fingers line was higher in RA patients compared with healthy participants. The statistical significance was confirmed for the thumb, index finger, middle finger, and ring finger, with highest ROC value for the index finger (0.68), p < 0.05. The clinical manifestations of early RA are different from the symptoms seen in severe RA. In the current paper, all RA participants were diagnosed with moderate (DAS28 > 3.2 and ≤ 5.1) or high (DAS28 > 5.1) disease activity. In the advanced stage of RA, a prevalent post-articular complication is a vasculitis, which is 90% of patients manifest as focal ischemia of the fingers. In the histopathological evaluation of the patient’s tissues, necrotic features of small vessels are visible [41]. Thus, the presented RA discrimination method relates to moderate and high activity, which is characterized by the presence of degenerative processes and has a different distribution of inflammation than early RA. The indicators designated in this article may have different values for patients diagnosed as having low RA activity (DAS28 ≤ 3.2).

Since the known automatic procedures distinctly accelerate the diagnostic procedures and are far more reproducible when compared with manual ones, there is a need of extending such methods into different fields of medicine, especially including diseases which are difficult to diagnose at an early stage. One of the diseases characterized by multiple different symptoms in its beginning is rheumatoid arthritis. During the chronic illness, an inflammation manifests itself in the local rise of the temperature in the area of the hand. In infrared medical diagnostics, different processing procedures as diversified region of interest (ROI) identification algorithms have been presented, both automated and semi-automated. Automatic identification of ROI is a promising, time-saving approach to medical diagnostics. However, apart from multiple indisputable advantages, this method introduces several challenges. Biological structures are very complex, especially in the human body, and the main concern is a proper representation of their morphology. Herry and Frize [41] presented a computerized assessment of thermal images. The authors used the Gaussian function to smooth the computed histogram of the image and then calculated the extreme values of the resulting function. Umapathy et al. [42] detected ROI region semi-automatically using an area tool in the defined square ROI positioned over the following joints proximal interphalangeal joints and metacarpophalangeal joints of the hand with the using FLIR software. Minimum, maximum, and average temperature was determined for all defined ROIs. Suma et al. [29] performed a thermographic evaluation of rheumatoid arthritis and presented results obtained using threshold-based color image segmentation. They quantized thermal image into 16 colors—combination of indices which had maximum components of ROI comprised a segmentation mask. We applied an average and median filter to image pre-processing. Then, the Balanced Histogram Thresholding algorithm, extracting the background image and the hand was used. Probability density functions defined the optimal threshold value. In the aim of ROI identification, we modified the iterative algorithm based on the DFS (depth-first search), which allowed to define finger profiles that were presented. Our algorithm improved the idea of a standard DFS algorithm. We considered the graph as conditionally directed before starting a traverse, and the traverse of the graph started from several entry points. The initial direction of the graph affected the way of the traverse. The graph became directed ultimately after analysis of all found routes, and it was recognized as a palm model.

The strength of the study is the proposition of a new measurement protocol with the information about the time of the phase of cooling and rewarming and also a new algorithm of ROI identification. The shortcoming of this paper is the small number of evaluated RA patients. Further studies are required to achieve confirmation of these findings. Additionally, during investigating hand skin temperatures and assessing rewarming capability, individual peripheral thermoregulation should be taken into account in RA patients. In the future, the use of the presented algorithm in patients with early RA and low disease activity should be considered.

5 Conclusions

It is essential to have a sensitive tool for inflammation detection based on non-invasive imaging data, especially in patients of no univocal clinical features. The use of infrared thermography and a new measurement protocol for temperature profiles of hand fingers allowed to detect the inflammation and improved the diagnostic accuracy of the cold provocation test in RA patients. The use of a cooling allowed for increasing the temperature contrast between the maximum and the minimum temperature of ROI. After the cold water provocation, the Tmax-Tmin presented the highest potential differentiating RA patients and healthy during three analyzed stages: before cooling, post-cooling, and post-rewarming. Higher index values were observed for RA patients. The results proved that the thumb, index finger, middle finger, and ring finger maybe useful diagnostically.

Proper identification of anatomic structures is crucial when diagnosing tissue abnormalities, monitoring disease courses and treating medical conditions. Manual assessment techniques require qualified medical staff and are error-prone due to operator-related factors. Automated segmentation methods do not need any assistance from a medical expert and are characterized by the reproducibility of obtained results. According to our best knowledge, this is the first study with the DFS algorithm to ROI identification from the thermography images.