A method for constructing a data model for intestinal constipation
By constructing a data model for intestinal constipation, using characteristic values such as the motility index and loop area index, and combining it with a classifier algorithm, we have solved the problem of the existing detection technology being cumbersome and having large errors, achieved accurate judgment of intestinal constipation conditions, and reduced the number of tests and pain for patients.
Patent Information
- Application Number
- CN202210961295.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-08-11
AI Technical Summary
Existing intestinal constipation detection technology has problems such as single data type, cumbersome detection and large errors, which cause physical and mental pain to patients.
A data model for intestinal constipation was constructed by collecting anorectal multi-point pressure-time database, extracting characteristic values such as motility index and loop area index, and combining different classifier algorithms to form a classification model for accurately judging intestinal constipation.
It reduces the number of repeated tests for patients, reduces their physical and mental pain, and improves the accuracy and efficiency of testing.
Smart Images

Figure CN115295149B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of anorectal medicine, and in particular to a method for constructing a data model for intestinal constipation. Background Art
[0002] Functional defecation disorder (FDD) is a common chronic anorectal disease whose cause is often difficult to pinpoint. It primarily manifests as functional abnormalities in the anus and rectum during defecation, slowing the passage and excretion of stool in the intestine. Abnormalities in gastrointestinal motility, colonic fullness, rectal contractions, pelvic floor muscle coordination, and intestinal volume can all directly contribute to FDD. Its etiology is often complex and difficult to pinpoint, requiring comprehensive analysis through a variety of examinations.
[0003] Currently, there are four representative detection technologies for functional defecation disorders:
[0004] ⑴High-resolution anorectal manometry (HRAM)
[0005] The HRAM system includes a pressure measuring catheter, an irrigation system, a pressure sensor, a rectal dilation balloon, and a computer processing system, which can provide three-dimensional pressure dynamic images of the anorectum.
[0006] However, HRAM cannot diagnose defecation disorders alone and needs to be used in combination with other examination methods.
[0007] ⑵ Defecation radiography
[0008] The patient sits on a toilet in a relatively private environment, and a certain amount of barium sulfate suspension is poured into the rectum. A gastrointestinal X-ray machine is used to collect the lateral rectal phases of the patient at rest, with the anus lifted, and when defecating, to dynamically observe the functional and anatomical changes of the anorectum.
[0009] Although defecography can evaluate the activity of the rectum and pelvic floor during defecation, the barium paste is quite different from real feces, the measurement data is not very accurate, and it cannot provide anorectal pressure information.
[0010] ⑶ Colonic transit test
[0011] The colon transit test refers to judging the colon transit situation by taking oral markers and regularly observing and calculating the movement and distribution of markers in the colon.
[0012] However, this judgment is only preliminary and is subject to greater risk of accidental factors, and it cannot replace defecatory radiography.
[0013] (4) Balloon expulsion test (BET)
[0014] During the test, a balloon-equipped catheter is placed in the rectum and pressure (50ml) is applied with either gas or liquid. The patient sits and exerts themselves to deflate the balloon, with the time and effort required recorded. This test is primarily used to assess rectal sensation and anal sphincter function.
[0015] Although simple and easy to use, the types of measurement data provided are limited.
[0016] In summary, the current mainstream detection technologies all have more or less defects, and they are independent of each other. The type of data collected is relatively single, and most of them are immersive examinations. If clinical practice wants to obtain more comprehensive physiological parameters to judge intestinal constipation, it is necessary to conduct tedious multiple examinations, and the data obtained has large errors, which not only consumes more medical resources, but also brings great physical and mental pain to patients. Summary of the Invention
[0017] The purpose of the present invention is to address the corresponding deficiencies in the existing technology and provide a data model construction method for intestinal constipation. Two eigenvalues, namely the motility index and the loop area index, are proposed. In combination with other conventional eigenvalues, different classifier algorithms are combined to form different classification models. The classification model with the best performance is selected to judge the intestinal constipation condition of the subject. Moreover, only a single collection of the patient's intestinal pressure data is required to use the classification model to accurately judge the patient's intestinal constipation condition, thereby greatly alleviating the patient's physical and mental pain.
[0018] The purpose of the present invention is to achieve the following: a method for constructing a data model for intestinal constipation, comprising the following steps:
[0019] 1) Establish an anorectal multi-point pressure-time database;
[0020] Because the human body undergoes inherent physiological activities such as breathing and coughing during clinical trials, and there is also a certain amount of electromagnetic interference between testing equipment, the collected raw sample data contains useful information but also includes a large amount of noise. Therefore, to ensure the accuracy of subsequent data analysis, the sample data in the anorectal multi-point pressure-time database should first be filtered and de-noised before feature extraction, such as using a wavelet transform.
[0021] 2) obtaining an original feature set formed by multiple intestinal feature subsets through feature extraction, wherein the original feature set includes at least a motility index-intestinal feature subset and a loop area index-intestinal feature subset;
[0022] The simulated defecation process is essentially the process of transporting a stool simulator within the intestine. During this process, the rear end of the stool simulator is subjected to a driving force generated by intestinal contractions. This driving force causes the stool simulator to move within the intestine, encountering forward resistance. The driving force experienced by the stool simulator is detected by a pressure sensor located at the rear end of the stool simulator, while the forward resistance experienced by the stool simulator is detected by a pressure sensor located at the front end of the stool simulator. The entire simulated defecation process involves multiple intestinal contractions, each of which is accompanied by corresponding changes in pressure at the front and rear ends of the stool simulator. This is reflected in the pressure-time curve as a series of peaks, with the resting state between peaks. Therefore, the relationship between the pressure changes at the front and rear ends during intestinal contractions can be used to reflect the stress state of the stool simulator during intestinal transport. In particular, the period from the resting state to the peak pressure at the rear end of the stool simulator during each intestinal contraction represents a force exerted by the subject. The relationship between the pressure changes at the front and rear ends during multiple force exertions during the entire simulated defecation process can effectively reflect the physiological characteristics of patients with different conditions during the defecation phase. This characteristic value is defined as the motility index in the present invention.
[0023] Similarly, the loop area index can also be used as an effective feature to reflect the intestinal contraction characteristics.
[0024] 3) Perform data standardization on each intestinal feature subset in the original feature set;
[0025] 4) The different intestinal feature subsets in the original feature set are combined in pairs, and the correlation coefficient between the two intestinal feature subsets in each combination is calculated. The sample selection threshold is set according to these correlation coefficients, and the combination with a correlation coefficient greater than the sample selection threshold is taken as the sample. That is, when the correlation coefficient between the two intestinal feature subsets is ≤ the sample selection threshold, the two intestinal feature subsets are uncorrelated; when the correlation coefficient between the two intestinal feature subsets is greater than the sample selection threshold, the two intestinal feature subsets are positively correlated, and the data in all positively correlated intestinal feature subsets are taken as samples.
[0026] 5) using a portion of the samples as training samples and forming several classification models using different classifier composite algorithms, wherein the classifier composite algorithm is composed of two classifier algorithms;
[0027] 6) Another part of the sample is used as a test sample, and the prediction results of each classification model are obtained through the test sample;
[0028] 7) Calculate the evaluation index of each classification model based on the prediction results of each classification model;
[0029] 8) Based on the evaluation indicators of each classification model, the classification model with the best performance is selected as the model for judging intestinal constipation.
[0030] Preferably, the anorectal multi-point pressure-time database includes a number of sample data, and the sample data includes front-end pressure-time curve data and rear-end pressure-time curve data of the feces simulator collected by the anorectal pressure collector during the simulated defecation process of the subject.
[0031] Preferably, the motility index-intestinal feature subset in 2-1) is a set of motility indices corresponding to each sample data in the anorectal multi-point pressure-time database, and the motility index is obtained according to the following steps:
[0032] 2-1-1) Extracting a plurality of front-end pressure data and a plurality of rear-end pressure data corresponding to the time period of the i-th rear-end pressure peak from the front-end and rear-end pressure-time curves, respectively;
[0033] 2-1-2) Using the front-end pressure data as the dependent variable and the rear-end pressure data as the independent variable, construct a scatter plot of the i-th rear-end pressure peak;
[0034] 2-1-3) Use the least squares method to fit the data points in the scatter plot to obtain the optimal regression equation for the i-th rear end pressure peak;
[0035] 2-1-4) Substituting the plurality of rear-end pressure data obtained in step 2-1-1) into the optimal regression equation of the i-th rear-end pressure peak, to obtain a plurality of front-end pressure fitting data;
[0036] 2-1-5) Subtracting the front-end pressure data obtained in step 2-1-1) from the corresponding front-end pressure fitting data one by one, and counting the number of non-positive differences;
[0037] 2-1-6) Let the activity index L corresponding to the i-th rear end pressure peak be i is the ratio of the number of non-positive differences to the number of front-end pressure data obtained in step 2-1-1);
[0038] 2-1-7) Calculate the activity index of the sample data according to the following formula:
[0039]
[0040] Where n is the total number of pressure peaks at the back end of the back end pressure-time curve in the sample data, L is the activity index of the sample data, and L i is the activity index corresponding to the i-th rear end pressure peak, 0<i≤n.
[0041] Preferably, the loop area index-intestinal feature subset in 2-2) is a set of loop area indicators corresponding to each sample data in the anorectal multi-point pressure-time database, and the loop area index is obtained according to the following steps:
[0042] 2-2-1) Extracting all peak data of each sample data to obtain a front-end and rear-end pressure loop curve corresponding to the sample data, wherein the front-end and rear-end pressure loop curve includes a plurality of front-end and rear-end pressure loop curves corresponding to each peak data;
[0043] The front-end and rear-end pressure loop curve corresponding to each peak data can show the changing trajectory of the front and rear end pressure of the feces simulator from small to large and then from large to small, which can comprehensively reflect the number of intestinal contractions, changes in contraction force, duration, etc.
[0044] 2-2-2) Calculate the total area of the graph formed by all front-end and rear-end pressure loop curves corresponding to each sample data as the loop area index of the sample data, and as an effective characteristic value reflecting the intestinal contraction characteristics;
[0045] 2-2-3) Repeat steps 2-2-1) to 2-2-2) to calculate the loop area index of each sample data in the anorectal multi-point pressure-time database to form a loop area index-intestinal feature subset.
[0046] Preferably, the original feature set in 2-3) further includes a statistical feature-intestinal feature subset, which is a set of statistical feature values corresponding to each sample data in the anorectal multi-point pressure-time database.
[0047] The statistical feature-intestinal feature subset is generally extracted according to the following steps:
[0048] 2-3-1) Calculating the statistics corresponding to each sample data in the anorectal multi-point pressure-time database, the statistics including the back-end pressure mean, back-end pressure mode, median, variance, standard deviation, maximum, coefficient of dispersion, skewness coefficient, and kurtosis coefficient;
[0049] 2-3-2) Use the cyclic feature elimination method to score and estimate each statistic to obtain the weight corresponding to each statistic;
[0050] 2-3-3) Calculate the product of each statistic and the corresponding weight respectively, and add up the products to obtain the statistical characteristic value corresponding to the sample data.
[0051] The statistical feature values extracted from the sample data in the anorectal multi-point pressure-time database are also used as an effective feature to reflect the physiological characteristics of the intestine and to expand the original feature set.
[0052] Preferably, the original feature set in 2-4) further includes a Hurst index-intestinal feature subset, which is a set of Hurst indexes corresponding to each sample data in the anorectal multi-point pressure-time database.
[0053] The Hurst index corresponding to each sample data in the anorectal multi-point pressure-time database is generally calculated using the R / S analysis method (i.e., the rescaled range analysis method). The Hurst index is also used as an effective feature to reflect the physiological characteristics of the intestine and to expand the original feature set.
[0054] Preferably, 2-5) the original feature set also includes a multi-scale entropy-intestinal feature subset, and the multi-scale entropy-intestinal feature subset is a set of multi-scale entropies corresponding to each sample data in the anorectal multi-point pressure-time database.
[0055] The human body is a complex organism, and different diseases bring about different energy changes. Incorporating the measurement of changes in intestinal activity complexity into the feature set is believed to make the resulting feature set more comprehensive and effective. Entropy is a concept commonly used to measure the degree of disorder. From the perspective of information theory, this paper proposes to use information entropy to quantitatively evaluate the physiological characteristics of nonlinear and non-stationary intestinal defecation processes.
[0056] Multiscale entropy (MSE) is a research method that can measure the complexity of the anorectal system by analyzing the collected pressure-time data. It directly extracts sample data, considers the relationship between entropy and scale based on the sample entropy, and applies the scale to the entropy analysis. Compared with traditional measurement methods, it can more completely reflect the complexity of the intestinal physiological characteristics during defecation.
[0057] Preferably, the Z-score standardization method is used to perform data standardization processing on each intestinal feature subset in the original feature set.
[0058] Preferably, the stool simulator collects front and rear end pressure data via pressure sensors arranged at the front and rear ends of the stool simulator.
[0059] The advantages of the present invention are the following three points:
[0060] ① Using a stool simulator to collect sample data from several people to form an anorectal multi-point pressure-time database, and extracting the motility index and loop area index of each sample data in the database as effective feature values to reflect the condition of intestinal constipation;
[0061] ② From the perspective of the complex functioning of the human body, we extracted features about the complexity of intestinal activity from each sample data in the database based on entropy, expanded the original feature set, and effectively improved the accuracy of the classification model formed by subsequent combination;
[0062] ③ Select appropriate model evaluation indicators and feature selection algorithms, determine the combination mode of classification models, and finally determine the LR, The combination of the two classifier algorithms is LR- Classification model, through LR- This data model, the classification model, can accurately determine the constipation condition of the subjects' intestines, reduce the number of repeated tests, and greatly reduce the physical and mental pain of the patients. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is a flow chart of the present invention;
[0064] Figure 2 This is the sample data of healthy people in the present invention;
[0065] Figure 3 This is the sample data of patients with functional fecal incontinence in the present invention;
[0066] Figure 4 This is the sample data of patients with functional defecation disorder in the present invention;
[0067] Figure 5 This is a front-end-back end pressure loop curve diagram of a healthy person in the present invention;
[0068] Figure 6 This is a front-end-end pressure loop curve diagram of a patient with functional fecal incontinence in the present invention;
[0069] Figure 7 This is a front-end and rear-end pressure loop curve diagram of patients with functional defecation disorder in the present invention. DETAILED DESCRIPTION
[0070] like Figure 1 As shown, a method for constructing a data model for intestinal constipation includes the following steps:
[0071] 1) Establishing an anorectal multi-point pressure-time database, comprising a plurality of sample data, including front-end pressure-time curve data and rear-end pressure-time curve data of a stool simulator collected by an anorectal pressure collector during a single simulated defecation of a subject. The stool simulator collects front-end and rear-end pressure data via pressure sensors disposed at the front and rear ends of the stool simulator. The stool simulator can simulate the consistency and shape of stool, stimulate the body's natural defecation response, and more realistically simulate the process of stool being discharged from the rectum and anus, thereby collecting more accurate pressure data.
[0072] In this embodiment, the "Device for Detecting the Function of the Terminal Colon and Anorectum" with publication number CN204181576U is used as a feces simulator for collecting data. The anorectal pressure collector is a device that can read the anorectal pressure collection signal output by the feces simulator by being electrically connected to the feces simulator.
[0073] The wavelet toolbox is used in MATLAB to denoise the collected sample data, and the wavelet basis function DB3 is selected for filtering. The decomposition level is set to 3 times. The various sample data obtained are as follows Figures 2 to 4 shown.
[0074] The reasons for using wavelet transform to process sample data are as follows:
[0075] ① The collected multi-point pressure-time data is a nonlinear and non-stationary time series, and wavelet transform is an ideal nonlinear time-frequency analysis tool;
[0076] ② Wavelet transform can be used to analyze multi-point pressure-time data into high-frequency components and low-frequency components to avoid the loss of effective information components;
[0077] ③ Since wavelet transform can analyze multi-point pressure-time data into different frequency components, and the wavelet coefficient of the noise signal is lower than that of the available signal, the purpose of noise removal can be easily achieved by selecting an appropriate threshold.
[0078] 2) obtaining an original feature set formed by multiple intestinal feature subsets through feature extraction, wherein the original feature set includes at least a motility index-intestinal feature subset and a loop area index-intestinal feature subset;
[0079] 2-1) The motility index-intestinal feature subset is a set of motility indices corresponding to each sample data in the anorectal multi-point pressure-time database, and the motility index is obtained according to the following steps:
[0080] 2-1-1) Extracting a plurality of front-end pressure data and a plurality of rear-end pressure data corresponding to the time period of the i-th rear-end pressure peak from the front-end and rear-end pressure-time curves, respectively;
[0081] 2-1-2) Using the front-end pressure data as the dependent variable and the rear-end pressure data as the independent variable, construct a scatter plot of the i-th rear-end pressure peak;
[0082] 2-1-3) Use the least squares method to fit the data points in the scatter plot to obtain the optimal regression equation for the i-th rear end pressure peak;
[0083] 2-1-4) Substituting the plurality of rear-end pressure data obtained in step 2-1-1) into the optimal regression equation of the i-th rear-end pressure peak, to obtain a plurality of front-end pressure fitting data;
[0084] 2-1-5) Subtracting the front-end pressure data obtained in step 2-1-1) from the corresponding front-end pressure fitting data one by one, and counting the number of non-positive differences;
[0085] 2-1-6) Let the activity index L corresponding to the i-th rear end pressure peak be iis the ratio of the number of non-positive differences to the number of front-end pressure data obtained in step 2-1-1);
[0086] 2-1-7) Calculate the activity index of the sample data according to the following formula:
[0087]
[0088] Where n is the total number of pressure peaks at the back end of the back end pressure-time curve in the sample data, L is the activity index of the sample data, and L i is the activity index corresponding to the i-th rear end pressure peak, 0<i≤n.
[0089] 2-2) The loop area index-intestinal feature subset is a set of loop area indicators corresponding to each sample data in the anorectal multi-point pressure-time database, and the loop area index is obtained according to the following steps:
[0090] 2-2-1) extracting all peak data of the i-th sample data to obtain a front-end and rear-end pressure loop curve corresponding to the sample data, wherein the front-end and rear-end pressure loop curve includes a plurality of front-end and rear-end pressure loop curves corresponding to each peak data;
[0091] like Figures 5 to 7 As shown, there are front-end and rear-end pressure loop curves of three different types of subjects. The number of front-end and rear-end pressure loop curves in the figure is the number of intestinal contractions of the sample data. It can be seen intuitively that the number of intestinal contractions of patients with functional defecation disorder (constipation) is more frequent and concentrated.
[0092] 2-2-2) Calculate the total area of the graph formed by all front-end and rear-end pressure loop curves corresponding to the i-th sample data as the loop area index of the sample data;
[0093] In this embodiment, a closed operation program based on binary image morphology in MATLAB is first used to process each front-end and rear-end pressure loop curve to generate a closed loop. Then, the trap function in MATLAB is called to calculate the area of each loop. Finally, the areas of all loops are added together to obtain the loop area index of the sample data.
[0094] 2-2-3) Repeat steps 2-2-1) to 2-2-2) to calculate the loop area index of each sample data in the anorectal multi-point pressure-time database to form a loop area index-intestinal feature subset.
[0095] 2-3) The original feature set also includes a statistical feature-intestinal feature subset, which is a set of statistical feature values corresponding to each sample data in the anorectal multi-point pressure-time database.
[0096] In this embodiment, it is assumed that the anorectal multi-point pressure-time database contains n sample data, such as {x1, x2, ..., x n}, x1 is the first sample data, x2 is the second sample data, x n is the nth sample data;
[0097] ① Calculate the sample mean according to the following formula:
[0098]
[0099] Where, is the sample mean, x i is the i-th sample data in the anorectal multi-point pressure-time database, and n is the total number of sample data in the anorectal multi-point pressure-time database;
[0100] ② The pressure data that appears most frequently in the anorectal multi-point pressure-time database is taken as the mode;
[0101] ③ After sorting the pressure data in the anorectal multi-point pressure-time database in order of size, the pressure data in the middle position is selected as the median;
[0102] ④ Calculate the variance according to the following formula:
[0103]
[0104] Where Var is the variance, n is the total number of sample data in the anorectal multi-point pressure-time database, is the sample mean, x i is the i-th sample data in the anorectal multi-point pressure-time database;
[0105] ⑤Calculate the standard deviation according to the following formula:
[0106]
[0107] Where σ is the standard deviation, n is the total number of sample data in the anorectal multi-point pressure-time database, is the sample mean, x i is the i-th sample data in the anorectal multi-point pressure-time database;
[0108] ⑥Get the maximum value:
[0109] After sorting the pressure data in the anorectal multi-point pressure-time database in ascending order, the first pressure data is selected as the minimum value and the last pressure data is selected as the maximum value;
[0110] ⑦ Calculate the coefficient of dispersion, which is the ratio of the standard deviation to the sample mean. It can eliminate the influence of data level and measurement unit and is used to measure the relative degree of dispersion of data.
[0111] ⑧Calculate the skewness coefficient according to the following formula:
[0112]
[0113] Where S is the skewness coefficient, is the sample mean, x i is the i-th sample data in the anorectal multi-point pressure-time database, and n is the total number of sample data in the anorectal multi-point pressure-time database;
[0114] ⑨Calculate the kurtosis coefficient:
[0115]
[0116] Where K is the peak value, is the sample mean, x i is the i-th sample data in the anorectal multi-point pressure-time database, and n is the total number of sample data in the anorectal multi-point pressure-time database;
[0117] 2-3-1) Calculate the statistics corresponding to each sample data in the anorectal multi-point pressure-time database according to the above steps, wherein the statistics include the back-end pressure mean, back-end pressure mode, median, variance, standard deviation, maximum, coefficient of dispersion, skewness coefficient, and kurtosis coefficient;
[0118] 2-3-2) Use the cyclic feature elimination method to score and estimate each statistic to obtain the weight corresponding to each statistic;
[0119] 2-3-3) Calculate the product of each statistic and the corresponding weight respectively, and add up the products to obtain the statistical characteristic value corresponding to the sample data.
[0120] 2-4) The original feature set also includes a Hurst index-intestinal feature subset, which is a set of Hurst indexes corresponding to each sample data in the anorectal multi-point pressure-time database.
[0121] In this embodiment, the Hurst exponent corresponding to each sample in the anorectal multi-point pressure-time database is calculated using the R / S analysis method (i.e., the rescaled range analysis method) according to the following steps:
[0122] 2-4-1) The sample data set {x t} is divided into A subintervals of length n;
[0123] 2-4-2) Calculate the cumulative deviation of the tth element in the ath interval according to the following formula:
[0124]
[0125] Where, X t,a is the cumulative deviation of the tth element in the ath interval, M a is the average value of x in the ath interval, a=1,2,…,A, A is the sample data set {x t}, n is the total number of sample data in the anorectal multi-point pressure-time database;
[0126] 2-4-3) Calculate the range according to the following formula:
[0127] R a =max(X t,a )-min(X t,a )
[0128] Where R a The range is used to indicate the difference between the maximum value and the minimum value, max(X t,a ) is the maximum value of the cumulative deviation of the tth element in the ath interval, min(X t,a ) is the minimum value of the cumulative deviation of the tth element in the ath interval;
[0129] 2-4-4) Calculate the sample data set {x t The mean of the rescaled ranges of all subintervals of}:
[0130]
[0131] Where S a is the sample standard deviation of the ath interval, R a is the extreme difference, (R / S) n is the sample data set {x t}, A is the sample data set {x t}, n is the total number of sample data in the anorectal multi-point pressure-time database;
[0132] 2-4-5) Since different interval lengths correspond to different R / S, and each sub-interval length is variable, K is a constant obtained by summarizing the sample data in the anorectal multi-point pressure-time database, because (R / S) n =Kn H , calculate the Hurst exponent by taking the logarithm of both sides of the following equation:
[0133] log((R / S) n )=log(K)+Hlog(n)
[0134] Where H is the Hurst exponent, K is the intercept of the regression equation;
[0135] 2-4-6) Perform regression analysis on log(n) and log(R / S) to calculate the Hurst exponent.
[0136] 2-5) The original feature set also includes a multi-scale entropy-intestinal feature subset, which is a set of multi-scale entropies corresponding to each sample data in the anorectal multi-point pressure-time database.
[0137] The multi-scale entropy is calculated as follows:
[0138] 2-5-1) Coarse-grained data: The non-overlapping coarse-grained process adopted by the present invention is as follows:
[0139]
[0140] Where y j (τ) is the sample data set in the coarse-grained anorectal multi-point pressure-time database, τ is the acquisition frequency of pressure-time data, x i is the i-th sample data, N is the acquisition time of the i-th sample data, y j is the jth value in the sample data set of the coarse-grained anorectal multi-point pressure-time database;
[0141] 2-5-2) Calculate the sample entropy of each sample data and draw a sample entropy-scale curve corresponding to each sample data;
[0142] 2-5-3) Calculate the definite integral of the sample entropy-scale curve and the sampling time corresponding to the sample data to obtain the multi-scale entropy corresponding to each sample data.
[0143] The sample entropy of each sample data can be calculated as follows:
[0144] ① Assume that the sample data set in the anorectal multi-point pressure-time database is {Y(n)}=Y (1) ,Y (2) ,...,Y (n) ;
[0145] ②According to the sequence number, a vector sequence Y with dimension m is formed (1) ,Y (2) ,...,Y (N-m+1) , where Y (i) ={u i ,ui+1 ,..., u i+m}; Define the vector Y (i) , Y (j) The distance between is the largest difference among the corresponding elements: d[Y (i) , Y].
[0146] ③ The similarity tolerance is r, and count the number N (i) , Y (j) < r, and calculate the ratio of N m (i) to the total number of vectors, denoted as m (i) and the total number of vectors, denoted as
[0147]
[0148] ④ Calculate the average value B m (r):
[0149]
[0150] ⑤ When the dimension is m + 1, repeat the above process to obtain B m+1 (r), then the sample entropy SampEn(N, m, r) of this sample data is:
[0151]
[0152] Generally speaking, the value of the sample entropy SampEn(N, m, r) is an estimated value. That is, when N takes a finite value, the estimated value of the sample entropy SampEn(N, m, r) is:
[0153]
[0154] 3) Perform data standardization processing on each intestinal feature subset in the original feature set;
[0155] In this embodiment, the Z-score standardization method is used to perform data standardization processing on each intestinal feature subset in the original feature set.
[0156] 4) Combine different intestinal feature subsets in the original feature set pairwise, calculate the correlation coefficient between the two intestinal feature subsets in each combination, and set a sample selection threshold according to these correlation coefficients. Take the combination with a correlation coefficient greater than the sample selection threshold as the sample. That is, when the correlation coefficient between two intestinal feature subsets ≤ the sample selection threshold, these two intestinal feature subsets are not relevant; when the correlation coefficient between two intestinal feature subsets > the sample selection threshold, these two intestinal feature subsets are positively correlated, and the data in all positively correlated intestinal feature subsets is used as the sample.
[0157] In this embodiment, the correlation coefficient between two different intestinal feature subsets is calculated according to the following formula:
[0158] And 0≤ρ (A,B) ≤1
[0159] Where, ρ (A,B) is the correlation coefficient between intestinal feature subsets A and B, x i is the eigenvalue of the i-th feature in the intestinal feature subset A, y i is the eigenvalue of the i-th in the intestinal feature subset B, is the mean of the feature values in the intestinal feature subset A, is the mean of the feature values in each intestinal feature subset B;
[0160] According to the set sample selection threshold, the data of multiple intestinal feature subsets with the highest correlation are selected as samples. For example, according to experience, the sample selection threshold is set to 0.005. If ρ (A,B) ≤0.005 indicates that the intestinal feature subset A is not correlated with the intestinal feature subset B. If ρ (A,B) >0.005, indicating that intestinal feature subset A is positively correlated with intestinal feature subset B, and the data in all positively correlated intestinal feature subsets are used as samples.
[0161] 5) using a portion of the samples as training samples and forming several classification models using different classifier composite algorithms, wherein the classifier composite algorithm is composed of two classifier algorithms;
[0162] In this embodiment, the following three different classifier algorithms are selected:
[0163] ①Naive Bayes classifier ( Bayes classifier):
[0164] The Naive Bayes classifier offers two major advantages: First, it is highly efficient when training and querying large amounts of data. Even with very large training sets, each item typically has a relatively small number of features, and training and classification involve only mathematical operations on feature probabilities, especially as the training volume increases. Second, interpreting the classifier's actual learning is relatively simple. Because the probability values for each feature are stored, the database can be reviewed at any time to find the most appropriate features for classification.
[0165] ② Logistic Regression Classifier (LR):
[0166] First, the logistic regression classifier can directly model the probability of classification without assuming a data distribution, thus avoiding the problems caused by inaccurate distribution assumptions. Second, it not only predicts the category but also the probability of that prediction, which is very useful for tasks that use probability to assist decision-making. Finally, the logarithmic probability function is a convex function that is differentiable of any order, and many numerical optimization algorithms can find the optimal solution.
[0167] ③ Random Forest (RF):
[0168] Random forests can first extract high-dimensional data and determine the importance of features and the interactions between them. Secondly, they are less prone to overfitting, train quickly, are easily parallelized, and are relatively simple to implement. Finally, they can balance errors in unbalanced datasets, maintaining accuracy even when a large portion of features are missing.
[0169] The above three different classifier algorithms are combined into the following three different classification models:
[0170] ⑴ Combine the logistic regression classifier and the naive Bayes classifier into LR- Classification models;
[0171] ⑵Overlap the two logistic regression classifiers to form an LR-LR classification model;
[0172] ⑶ Combine the logistic regression classifier and random forest into an LR-RF classification model;
[0173] 6) Another part of the sample is used as a test sample, and the prediction results of each classification model are obtained through the test sample;
[0174] It should be noted that when dividing the samples, the training samples and the test samples do not overlap with each other, and the test samples are only used to evaluate the performance of the classification model and do not participate in the construction process of the classification model.
[0175] 7) Based on the prediction results of each classification model, the confusion matrix is used to calculate the evaluation index of each classification model:
[0176] The confusion matrix, or error matrix, is simply a table that displays the number of observations that a classification model incorrectly and correctly classifies. It forms the basis for plotting the ROC curve and is the most basic, intuitive, and computationally simple method for measuring the accuracy of a classification model. Table 1 shows the confusion matrix for a three-class classification model and serves as an example to illustrate the evaluation metrics.
[0177] Table 1 Confusion matrix of three-category diagnosis of functional defecation disorder
[0178]
[0179] In the table, CC, FI, and HS represent patients with functional defecation disorder, patients with functional fecal incontinence, and healthy subjects, respectively.
[0180] 7-1) Based on the knowledge of statistics, the four parameters P, TN, FP, and FN of the confusion matrix primary evaluation index are obtained;
[0181] The rows of the confusion matrix represent instances in the predicted class, and the columns indicate whether the model's prediction is correct, comparing the prediction result to the label. Correct is True, and false is False. TP (TruePositive) refers to the number of instances in the class that were positive but were actually positive, TN (TrueNegative) refers to the number of instances in the class that were positive but were actually negative, FP (FalsePositive) refers to the number of instances in the class that were negative but were actually positive, and FN (FalseNegative) refers to the number of instances in the class that were negative but were actually negative. TP, TN, FP, and FN are the primary evaluation metrics of the chaos matrix. Based on statistical theory, their calculation formulas are shown in Table 2.
[0182] Table 2
[0183] CC HS FI <![CDATA[TP CC =T CC ]]> <![CDATA[TP HS =T HS ]]> <![CDATA[TP FI =T FI ]]> <![CDATA[TN CC =T HS +N HF +N FH +T FI ]]> <![CDATA[TN HS =T CC +N CF +N FC +T FI ]]> <![CDATA[TN FI =N CF +N HF +N HC +T HS ]]> <![CDATA[FP CC =N HC +N FC ]]> <![CDATA[FP HS =N CH +N FH ]]> <![CDATA[FP FI =T CC +N CH ]]> <![CDATA[FN CC =N CH +N CF ]]> <![CDATA[FN HS =N HC +N HF ]]> <![CDATA[FN FI =N FC +N FH ]]>
[0184] The confusion matrix table only counts numbers, which makes it difficult to measure the quality of the model. Therefore, based on the basic statistical results and four primary evaluation indicators, three intermediate indicators, Accuracy, Precision, and Recall, are derived.
[0185] 7-2) Based on the confusion matrix primary evaluation indicators, the three intermediate indicators of Accuracy, Precision and Recall are calculated according to the following formula:
[0186]
[0187]
[0188]
[0189] 5-3) The above three intermediate evaluation indicators can be used to convert the information content in the confusion matrix into a ratio between 0 and 1, forming a comprehensive evaluation indicator F1score:
[0190]
[0191] Where F1score is the comprehensive evaluation index of the confusion matrix, Precision is the accuracy, and Recall is the recall rate. The final evaluation indicators of the model are F1score and Accuracy.
[0192] F1score combines the results of Precision and Recall, and its value range is also between 0 and 1. F1score = 1 represents the best output of the model, and F1score = 0 represents the worst output of the model.
[0193] Table 3 Comparison of evaluation indicators of the three classification models in this embodiment
[0194]
[0195] 8) Based on the evaluation indicators of each classification model, the classification model with the best performance is selected as the model for judging intestinal constipation.
[0196] As shown in Table 3, LR- The accuracy of the Bayes classification model is 0.8333, and the F1score is 0.8286, which is significantly higher than other classification models. In this embodiment, LR- The Bayes classification model is used as a model for judging intestinal constipation.
[0197] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications made to the present invention by those skilled in the art without departing from the spirit of the present invention shall fall within the scope of protection of the present invention.
Claims
1. A method for constructing a data model for intestinal constipation, characterized in that: The following steps are involved: 1) establishing an anorectal multi-point pressure-time database, wherein the anorectal multi-point pressure-time database includes a plurality of sample data, wherein the sample data includes front-end pressure-time curve data and back-end pressure-time curve data of a stool simulator collected by an anorectal pressure collector during a simulated defecation process of a subject; 2) obtaining an original feature set formed by multiple intestinal feature subsets through feature extraction, wherein the original feature set includes at least a motility index-intestinal feature subset and a loop area index-intestinal feature subset. The motility index-intestinal feature subset is a set of motility indices corresponding to each sample data in the anorectal multi-point pressure-time database. The motility index is obtained according to the following steps: 2-1-1) Extracting a plurality of front-end pressure data and a plurality of rear-end pressure data corresponding to the time period of the i-th rear-end pressure peak from the front-end and rear-end pressure-time curves, respectively; 2-1-2) Using the front-end pressure data as the dependent variable and the rear-end pressure data as the independent variable, construct a scatter plot of the i-th rear-end pressure peak; 2-1-3) Use the least squares method to fit the data points in the scatter plot to obtain the optimal regression equation for the i-th rear end pressure peak; 2-1-4) Substituting the plurality of rear-end pressure data obtained in step 2-1-1) into the optimal regression equation of the i-th rear-end pressure peak, to obtain a plurality of front-end pressure fitting data; 2-1-5) Subtracting the front-end pressure data obtained in step 2-1-1) from the corresponding front-end pressure fitting data one by one, and counting the number of non-positive differences; 2-1-6) Let the activity index L corresponding to the i-th rear end pressure peak be i is the ratio of the number of non-positive differences to the number of front-end pressure data obtained in step 2-1-1); 2-1-7) Calculate the activity index of the sample data according to the following formula: Where n is the total number of pressure peaks at the back end of the back end pressure-time curve in the sample data, L is the activity index of the sample data, and L i is the activity index corresponding to the i-th rear end pressure peak, 0<i≤n; 3) Perform data standardization on each intestinal feature subset in the original feature set; 4) Combine different intestinal feature subsets in the original feature set in pairs, calculate the correlation coefficient between the two intestinal feature subsets in each combination, and set the sample selection threshold based on these correlation coefficients. Take the combination with a correlation coefficient greater than the sample selection threshold as the sample; 5) using a portion of the samples as training samples and forming several classification models using different classifier composite algorithms, wherein the classifier composite algorithm is composed of two classifier algorithms; 6) Another part of the sample is used as a test sample, and the prediction results of each classification model are obtained through the test sample; 7) Calculate the evaluation index of each classification model based on the prediction results of each classification model; 8) Based on the evaluation indicators of each classification model, the classification model with the best performance is selected as the model for judging intestinal constipation.
2. The method for constructing a data model for intestinal constipation according to claim 1, characterized in that: 2-2) The loop area index-intestinal feature subset is a set of loop area indicators corresponding to each sample data in the anorectal multi-point pressure-time database, and the loop area index is obtained according to the following steps: 2-2-1) Extracting all peak data of each sample data to obtain a front-end and rear-end pressure loop curve corresponding to the sample data, wherein the front-end and rear-end pressure loop curve includes a plurality of front-end and rear-end pressure loop curves corresponding to each peak data; 2-2-2) Calculate the total area of the graph formed by all front-end and rear-end pressure loop curves corresponding to each sample data as the loop area index of the sample data; 2-2-3) Repeat steps 2-2-1) to 2-2-2) to calculate the loop area index of each sample data in the anorectal multi-point pressure-time database to form a loop area index-intestinal feature subset.
3. The method for constructing a data model for intestinal constipation according to claim 1, characterized in that: 2-3) The original feature set also includes a statistical feature-intestinal feature subset, which is a set of statistical feature values corresponding to each sample data in the anorectal multi-point pressure-time database.
4. The method for constructing a data model for intestinal constipation according to claim 1, characterized in that: 2-4) The original feature set also includes a Hurst index-intestinal feature subset, which is a set of Hurst indexes corresponding to each sample data in the anorectal multi-point pressure-time database.
5. The method for constructing a data model for intestinal constipation according to claim 1, characterized in that: 2-5) The original feature set also includes a multi-scale entropy-intestinal feature subset, which is a set of multi-scale entropies corresponding to each sample data in the anorectal multi-point pressure-time database.
6. The method for constructing a data model for intestinal constipation according to claim 1, characterized in that: The Z-score standardization method was used to perform data standardization on each intestinal feature subset in the original feature set.
7. The method for constructing a data model for intestinal constipation according to claim 1, characterized in that: The stool simulator collects front and rear end pressure data via pressure sensors arranged at the front and rear ends of the stool simulator.
Citation Information
Patent Citations
Device for detecting functions of tail end colon and anorectum
CN204181576U
Comprehensive diagnosis method and system for craniocerebral diseases
CN113130070A
Disease risk assessment model construction method based on intestinal microorganisms and application
CN114530249A