# Image Features of Resting-State Functional Magnetic Resonance Imaging in Evaluating Poor Emotion and Sleep Quality in Patients with Chronic Pain under Artificial Intelligence Algorithm

Authors: Shuqin Yang; Xiaoyan Bie; Yanmei Wang; Junnan Li; Yujing Wang; Xiaoyan Sun
Journal: Contrast Media & Molecular Imaging
 (2022)

---

## Abstract

The balanced iterative reducing and clustering using hierarchies (BIRCH) method was adopted to optimize the results of the resting-state functional magnetic resonance imaging (RS-fMRI) to analyze the changes in the brain function of patients with chronic pain accompanied by poor emotion or abnormal sleep quality in this study, so as to provide data support for the prevention and treatment of clinical chronic pain with poor emotion or sleep quality. 159 patients with chronic pain who visited the hospital were selected as the research objects, and they were grouped according to the presence or absence of abnormalities in emotion and sleep. The patients without poor emotion and sleep quality were set as the control group (60 cases), and the patients with the above symptoms were defined in the observation group (90 cases). The brain function was detected by RS-fMRI technology based on the BIRCH algorithm. The results showed that the rand index (RI), adjustment of RI (ARI), and Fowlkes–Mallows index (FMI) results in the k-means, flow cytometry (FCM), and BIRCH algorithms were 0.82, 0.71, and 0.88, respectively. The scores of Hamilton Depression Scale (HAHD), Hamilton Anxiety Scale (HAMA), and Pittsburgh Sleep Quality Index (PSQI) were 7.26 ± 3.95, 7.94 ± 3.15, and 8.03 ± 4.67 in the observation group and 4.03 ± 1.95, 5.13 ± 2.35, and 4.43 ± 2.07 in the control group; the higher proportion of RS-fMRI was with abnormal brain signal connections. A score of 7 or more meant that the number of brain abnormalities was more than 90% and that of less than 7 was less than 40%, showing a statistically obvious difference in contrastP<0.05. Therefore, the BIRCH clustering algorithm showed reliable value in the optimization of RS-fMRI images, and RS-fMRI showed high application value in evaluating the emotion and sleep quality of patients with chronic pain.


---

## Body

## 1. Introduction

Chronic pain mainly refers to a kind of persistent pain, maintained for more than 1 month (in the past 3 months or half a year) (previously defined as 3 months or more than half a year). It is one of the main clinical symptoms of distant injury. It was called undead cancer that would not cause death, however, it would bring great pain to the patient [1, 2]. If acute pain is defined as a clinical manifestation, then chronic pain can be defined as a painful disease. Chronic pain pathology is widespread in each of our bodies, and its appearance is a reminder of the deterioration of the human body or the health crisis in a certain part of the body [3]. As the pain will bring pain to the patient when the pain occurs, if it is a frequent attack, it will cause the people to suffer from sleep disturbance, lack of appetite, depression, and even personality distortion, which will bring huge damages to individuals, families, and society. It exerts a serious impact on people's lives and health [4–6]. Studies have shown that in patients suffering from pain, a part of the cortex and the subcortical areas of the brain are usually activated [7, 8].Resting-state functional magnetic resonance imaging (RS-fMRI) is a functional imaging technique based on the detection of blood oxygen level-dependent (BOLD) signals in the cerebral blood vessels [9]. The RS-fMRI examination does not require any peculiar stimulation to the patient but only requires the patient to remain calm and awake. It has low requirements for use and helps to respond to the continuous and general effects of specific diseases. Therefore, it is widely used in the functional research of various specific diseases. RS-fMRI is simple, convenient, and suitable for patients with cognitive impairments who show difficulty to complete tasks. It can be widely used in the research of central nervous system-related diseases, reflecting the state of brain function in the basic state.A balanced iterative reducing and clustering using hierarchies (BIRCH) [10] is proposed to better distinguish the brain functions under the RS-fMRI examination. The BIRCH clustering algorithm is a comprehensive hierarchical clustering algorithm, covering the clustering feature (CF) and clustering feature tree (CF tree) [11]. The CF tree summarizes the useful information of clustering and occupies a much smaller space than the metadata collection. In addition, it can be stored in memory, which can improve the clustering speed and scalability of the algorithm on large data collections [12].In this study, patients with chronic pain with poor emotion or sleep quality were selected as the research objects. RS-fMRI was applied to check their brain function status. The BIRCH algorithm was adopted to optimize the results of RS-fMRI to analyze chronic pain and brain abnormalities with poor emotion or sleep quality, aiming to provide data support for the clinical prevention and treatment of chronic pain with poor emotion or sleep quality.


## 2. Methods

### 2.1. Model Establishment Based on BIRCH Clustering Algorithm

Clustering refers to making the data of the same cluster as similar as possible while making the data of different clusters as different as possible. Clustering algorithms are generally divided into partition clustering, density clustering, grid clustering, model clustering, hierarchical clustering, etc. (Figure1). The hierarchical clustering tree in the hierarchical clustering algorithm mainly includes the agglomeration algorithm and splitting algorithm. The basic process is shown in Figure 2. The more commonly used algorithms in the hierarchical clustering algorithm are BIRCH, CURE, ROCK, and CHAMELEON. Among them, the BIRCH shows a better comprehensive effect, fast speed, and incremental clustering. The main part of establishing the BIRCH algorithm is to build the CF tree using CF.Figure 1
Classification of clustering algorithms.Figure 2
Schematic diagram of the process of agglomeration and splitting methods.The role of CF is to ensure that the compressed data can be clustered and to maintain effective information characteristics. It is an important structural element in the BIRCH algorithm [13]. CF uses simple arithmetic to calculate the core clustering features. The specific structural expression is given as follows:(1)CF=W,LS,SS.In equation (1), W was the number of points in the cluster; LS referred to linear sum of W data points in equation (2). SS represented the sum of the squares of W data points in equation (3).(2)LS=∑i=1wxi,(3)SS=∑i=1wxi2.If CF satisfies the linear additive theorem, the clustering characteristics of the two clusters can be set as follows:(4)CF1=W1,LS1,SS1,CF2=W2,LS2,SS2.Then, the clustering characteristicCF of the new cluster can be obtained by merging these two disjoint subclusters to form a new cluster as follows:(5)CF1+CF2=W1+W2,LS1+LS2,SS1+SS2.When CF stores the summary of the subclusters and satisfies the linear additivity theorem, the distance within the cluster can be represented by the CF feature triples. In a clusterxi,i=1,2,3,…,n containing n d-dimensional data points, the cluster centroid x0, cluster radius R, and cluster diameter D were calculated as follows:(6)x0=∑i=1wxiw=LSW,R=∑i=1wxi−x02w=WSS−LS2W2,D=∑i=1w∑j=1wxi−xj2ww−1=2WSS−2LS2WW−1.R and D belong to the nature of a single cluster. If X=x1,x2,x3,…,xnY=y1,y2,y3,…,yn and Y=y1,y2,y3,…,yn refer to two sets of data, then the Euclidean distance and Manhattan distance between the two sets of data are given as follows:(7)dis=x1−y12+x2−y22+⋯+xn−yn2,dis=x1−y1+x2−y2+⋯+xn−yn.Two clusters N1 and N2 are set to bexi⟶,i=1,2,…,N1 and xj⟶,j=N1+1,N2+1,…,N1+N2. Then, the equations of the average intercluster distance D2 and the average intracluster distance D3 can be expressed as(8)D2=∑i=1W1∑j=W1+1W1+W2xi⟶−xj⟶2W1W21/2,(9)D3=∑i=1W1+W2∑j=1W1+W2xi⟶−xj⟶2W1+W2W1+W2−11/2.The CF tree refers to a balance in the clustering algorithm that can make the target cluster quickly. The CF tree contains three nodes: root node, internal node, and leaf node. Each node contains several CFs.B, L, and T are three important parameters in the CF tree. B refers to the maximum number of CFs of each internal node, L is the maximum number of CFs of each leaf node, and the threshold T represents the maximum sample radius of the CFs of leaf nodes. The CF of the internal node is connected to other nodes of the same type. All leaf nodes contain a pointer to the next node and a pointer to the previous node so that all leaf nodes are linked by a doubly linked list. These pointers can help us quickly access the data of the BIRCH algorithm.Generally, precision and recall are adopted for the application effect of the clustering algorithm. The possible results in the application process are shown in Table1.Table 1
Estimated list of classification.
Same clusteringDifferent clusteringThe same classificationTP means the number of data in the same classification divided into the same cluster (a)FN refers to number of data in the same classification divided into different clusters (c)The different classificationFP refers to the number of data in different classifications divided into the same cluster (d)TN refers to the number of data in different classifications divided into different clusters (d)According to the definition in Table1, the accuracy rate is the percentage of data in the same cluster that really belongs to the same category. It can be expressed as follows:(10)precision=aa+d.The recall rate refers to the number of the data of the same cluster that is successfully predicted as the same category. It can be expressed as the equation given as follows:(11)recall=aa+c.The rand index (RI), adjustment of rand index (ARI), and Fowlkes–Mallows Index (FMI) are all external evaluation methods. The clustering results are based on a prespecified structure. All clustering algorithms can be used in general, however, they cannot reflect the internal situation of the data set.If there is a data setX=x1,x2,x3,…,xn composed of n data and the possible clustering situations are the four in Table 1, then RI can be expressed as(12)RI=a+ba+b+c+d=a+bCn2.In the above equation,Cn2 is the total number of all clusters in the data set, and the range of RI is [0, 1]. The closer RI is to 1, the better the clustering effect. Then, ARI can be calculated according to RI, which is specifically expressed as(13)ARI=RI−ERImaxRI−ERI.In equation (13), E [RI] refers to the expected value of the RI. The value range of ARI is [−1, 1]. Then, the larger the value, the better the clustering result.FMI is the geometric average of precision and recall, and the interval is [0, 1]. The larger the clustering effect, the better. The specific expression is as follows:(14)FMI=aa+d∗aa+c=aa+da+c.


### 2.2. Research Objects

In this study, 159 patients with chronic pain who were treated in the hospital from January 2018 to January 2021 were selected as research objects. Among them, 88 were male patients, and 71 were female patients, and they were aged between 30 and 70 years, with an average age of 50.06 ± 5.2 years. The patients were evaluated according to the Hamilton depression scale (HAMD) [14], Hamilton anxiety scale (HAMA) [15], and Pittsburgh sleep quality index (PSQI) [16] to check if there were any abnormalities in mood and sleep, based on which the patients were grouped. The patients without poor emotion and sleep quality were set as the control group, and a total of 69 people were counted. The patients with abnormal emotions (such as depression and anxiety) and abnormal sleep quality (such as insomnia and dreaminess) were set as the observation group, with a total of 90 cases. The brain function was detected by RS-fMRI technology based on the BIRCH algorithm. This study had been approved by the Medical Ethics Committee.The inclusion criteria were defined as follows: (a) patients with chronic pain caused by various physical diseases and patients with a visual analogue scale (VAS) score above 3 points, (b) patients who received HAMD, HAMA, and PSQI scale for emotional and sleep quality assessment, (c) patients who were able to communicate normally and volunteer to participate in a complete study, and (d) patients who had signed the subject’s informed consent forms.The exclusion criteria were determined as follows: (a) subjects who had been medically diagnosed with depression and needed to take medication, (b) subjects who had long-term medication habits and who had not taken analgesics or related medications in the past month, (c) patients with obvious signs of nerve damage, malignant tumors, and rheumatoid, (d) patients with contraindications to the RS-fMRI examination, such as implanted metal (artificial joints and dentures), heart rate regulators, or other medication syringes, (e) pregnant or breastfeeding women, and (f) those who were not in good spirits on the day of the test.


### 2.3. RS-fMRI Method

Both groups of patients were examined using the 3.0 T Magnetic Resonance Imaging (MRI) system and were scanned by the same experienced and highly qualified MRI scanner.Before the start of the scan, the subject was asked to stay at rest, i.e., lying still, closed eyes, and awake, and the subject was asked not to do any thinking. A soft sponge pad is used to fix the subject's head. The acquisition of BOLD is performed with the sequence of T2∗. GRE. EP from top to bottom with oblique axis scan, and the scan range is approximately from the top of the skull to the foramen magnum. The specific scanning parameters are defined as follows: time of repetition (TR) = 2000 ms, time of echo (TE) = 40 ms, field of view (FOV) = 24 cm × 24 cm, flip angle = 90°, matrix = 64 × 64, layer thickness = 5 mm, and layer spacing = 1 mm. The 33-layer image was collected with 240 time points, and the scanning time was 8 minutes. The specific operation is carried out in accordance with the equipment manual and normal operating procedures.On the Matlab platform, the data processing assistant for resting-state fMRI software is used to preprocess the image data. The specific processing methods are as given in the following five steps: firstly, the first ten time points were removed to eliminate the influence of the uneven main magnetic field at the beginning of the scan and to eliminate the subject's inadaptability to the environment. Secondly, the time difference among different layers was smoothed, i.e., correcting the scanning time difference of each layer image. Thirdly, the head movement was corrected, which was to reduce the noise generated during the signal acquisition process caused by the movement of the patient's head. The fourth step is that the spatial difference was corrected. The fifth step is that the data were performed with Gaussian smoothing. After that, the BIRCH algorithm was used to optimize the image obtained above, and the processing process included four stages. Stage 1: it can read the data and build the initial CF tree. Stage 2: the CF tree was adjusted according to the given threshold and branching factor to build a smaller CF tree. Stage 3: all the leaf nodes were clustered again. Then, the sparse clusters were deleted, and the dense clusters were clustered. Stage 4: the cluster center that has been generated was adopted as a seed, and all the sample points were clustered according to the distance.


### 2.4. Statistical Analysis

The SPSS22.0 statistical software system was adopted for data entry, sorting, and statistical analysis. The enumeration data were compared using theχ2 test, the measurement data were compared with a t-test, and multiple sample means were adopted for the comparative analysis of variance. The LSD method was used when the variance was uniform, and the Dunnett T3 method was selected when the variance was uneven. P<0.05 meant statistical difference.


## 2.1. Model Establishment Based on BIRCH Clustering Algorithm

Clustering refers to making the data of the same cluster as similar as possible while making the data of different clusters as different as possible. Clustering algorithms are generally divided into partition clustering, density clustering, grid clustering, model clustering, hierarchical clustering, etc. (Figure1). The hierarchical clustering tree in the hierarchical clustering algorithm mainly includes the agglomeration algorithm and splitting algorithm. The basic process is shown in Figure 2. The more commonly used algorithms in the hierarchical clustering algorithm are BIRCH, CURE, ROCK, and CHAMELEON. Among them, the BIRCH shows a better comprehensive effect, fast speed, and incremental clustering. The main part of establishing the BIRCH algorithm is to build the CF tree using CF.Figure 1
Classification of clustering algorithms.Figure 2
Schematic diagram of the process of agglomeration and splitting methods.The role of CF is to ensure that the compressed data can be clustered and to maintain effective information characteristics. It is an important structural element in the BIRCH algorithm [13]. CF uses simple arithmetic to calculate the core clustering features. The specific structural expression is given as follows:(1)CF=W,LS,SS.In equation (1), W was the number of points in the cluster; LS referred to linear sum of W data points in equation (2). SS represented the sum of the squares of W data points in equation (3).(2)LS=∑i=1wxi,(3)SS=∑i=1wxi2.If CF satisfies the linear additive theorem, the clustering characteristics of the two clusters can be set as follows:(4)CF1=W1,LS1,SS1,CF2=W2,LS2,SS2.Then, the clustering characteristicCF of the new cluster can be obtained by merging these two disjoint subclusters to form a new cluster as follows:(5)CF1+CF2=W1+W2,LS1+LS2,SS1+SS2.When CF stores the summary of the subclusters and satisfies the linear additivity theorem, the distance within the cluster can be represented by the CF feature triples. In a clusterxi,i=1,2,3,…,n containing n d-dimensional data points, the cluster centroid x0, cluster radius R, and cluster diameter D were calculated as follows:(6)x0=∑i=1wxiw=LSW,R=∑i=1wxi−x02w=WSS−LS2W2,D=∑i=1w∑j=1wxi−xj2ww−1=2WSS−2LS2WW−1.R and D belong to the nature of a single cluster. If X=x1,x2,x3,…,xnY=y1,y2,y3,…,yn and Y=y1,y2,y3,…,yn refer to two sets of data, then the Euclidean distance and Manhattan distance between the two sets of data are given as follows:(7)dis=x1−y12+x2−y22+⋯+xn−yn2,dis=x1−y1+x2−y2+⋯+xn−yn.Two clusters N1 and N2 are set to bexi⟶,i=1,2,…,N1 and xj⟶,j=N1+1,N2+1,…,N1+N2. Then, the equations of the average intercluster distance D2 and the average intracluster distance D3 can be expressed as(8)D2=∑i=1W1∑j=W1+1W1+W2xi⟶−xj⟶2W1W21/2,(9)D3=∑i=1W1+W2∑j=1W1+W2xi⟶−xj⟶2W1+W2W1+W2−11/2.The CF tree refers to a balance in the clustering algorithm that can make the target cluster quickly. The CF tree contains three nodes: root node, internal node, and leaf node. Each node contains several CFs.B, L, and T are three important parameters in the CF tree. B refers to the maximum number of CFs of each internal node, L is the maximum number of CFs of each leaf node, and the threshold T represents the maximum sample radius of the CFs of leaf nodes. The CF of the internal node is connected to other nodes of the same type. All leaf nodes contain a pointer to the next node and a pointer to the previous node so that all leaf nodes are linked by a doubly linked list. These pointers can help us quickly access the data of the BIRCH algorithm.Generally, precision and recall are adopted for the application effect of the clustering algorithm. The possible results in the application process are shown in Table1.Table 1
Estimated list of classification.
Same clusteringDifferent clusteringThe same classificationTP means the number of data in the same classification divided into the same cluster (a)FN refers to number of data in the same classification divided into different clusters (c)The different classificationFP refers to the number of data in different classifications divided into the same cluster (d)TN refers to the number of data in different classifications divided into different clusters (d)According to the definition in Table1, the accuracy rate is the percentage of data in the same cluster that really belongs to the same category. It can be expressed as follows:(10)precision=aa+d.The recall rate refers to the number of the data of the same cluster that is successfully predicted as the same category. It can be expressed as the equation given as follows:(11)recall=aa+c.The rand index (RI), adjustment of rand index (ARI), and Fowlkes–Mallows Index (FMI) are all external evaluation methods. The clustering results are based on a prespecified structure. All clustering algorithms can be used in general, however, they cannot reflect the internal situation of the data set.If there is a data setX=x1,x2,x3,…,xn composed of n data and the possible clustering situations are the four in Table 1, then RI can be expressed as(12)RI=a+ba+b+c+d=a+bCn2.In the above equation,Cn2 is the total number of all clusters in the data set, and the range of RI is [0, 1]. The closer RI is to 1, the better the clustering effect. Then, ARI can be calculated according to RI, which is specifically expressed as(13)ARI=RI−ERImaxRI−ERI.In equation (13), E [RI] refers to the expected value of the RI. The value range of ARI is [−1, 1]. Then, the larger the value, the better the clustering result.FMI is the geometric average of precision and recall, and the interval is [0, 1]. The larger the clustering effect, the better. The specific expression is as follows:(14)FMI=aa+d∗aa+c=aa+da+c.


## 2.2. Research Objects

In this study, 159 patients with chronic pain who were treated in the hospital from January 2018 to January 2021 were selected as research objects. Among them, 88 were male patients, and 71 were female patients, and they were aged between 30 and 70 years, with an average age of 50.06 ± 5.2 years. The patients were evaluated according to the Hamilton depression scale (HAMD) [14], Hamilton anxiety scale (HAMA) [15], and Pittsburgh sleep quality index (PSQI) [16] to check if there were any abnormalities in mood and sleep, based on which the patients were grouped. The patients without poor emotion and sleep quality were set as the control group, and a total of 69 people were counted. The patients with abnormal emotions (such as depression and anxiety) and abnormal sleep quality (such as insomnia and dreaminess) were set as the observation group, with a total of 90 cases. The brain function was detected by RS-fMRI technology based on the BIRCH algorithm. This study had been approved by the Medical Ethics Committee.The inclusion criteria were defined as follows: (a) patients with chronic pain caused by various physical diseases and patients with a visual analogue scale (VAS) score above 3 points, (b) patients who received HAMD, HAMA, and PSQI scale for emotional and sleep quality assessment, (c) patients who were able to communicate normally and volunteer to participate in a complete study, and (d) patients who had signed the subject’s informed consent forms.The exclusion criteria were determined as follows: (a) subjects who had been medically diagnosed with depression and needed to take medication, (b) subjects who had long-term medication habits and who had not taken analgesics or related medications in the past month, (c) patients with obvious signs of nerve damage, malignant tumors, and rheumatoid, (d) patients with contraindications to the RS-fMRI examination, such as implanted metal (artificial joints and dentures), heart rate regulators, or other medication syringes, (e) pregnant or breastfeeding women, and (f) those who were not in good spirits on the day of the test.


## 2.3. RS-fMRI Method

Both groups of patients were examined using the 3.0 T Magnetic Resonance Imaging (MRI) system and were scanned by the same experienced and highly qualified MRI scanner.Before the start of the scan, the subject was asked to stay at rest, i.e., lying still, closed eyes, and awake, and the subject was asked not to do any thinking. A soft sponge pad is used to fix the subject's head. The acquisition of BOLD is performed with the sequence of T2∗. GRE. EP from top to bottom with oblique axis scan, and the scan range is approximately from the top of the skull to the foramen magnum. The specific scanning parameters are defined as follows: time of repetition (TR) = 2000 ms, time of echo (TE) = 40 ms, field of view (FOV) = 24 cm × 24 cm, flip angle = 90°, matrix = 64 × 64, layer thickness = 5 mm, and layer spacing = 1 mm. The 33-layer image was collected with 240 time points, and the scanning time was 8 minutes. The specific operation is carried out in accordance with the equipment manual and normal operating procedures.On the Matlab platform, the data processing assistant for resting-state fMRI software is used to preprocess the image data. The specific processing methods are as given in the following five steps: firstly, the first ten time points were removed to eliminate the influence of the uneven main magnetic field at the beginning of the scan and to eliminate the subject's inadaptability to the environment. Secondly, the time difference among different layers was smoothed, i.e., correcting the scanning time difference of each layer image. Thirdly, the head movement was corrected, which was to reduce the noise generated during the signal acquisition process caused by the movement of the patient's head. The fourth step is that the spatial difference was corrected. The fifth step is that the data were performed with Gaussian smoothing. After that, the BIRCH algorithm was used to optimize the image obtained above, and the processing process included four stages. Stage 1: it can read the data and build the initial CF tree. Stage 2: the CF tree was adjusted according to the given threshold and branching factor to build a smaller CF tree. Stage 3: all the leaf nodes were clustered again. Then, the sparse clusters were deleted, and the dense clusters were clustered. Stage 4: the cluster center that has been generated was adopted as a seed, and all the sample points were clustered according to the distance.


## 2.4. Statistical Analysis

The SPSS22.0 statistical software system was adopted for data entry, sorting, and statistical analysis. The enumeration data were compared using theχ2 test, the measurement data were compared with a t-test, and multiple sample means were adopted for the comparative analysis of variance. The LSD method was used when the variance was uniform, and the Dunnett T3 method was selected when the variance was uneven. P<0.05 meant statistical difference.


## 3. Results

### 3.1. Comparison of the BIRCH Clustering Algorithm with Other Algorithms

Figure3 shows the comparison of RI, ARI, and FMI of the classic k-means algorithm [17], FCM clustering algorithm [18], and BIRCH algorithm clustering under the same conditions. Figure 3(a) showed the comparison of RI results, Figure 3(b) showed the comparison of ARI results, and Figure 3(c) was the comparison of FMI results. The figure illustrated that the RI, ARI, and FMI results of BIRCH were the largest among the three algorithms, which were 0.82, 0.71, and 0.88, respectively. It is known that the larger the three evaluation results, the better the clustering effect. Therefore, the effect of BIRCH clustering is better than that of the k-means algorithm and the FCM clustering algorithm. Figure 4 is the processing effect diagram under the three clustering algorithms. It could be observed that the image processed by BIRCH was better with higher image resolution and clearer display of the brain tissue.Figure 3
Comparison on RI, ARI, and FMI of different groups. (a–c) The comparison results of AI, ARI, and FMI, respectively.
(a)(b)(c)Figure 4
The effect of different clustering algorithms after processing. (a) The original image. (b–d) The images processed by K-means, FCM, and BIRCH, respectively. The blue monitoring points referred to the abnormal areas of the brain.
(a)(b)(c)(d)


### 3.2. Comparison of Basic Data of Patients

The general clinical data of the two groups of patients were compared as follows: in terms of gender distribution, there were 36 male patients (52.17%) and 33 female patients (47.83%) in the control group. There were 52 males (57.78%) and 38 females (42.22%) in the observation group, showing little differenceP>0.05, as shown in Figures 5(a) and 5(b). In terms of age, the average age of the patients in the control group was 51.19 ± 6.01 years, and the average age of the observation group was 49.76 ± 4.98 years, showing no obvious difference P>0.05, as shown in Figure 5(c). In terms of the course of the disease, the average course of disease in the control group was 2.33 ± 0.51 years and that in the observation group was 2.67 ± 0.71 years, showing no great difference after comparison P>0.05 (Figure 5(d)). The comparison of the general data of the above two groups of patients suggested that the data were comparable.Figure 5
Comparison of the basic data of patients. (a–d) The comparison of the number of males, number of females, average age, and average course of disease, respectively.
(a)(b)(c)(d)


### 3.3. Emotion and Sleep Quality Scores of the Two Groups of Patients

Figure6 shows the scoring results of the HAHD, HAMA, and PSQI scales of the two groups of patients. The scoring results of the control group were 4.03 ± 1.95, 5.13 ± 2.35, and 4.43 ± 2.07, respectively, while those in the observation group were 7.26 ± 3.95, 7.94 ± 3.15, and 8.03 ± 4.67, respectively. After the comparative analysis, the scores of patients in the observation group were higher in contrast to those in the control group, suggesting that the degree of anxiety and depression in the observation group was much higher and the quality of sleep was also worse than that of the control group P<0.05.Figure 6
The scoring results of HAHD, HAMA, and PSQI scales. Note: “∗” indicates that the comparison was statistically significant (P<0.05).


### 3.4. RS-fMRI Image Comparison between Two Groups of Patients

Figures7–9 were the RS-fMRI image performance of patients with severe emotional abnormalities in the control group and the observation group. According to the following RS-fMRI examination results, there was a small amount of hyperintensity in the brain of the patients in the control group, and the distribution was scattered. Patients with severe emotional abnormalities can show large areas of abnormal high-signal connections in the inferior knee gyrus, anterior wedge, and thalamus. In addition, patients with severe sleep were basically similar to the former, with abnormalities in the posterior occipital lobe, anterior wedge, and the thalamus of the brain with high signal connection response.Figure 7
RS-fMRI images of patients in control group. (a–c) The images in sagittal plane, transverse section, and coronal plane, respectively. The orange dots marked the high signal performances.
(a)(b)(c)Figure 8
RS-fMRI images of a patient with abnormal mood. (a–c) The images in sagittal plane, transverse section, and coronal plane, respectively. The red fluorescence marked the abnormal high signal performances.
(a)(b)(c)Figure 9
RS-fMRI images of a patient with abnormal sleep quality. (a–c) The images in sagittal plane, transverse section, and coronal plane, respectively. The orange fluorescence marked the abnormal high signal performances.
(a)(b)(c)


### 3.5. Relationship between the Scoring Results and Abnormal Brain Signals

Table2 shows the scoring results of HAHD, HAMA, and PSQI scales and the statistics of patients with abnormal brain signals detected by RS-fMRI. According to the statistical results in the table, the higher the score, the higher the proportion of brain signal abnormal connections. When the average score was 10–15 points, the proportion of patients with brain abnormalities reached 100%, and only 5% of the people’s score was between 1 and 3 points.Table 2
Average score results and abnormal brain signal.
Control group (n = 69 cases)Observation group (n = 90 cases)Average score1–3 points (n = 39 cases)3–6 points (n = 30 cases)7–10 points (n = 67 cases)10–15 points (n = 23 cases)Number of patients with abnormal brain2116223Proportion5%36.67%92.54%100%


## 3.1. Comparison of the BIRCH Clustering Algorithm with Other Algorithms

Figure3 shows the comparison of RI, ARI, and FMI of the classic k-means algorithm [17], FCM clustering algorithm [18], and BIRCH algorithm clustering under the same conditions. Figure 3(a) showed the comparison of RI results, Figure 3(b) showed the comparison of ARI results, and Figure 3(c) was the comparison of FMI results. The figure illustrated that the RI, ARI, and FMI results of BIRCH were the largest among the three algorithms, which were 0.82, 0.71, and 0.88, respectively. It is known that the larger the three evaluation results, the better the clustering effect. Therefore, the effect of BIRCH clustering is better than that of the k-means algorithm and the FCM clustering algorithm. Figure 4 is the processing effect diagram under the three clustering algorithms. It could be observed that the image processed by BIRCH was better with higher image resolution and clearer display of the brain tissue.Figure 3
Comparison on RI, ARI, and FMI of different groups. (a–c) The comparison results of AI, ARI, and FMI, respectively.
(a)(b)(c)Figure 4
The effect of different clustering algorithms after processing. (a) The original image. (b–d) The images processed by K-means, FCM, and BIRCH, respectively. The blue monitoring points referred to the abnormal areas of the brain.
(a)(b)(c)(d)


## 3.2. Comparison of Basic Data of Patients

The general clinical data of the two groups of patients were compared as follows: in terms of gender distribution, there were 36 male patients (52.17%) and 33 female patients (47.83%) in the control group. There were 52 males (57.78%) and 38 females (42.22%) in the observation group, showing little differenceP>0.05, as shown in Figures 5(a) and 5(b). In terms of age, the average age of the patients in the control group was 51.19 ± 6.01 years, and the average age of the observation group was 49.76 ± 4.98 years, showing no obvious difference P>0.05, as shown in Figure 5(c). In terms of the course of the disease, the average course of disease in the control group was 2.33 ± 0.51 years and that in the observation group was 2.67 ± 0.71 years, showing no great difference after comparison P>0.05 (Figure 5(d)). The comparison of the general data of the above two groups of patients suggested that the data were comparable.Figure 5
Comparison of the basic data of patients. (a–d) The comparison of the number of males, number of females, average age, and average course of disease, respectively.
(a)(b)(c)(d)


## 3.3. Emotion and Sleep Quality Scores of the Two Groups of Patients

Figure6 shows the scoring results of the HAHD, HAMA, and PSQI scales of the two groups of patients. The scoring results of the control group were 4.03 ± 1.95, 5.13 ± 2.35, and 4.43 ± 2.07, respectively, while those in the observation group were 7.26 ± 3.95, 7.94 ± 3.15, and 8.03 ± 4.67, respectively. After the comparative analysis, the scores of patients in the observation group were higher in contrast to those in the control group, suggesting that the degree of anxiety and depression in the observation group was much higher and the quality of sleep was also worse than that of the control group P<0.05.Figure 6
The scoring results of HAHD, HAMA, and PSQI scales. Note: “∗” indicates that the comparison was statistically significant (P<0.05).


## 3.4. RS-fMRI Image Comparison between Two Groups of Patients

Figures7–9 were the RS-fMRI image performance of patients with severe emotional abnormalities in the control group and the observation group. According to the following RS-fMRI examination results, there was a small amount of hyperintensity in the brain of the patients in the control group, and the distribution was scattered. Patients with severe emotional abnormalities can show large areas of abnormal high-signal connections in the inferior knee gyrus, anterior wedge, and thalamus. In addition, patients with severe sleep were basically similar to the former, with abnormalities in the posterior occipital lobe, anterior wedge, and the thalamus of the brain with high signal connection response.Figure 7
RS-fMRI images of patients in control group. (a–c) The images in sagittal plane, transverse section, and coronal plane, respectively. The orange dots marked the high signal performances.
(a)(b)(c)Figure 8
RS-fMRI images of a patient with abnormal mood. (a–c) The images in sagittal plane, transverse section, and coronal plane, respectively. The red fluorescence marked the abnormal high signal performances.
(a)(b)(c)Figure 9
RS-fMRI images of a patient with abnormal sleep quality. (a–c) The images in sagittal plane, transverse section, and coronal plane, respectively. The orange fluorescence marked the abnormal high signal performances.
(a)(b)(c)


## 3.5. Relationship between the Scoring Results and Abnormal Brain Signals

Table2 shows the scoring results of HAHD, HAMA, and PSQI scales and the statistics of patients with abnormal brain signals detected by RS-fMRI. According to the statistical results in the table, the higher the score, the higher the proportion of brain signal abnormal connections. When the average score was 10–15 points, the proportion of patients with brain abnormalities reached 100%, and only 5% of the people’s score was between 1 and 3 points.Table 2
Average score results and abnormal brain signal.
Control group (n = 69 cases)Observation group (n = 90 cases)Average score1–3 points (n = 39 cases)3–6 points (n = 30 cases)7–10 points (n = 67 cases)10–15 points (n = 23 cases)Number of patients with abnormal brain2116223Proportion5%36.67%92.54%100%


## 4. Discussion

With the development of modern medical technology, the advancement of pain medicine has enabled people to further understand the nature of pain, which is not only a manifestation of the disease but also a serious chronic disease. Many studies have shown that chronic pain can cause physical and psychological damage to people, reduce appetite, and affect sleep, leading to changes in physiological, psychological, and social functions, such as depression and anxiety [19, 20]. To further prevent the occurrence of the above conditions in patients, the relationship between the results of RS-fMRI and chronic pain with poor emotion or sleep quality was explored in this study. It provided more diagnosis and treatment means for the prevention, diagnosis, and treatment of chronic pain with poor emotion or sleep quality in clinical practice.In this study, the BIRCH clustering algorithm was adopted to process the RS-fMRI images, and the processing results were compared with other clustering methods. The results revealed that the RI, ARI, and FMI results of BIRCH were the largest among the three algorithms, which were 0.82, 0.71, and 0.88, respectively. Such results suggest that the BIRCH clustering algorithm shows a good effect on RS-fMRI images. Nwadiugwu et al. (2020) [21] have also used the BIRCH clustering algorithm in the research of bioinformatics and compared it with the Denclue and Fuzzy-C algorithms. The results showed that the BIRCH clustering algorithm was more effective than the Denclue and Fuzzy-C algorithms. Another expert combines automatic spectral clustering and dimensionality reduction to optimize the framework for the fine-grained functional segmentation of the human brain RS-fMRI. It was found that unique functional connection patterns of these subregions derived from the RS-fMRI data further confirmed the validity of the segmentation results [22]. The above shows that the clustering algorithm has a certain value in RS-fMRI optimization, which reflects the application value of deep learning algorithms in the medical field [23, 24]. After that, the RS-fMRI image optimized by the BIRCH clustering algorithm was adopted for the examination of chronic pain patients, and the display results of the RS-fMRI image between the patients with mood and sleep disorders and relatively normal patients were compared. It was found that the abnormal signal connection in the brain of the observation group was far more obvious than that of the control group. The distribution was compared based on the average scores of the two groups of patients, and it was found that the higher the score, the higher the proportion of abnormal people, and the proportion of patients with brain abnormalities reached 100% at 10–15 minutes. Some research experts have used RS-fMRI to examine the changes in spontaneous nerve activity in multiple brain regions of perinatal depression, and the changes in spontaneous neural activity in these areas are related to emotional responses. Perinatal depression cases with low-frequency fluctuations in the left dorsolateral prefrontal cortex have severe depression [25]. There is also a study on the changes in the connection of the resting state of the right frontoparietal network in patients with primary insomnia. It was found that the connectivity of the right frontal-parietal network (FPN) area in patients with primary insomnia decreased, and it was related to the duration of the disease. There was a significant positive correlation with self-assessment anxiety [26]. There are also a large number of studies suggesting that chronic pain can also cause abnormal brain function in patients [27–30]. In this study, there were also some patients with abnormal brain function in the control group, however, the signs were not very obvious.


## 5. Conclusion

In summary, the BIRCH clustering algorithm showed a reliable value in the optimization of RS-fMRI images. RS-fMRI also showed high application value in evaluating the poor emotion and sleep quality of patients with chronic pain. However, the research sample was less, and the observation indicators were not comprehensive enough. It was hoped that artificial intelligence algorithms could make better breakthroughs in clinical examination methods in the future and provide patients with a more accurate diagnosis and treatment.



---

*Source: 5002754-2022-01-04.xml*