Kidney stone detection system based on SCC-YOLOX model
By introducing SE, CA and CBAM attention modules into the kidney stone detection system, the YOLOX network structure is optimized, and the problem of insufficient detection efficiency and accuracy is solved, efficient and accurate automatic detection of kidney stones is achieved, and the misdiagnosis rate is reduced.
Patent Information
- Application Number
- CN202510451498.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-11
AI Technical Summary
The existing kidney stone detection system has problems such as low detection efficiency, high misdiagnosis and misdiagnosis rate, insufficient feature extraction ability, unsatisfactory small object detection effect, high computational complexity and lack of misdiagnosis and error correction mechanism, which affects the accuracy of kidney stone detection.
Based on the YOLOX network structure, combined with the SE, CA and CBAM attention modules, the feature extraction and detection process is optimized, feature learning ability and multi-scale feature fusion ability are enhanced, and error correction logic judgment module is introduced to identify and correct error detection errors.
It improves the speed and accuracy of kidney stone detection, reduces the calculation complexity and misdiagnosis rate, enhances the detection effect of small targets, and improves the robustness and accuracy of the detection.
Smart Images

Figure CN120374544A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of kidney stone detection. More specifically, it relates to a kidney stone detection system based on the SCC-YOLOX model. Background Art
[0002] Kidney stones are common diseases in the urinary system. Their early detection is of great significance for subsequent treatment. Existing kidney stone detections usually rely on manual film reading, which has problems such as low detection efficiency and high misdiagnosis and missed diagnosis rates. In recent years, object detection technologies based on deep learning have been gradually applied to the field of medical imaging. Among them, traditional deep learning object detection algorithms, such as YOLOX, YOLOv5, YOLOv8, etc., have received extensive attention due to their advantages of fast detection speed and high accuracy. However, existing detection systems still have problems such as insufficient feature extraction ability, unsatisfactory small object detection effects, high computational complexity, imbalance between positive and negative samples, and lack of misdiagnosis correction mechanisms, which limit their popularization and application in clinical practice.
[0003] Traditional kidney stone detection systems usually adopt a simple decoupled head architecture, which is difficult to effectively implement multiple operations such as target separation, classification, and localization, resulting in low efficiency in converting feature maps into detection results. In addition, the information channel weights of traditional systems are relatively fuzzy, and the detection network needs to pay attention to both key information channels and irrelevant channels at the same time, which increases the amount of calculation and reduces the information processing efficiency.
[0004] In addition, traditional kidney stone detection systems usually rely on CT scanning to generate single-channel grayscale images, and the colors are relatively single, which makes it easy to have large recognition errors in object detection. Traditional systems also lack channel attention and spatial attention mechanisms, resulting in low attention to key regions, further affecting the detection effect.
[0005] The above problems directly affect the detection accuracy of kidney stones and may even lead to misdetection or missed detection. Summary of the Invention
[0006] The present invention aims to provide a kidney stone detection system based on the SCC-YOLOX model. Using the YOLOX network structure as the basic framework, by optimizing the feature extraction and detection processes, it realizes efficient and accurate automatic detection of kidney stones. This system effectively improves the detection speed and accuracy, reduces information loss, and at the same time reduces the number of model parameters and enhances the operation efficiency by introducing an attention mechanism. This model further enhances the feature learning ability and multi-scale feature fusion ability, expands the receptive field of the network, and especially has a significant detection effect on small targets (such as tiny kidney stones). This system can effectively express feature information, improve the robustness and accuracy of detection. Finally, by identifying and analyzing specific scenarios of detection errors, the model can be continuously optimized, thereby further reducing the misdiagnosis rate in kidney stone detection, reducing time and computational costs, and solving the problems of insufficient detection efficiency and accuracy in the prior art.
[0007] The technical solution of the present invention to solve the above technical problems is as follows: A kidney stone detection system based on the SCC-YOLOX model. This system mainly consists of a backbone network (Backbone), a neck network Neck, a detection head Head, an SE attention module, a CA attention module, a CBAM attention module, and an error correction logic judgment module (Error correction logic judgment). The detection steps are as follows:
[0008] The first step: Data input
[0009] (1) Data input: Input a kidney stone CT image (640*640*3);
[0010] (2) Preprocessing: Image normalization, resizing, data augmentation (such as mosaic, random flipping);
[0011] (3) Input to the model: Input to YoloBody for object detection;
[0012] The second step: Feature extraction of the backbone network (Backbone):
[0013] (1) Perform preliminary feature extraction through the basic convolutional layer (BaseConv), and combine the SE attention module to enhance the expression ability of channel information;
[0014] (2) Use CSPDarknet as the backbone network to extract features of different scales. During the forward process of YOLOPAFPN, CoordAtt attention modules are added to the P5 and P4 level features to enhance the position perception ability;
[0015] (3) The Backbone structure is divided as follows:
[0016] ①dark3 → Low-level features (larger size, rich details);
[0017] ②dark4 → Intermediate-level features (medium size, balanced information);
[0018] ③dark5 → High-level features (small size, rich semantic information);
[0019] Step 3: Feature fusion of the Neck network:
[0020] YOLOX uses the FPN (Feature Pyramid Network) + PAN (Path Aggregation Network) structure to enhance feature fusion, and adds the CBAM attention module to enhance the feature extraction effect;
[0021] (1) Top-down (FPN);
[0022] ①dark5 → P5 (Reduce the number of channels);
[0023] ②Upsample P5 and fuse it with dark4 → P4;
[0024] ③Upsample P4 and fuse it with dark3 → P3;
[0025] (2) Bottom-up (PAN);
[0026] ①Downsample P3 and fuse it with P4 → P4_out;
[0027] ②Downsample P4_out and fuse it with P5 → P5_out;
[0028] ③The CBAM attention module further optimizes the feature representation;
[0029] (3) Final output:
[0030] ①P3_out (80×80, for detecting small objects);
[0031] ②P4_out (40×40, for detecting medium objects);
[0032] ③P5_out (20×20, for detecting large objects);
[0033] Step 4: Classification and regression of the YOLOXHead;
[0034] (1) For each feature layer (P3, P4, P5), three types of predictions are made;
[0035] ①Classification branch (cls_preds): Predict which class each pixel belongs to;
[0036] ②Regression branch (reg_preds): Predicts the bounding box of the target (4 values: x, y, w, h);
[0037] ③Object confidence branch (obj_preds): Predicts whether there is an object at this point (1 value);
[0038] (2) Finally, merge the prediction results of P3_out, P4_out, and P5_out and perform post-processing;
[0039] Among them, 1. When lesion information is scanned, it will also be input into the backbone network;
[0040] 1.1. The Focus module can reduce the number of parameters without losing information, improve the operation efficiency, and on the basis of Focus, YOLOX uses Anchor-free to replace the traditional Anchor-base, discards the anchor box, and only uses the position where the center point of the target is located as the positive sample, alleviating the problem of imbalance between positive and negative samples and reducing the time cost;
[0041] 1.2. CSPNet uses the residual structure in ResNet
[43] to split the stacked residual blocks, enhancing the network's feature learning ability while reducing the computational complexity;
[0042] 1.3. The SPP (Spatial Pyramid Pooling) module increases the receptive field of the network by performing multi-scale max pooling operations on the feature map;
[0043] 2. Then input it into the Neck network to transfer the rich spatial information in the shallow layer to the high-level feature map to enhance and fuse features;
[0044] 3. Then input it into the detection head Head for multi-scale fusion of features;
[0045] The output scanned information is input into the error correction logic judgment module for error analysis, so that when it is judged that the collected data does not match the original data in the database, that is, when the data is incorrect, the incorrect data can be corrected and modified to achieve the effect of automatic data error correction;
[0046] Fifth step: Error Correction Logic Judgment:
[0047] Fifth step: Error Correction Logic Judgment:
[0048] (S1) Data storage: Build a standard lesion data database and store it in a tree structure for efficient query and comparison;
[0049] (S2) Data acquisition: Obtain the current detection result through the data acquisition module;
[0050] (S3) Data analysis: Standardize the detection result to be consistent with the standard data format in the database;
[0051] (S4) Data comparison and judgment: Compare the current detection data with the standard data to judge the accuracy of the detection result;
[0052] (S5) Error correction execution: If there are abnormalities or errors in the detection result, automatically trigger the error correction module to correct the error result;
[0053] (S6) Abnormality handling: If no matching data is found in the database, it is judged that the current data is abnormal, execute step (S5) for error correction, and record this abnormal situation to optimize the subsequent detection ability of the system.
[0054] Preferably, the CSPDarknet optimizes the computational complexity through the CSPNet structure, adopts the gradient flow splitting mechanism to reduce the computational cost while maintaining high accuracy, and can be used in combination with deep learning networks such as ResNet, ResNeXt, and DenseNet. Through the gradient flow splitting mechanism, the CSPNet divides the input features into two parts. One part extracts features through residual blocks, and the other part is directly transmitted through cross-layer connections. Finally, the features of the two paths are combined in the fusion stage to reduce the computational amount while maintaining the accuracy.
[0055] Preferably, the SPP (Spatial Pyramid Pooling) method is adopted to enhance the adaptability of the network to input images of different scales, improve the feature extraction ability and detection accuracy. By adding a spatial pyramid pooling layer between the convolutional layer (including convolution operations such as Convolution and pooling operations such as Pooling) and the fully connected layer (Fully Connected Layer, FC), the fully connected layer can receive a fixed-length feature vector, thereby eliminating the limitation of the fully connected layer on the input size.
[0056] Preferably, the spatial pyramid pooling layer adopts a hierarchical pooling method to ensure that the length of the feature vector is fixed, specifically including the following steps:
[0057] ① Multi-scale division: Divide the feature map into multiple grids according to different scales, such as 4×4, 2×2, and 1×1;
[0058] ② Pooling calculation: Perform max pooling within each grid to extract key information;
[0059] ③ Feature concatenation: Assume the number of channels of the feature map is 256. After pooling, features with dimensions of 16×256, 4×256, and 1×256 are formed.
[0060] ④ Vector construction: Concatenate the pooling results of different scales into a feature vector of a fixed length and input it into the fully connected layer to ensure that the network can stably process input images of different sizes.
[0061] Preferably, the SE (Squeeze-and-Excitation) module includes two stages: the squeezing stage and the excitation stage. In the squeezing stage, first, the feature map of each channel is compressed into a vector with a shape of 1×1×C through global average pooling (GAP), where C is the number of channels of the feature map. Then, the compressed vector is passed as input to the excitation stage for further processing.
[0062] Preferably, in the excitation stage, two fully connected layers (Fully Connected Layer, FC1 and FC2) are used. To reduce the computational complexity, an intermediate dimension r is usually used in the fully connected layer, and this dimension is usually a smaller proportion of the number of input channels. First, the global feature vector z is mapped to a smaller dimension r through the first fully connected layer (FC1), and then the ReLU activation function is used for non-linear activation. Next, the second fully connected layer (FC2) further maps the activated features back to the number of channels C to generate the final channel weights and perform weighted multiplication with the original feature map.
[0063] Preferably, the CBAM attention module is used in the Neck network, and the CBAM module is added after each CSPLayer to optimize the fusion of channel and spatial information.
[0064] Preferably, the calculation process of CBAM includes:
[0065] (1) Channel attention calculation: Use global average pooling and max pooling to obtain channel information respectively, and calculate the attention weights through the fully connected layer.
[0066] (2) Spatial attention calculation: Use max pooling and average pooling in the channel dimension to obtain spatial information, and calculate the weights through convolution.
[0067] (3) Weighted feature map: Multiply the channel attention and spatial attention results with the original feature map respectively to optimize the final feature expression.
[0068] Preferably, the error correction logic judgment module (Error Correction Logic Judgment) consists of a data storage module, a data acquisition module, a data analysis module, a data comparison and judgment module, and an error correction execution module. Its working process is as follows:
[0069] (S1) Data storage: Upload standard lesion data to the data storage module. The data is processed by the modeling module and constructed into a tree-structured database for efficient querying and matching;
[0070] (S2) Data acquisition: The data acquisition module obtains the current detection data and uploads it to the data analysis module for processing;
[0071] (S3) Data analysis: The data analysis module standardizes the acquired data to make its format consistent with the database storage format, and uploads the processed data to the data comparison and judgment module;
[0072] (S4) Data comparison: The data comparison and judgment module compares the analyzed data with the standard data in the database to determine its matching degree;
[0073] (S5) Error correction execution: If the comparison result shows that the data is incorrect, the error correction execution module corrects the incorrect data to improve the detection accuracy;
[0074] (S6) Exception handling: If no matching data is found in the database, it is determined that the current data is abnormal. Execute step (S5) for error correction and record the abnormal situation to optimize the subsequent detection ability of the system.
[0075] Preferably, the specific working process of the data comparison and judgment module in step (S4) is as follows:
[0076] ① Data marking: Uniquely identify and mark and classify the analyzed data;
[0077] ② Data partition comparison: Partition the marked data according to specific rules and gradually compare it with the standard data in the database;
[0078] ③ Result judgment: If a matching item is found for the marked data in the database, it is determined that the data is correct and the detection process ends. If there is no match, execute the error correction process to improve the detection accuracy.
[0079] By adopting the above technical solutions, the kidney stone detection system based on the SCC-YOLOX model provided by the present invention has the following beneficial effects:
[0080] 1. Based on the YOLOX model network structure, the present invention integrates the attention mechanism and the error correction logic module. At the same time, the SE attention is embedded into the BaseConv, and by optimizing the backbone network structure, without losing feature information, the number of model parameters is reduced, the computational complexity is lowered, the operation efficiency is improved, and the detection error problem caused by the imbalance between positive and negative samples in medical image data is alleviated, the detection time cost is reduced, the detection speed and detection accuracy are effectively improved, and the detection effect of kidney stones is enhanced.
[0081] 2. By embedding the Coordinate Attention (CA) module into the lateral connection part of the feature pyramid, the present invention effectively enhances the spatial position perception ability of feature information, further improves the feature expression and aggregation ability, thereby improving the detection accuracy and accuracy rate.
[0082] 3. The CBAM module in the Neck network of the present invention combines the channel attention and the spatial attention mechanism, obtains the channel information through global average pooling and max pooling, and generates the spatial attention weight through the pooled feature map, enabling the model to focus on the key information areas in both the channel dimension and the spatial dimension, and enhancing the feature extraction and representation ability of the model.
[0083] 4. The present invention also sets up an error correction logic judgment module to realize the comparison and automatic error correction between the detection result and the standard lesion data, can identify the misclassification or abnormal situation that occurs during the detection process, and effectively reduces the misdiagnosis risk of kidney stone detection through automatic correction and data recording, improving the overall detection performance and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Through the detailed description in combination with the following drawings, the advantages of other aspects of the present invention will become clearer and easier to understand. These drawings are only schematic and do not limit the present invention, wherein:
[0085] Figure 1 It is a schematic diagram of the SCC-YOLOX network structure according to an embodiment of the present invention;
[0086] Figure 2 It is a schematic diagram of the SE module structure according to an embodiment of the present invention;
[0087] Figure 3 It is a schematic diagram of the CA module structure according to an embodiment of the present invention;
[0088] Figure 4 It is a schematic diagram of the CBAM module structure according to an embodiment of the present invention;
[0089] Figure 5Schematic diagram of feature vector conversion of the SPP (Spatial Pyramid Pooling) module according to an embodiment of the present invention;
[0090] Figure 6 Schematic diagram of the comparison of the mAP between the YOLOX model and the improved model according to an embodiment of the present invention;
[0091] Figure 7 Graphs of (a) loss function, (b) average precision curve, (c) accuracy change curve, and (d) accuracy of kidney stone images according to an embodiment of the present invention;
[0092] Figure 8 Schematic block diagram of the error correction logic judgment module according to an embodiment of the present invention. Detailed implementation manners
[0093] In the following, an embodiment of a kidney stone detection system based on the SCC-YOLOX model of the present invention will be described with reference to the attached Figure 1-8 description.
[0094] The embodiments described herein are specific specific implementation manners of the present invention and are used to illustrate the concept of the present invention. They are all explanatory and exemplary and are not intended to limit the present invention. Except for the embodiments described herein, those skilled in the art can also adopt other technical solutions based on the content disclosed in the claims and the specification of the present application. These technical solutions include the technical solutions obtained by making substitutions and modifications to the embodiments described herein.
[0095] The drawings in this specification are schematic diagrams to assist in explaining the concept of the present invention and show the shapes and mutual relationships of various parts. Please note that in order to clearly show the structures of the components in the embodiments of the present invention, the drawings are not drawn according to the same scale, and the same reference numerals are used to represent the same parts.
[0096] Embodiment 1
[0097] This embodiment discloses a kidney stone detection system based on the SCC-YOLOX model. This system mainly consists of a backbone network, a neck network Neck, a detection head Head, an SE attention module, a CA attention module, a CBAM attention module, and an error correction logic judgment module (Error correction logic judgment). The detection steps are as follows:
[0098] The first step: Data input
[0099] (1) Data input: Input a kidney stone CT image (640*640*3);
[0100] (2) Preprocessing: Image normalization, resizing, data augmentation (such as mosaic, random flipping);
[0101] (3) Input to the model: Input into YoloBody for object detection;
[0102] The second step: Feature extraction of the backbone network:
[0103] (1) Perform preliminary feature extraction through the basic convolutional layer (BaseConv), and combine the SE attention module to enhance the expression ability of channel information;
[0104] (2) Use CSPDarknet as the backbone network to extract features of different scales. During the forward process of YOLOPAFPN, CoordAtt attention modules are added to the P5 and P4 level features to enhance the position perception ability;
[0105] (3) The Backbone structure is divided as follows:
[0106] ① dark3 → low-level features (larger size, rich in details);
[0107] ② dark4 → intermediate-level features (medium size, balanced information);
[0108] ③ dark5 → high-level features (small size, rich in semantic information);
[0109] The third step: Feature fusion of the neck network:
[0110] YOLOX adopts the FPN (Feature Pyramid Network) + PAN (Path Aggregation Network) structure to enhance feature fusion, and adds the CBAM attention module to it to enhance the feature extraction effect;
[0111] (1) Top-down (FPN);
[0112] ① dark5 → P5 (reduce the number of channels);
[0113] ② Upsample P5 and fuse it with dark4 → P4;
[0114] ③ Upsample P4 and fuse it with dark3 → P3;
[0115] (2) Bottom-up (PAN);
[0116] ① Downsample P3 and fuse it with P4 → P4_out;
[0117] ② Downsample P4_out and fuse it with P5 → P5_out;
[0118] ③The CBAM attention module further optimizes the feature representation;
[0119] (3) Final output:
[0120] ①P3_out (80×80, for detecting small targets);
[0121] ②P4_out (40×40, for detecting medium targets);
[0122] ③P5_out (20×20, for detecting large targets);
[0123] Step 4: Classification and regression of the prediction head (YOLOXHead);
[0124] (1) For each feature layer (P3, P4, P5), three types of predictions are made;
[0125] ①Classification branch (cls_preds): Predict which class each pixel belongs to;
[0126] ②Regression branch (reg_preds): Predict the bounding box of the target (4 values: x, y, w, h);
[0127] ③Object confidence branch (obj_preds): Predict whether there is an object at this point (1 value);
[0128] (2) Finally, the prediction results of P3_out, P4_out, and P5_out are merged for post-processing;
[0129] Among them, 1. When lesion information is scanned, it will also be input into the backbone network;
[0130] 1.1. The Focus module can reduce the number of parameters without losing information, improve the operation efficiency, and on the basis of Focus, YOLOX uses Anchor-free instead of the traditional Anchor-base, discards the anchor boxes, and only takes the position where the center point of the target is located as the positive sample, alleviating the problem of imbalance between positive and negative samples and reducing the time cost;
[0131] 1.2. CSPNet uses the residual structure in ResNet
[43] to split the stacked residual blocks, enhancing the network's feature learning ability while reducing the computational complexity;
[0132] 1.3. The SPP (Spatial Pyramid Pooling) module increases the receptive field of the network by performing multi-scale max-pooling operations on the feature map;
[0133] 2. Then it is input into the neck network Neck to transfer the rich spatial information in the shallow layer to the high-level feature map to enhance and fuse the features;
[0134] 3. Then it is input into the detection head Head for multi-scale fusion of features;
[0135] The output scanned information is input into the error correction logic judgment module for error analysis. When it is determined that the collected data does not match the original data in the database, that is, when the data is incorrect, the incorrect data can be corrected and modified to achieve the effect of automatic data error correction;
[0136] Step 5: Error Correction Logic Judgment:
[0137] (S1) Data storage: Construct a standard lesion data database and store it in a tree structure for efficient query and comparison;
[0138] (S2) Data collection: Obtain the current detection result through the data collection module;
[0139] (S3) Data analysis: Standardize the detection result to be consistent with the standard data format in the database;
[0140] (S4) Data comparison and judgment: Compare the current detection data with the standard data to judge the accuracy of the detection result;
[0141] (S5) Error correction execution: If there are abnormalities or errors in the detection result, the error correction module is automatically triggered to correct the error result;
[0142] (S6) Abnormality handling: If no matching data is found in the database, it is determined that the current data is abnormal, step (S5) is executed for error correction, and the abnormal situation is recorded to optimize the subsequent detection ability of the system.
[0143] The CSPDarknet optimizes the computational complexity through the CSPNet structure, adopts the gradient flow splitting mechanism to reduce the computational cost while maintaining high accuracy, and can be used in combination with deep learning networks such as ResNet, ResNeXt, and DenseNet. Through the gradient flow splitting mechanism, the CSPNet divides the input features into two parts. One part extracts features through residual blocks, and the other part is directly transmitted through cross-layer connections. Finally, the features of the two paths are combined in the fusion stage to reduce the computational amount while maintaining the accuracy.
[0144] The SPP (Spatial Pyramid Pooling) method is adopted to enhance the network's adaptability to input images of different scales, improve the feature extraction ability and detection accuracy. By adding a spatial pyramid pooling layer between the convolutional layer (including convolution operations such as Convolution and pooling operations such as Pooling) and the fully connected layer (Fully Connected Layer, FC), the fully connected layer can receive feature vectors of a fixed length, thus eliminating the limitation of the fully connected layer on the input size.
[0145] The spatial pyramid pooling layer adopts a hierarchical pooling method to ensure that the length of the feature vector is fixed, and specifically includes the following steps:
[0146] ① Multi-scale division: The feature map is divided into multiple grids according to different scales, such as 4×4, 2×2, and 1×1;
[0147] ② Pooling calculation: Max Pooling is performed within each grid to extract key information;
[0148] ③ Feature concatenation: Assuming the number of channels of the feature map is 256, then features with dimensions of 16×256, 4×256, and 1×256 are formed after pooling;
[0149] ④ Vector construction: The pooling results of different scales are concatenated into a feature vector of a fixed length and input into the fully connected layer to ensure that the network can stably process input images of different sizes.
[0150] The SE (Squeeze-and-Excitation) module includes two stages: the squeezing stage and the excitation stage. In the squeezing stage, first, the feature map of each channel is compressed into a vector with a shape of 1×1×C through global average pooling (Global Average Pooling, GAP), where C is the number of channels of the feature map. Then, the compressed vector is passed as input to the excitation stage for further processing.
[0151] In the excitation stage, two fully connected layers (Fully Connected Layer, FC1 and FC2) are used. To reduce the computational complexity, an intermediate dimension r is usually used in the fully connected layer, and this dimension is usually a smaller proportion of the number of input channels. First, the global feature vector z is mapped to a smaller dimension r through the first fully connected layer (FC1), and then the ReLU activation function is used for non-linear activation. Next, the second fully connected layer (FC2) further maps the activated features back to the number of channels C to generate the final channel weights and perform weighted multiplication with the original feature map.
[0152] The CBAM attention module is used in the Neck network. The CBAM module is added after each CSPLayer to optimize the fusion of channel and spatial information.
[0153] The calculation process of CBAM includes:
[0154] (1) Channel attention calculation: Global average pooling and max pooling are used to obtain channel information respectively, and the attention weights are calculated through a fully connected layer.
[0155] (2) Spatial attention calculation: Max pooling and average pooling in the channel dimension are used to obtain spatial information, and the weights are calculated through convolution.
[0156] (3) Weighted feature map: The results of channel attention and spatial attention are multiplied by the original feature map respectively to optimize the final feature representation.
[0157] The error correction logic judgment module (Error Correction Logic Judgment) consists of a data storage module, a data acquisition module, a data analysis module, a data comparison and judgment module, and an error correction execution module. Its working process is as follows:
[0158] (S1) Data storage: Standard lesion data is uploaded to the data storage module. The data is processed by the modeling module and constructed into a tree - structured database for efficient query and matching.
[0159] (S2) Data acquisition: The data acquisition module obtains the current detection data and uploads it to the data analysis module for processing.
[0160] (S3) Data analysis: The data analysis module standardizes the acquired data to make its format consistent with the database storage format, and uploads the processed data to the data comparison and judgment module.
[0161] (S4) Data comparison: The data comparison and judgment module compares the analyzed data with the standard data in the database to determine its matching degree.
[0162] (S5) Error correction execution: If the comparison result shows that the data is incorrect, the error correction execution module corrects the incorrect data to improve the detection accuracy.
[0163] (S6) Exception handling: If no matching data is found in the database, it is determined that the current data is abnormal. Step (S5) is executed for error correction, and the abnormal situation is recorded to optimize the subsequent detection ability of the system.
[0164] The specific working process of the data comparison and judgment module in step (S4) is as follows:
[0165] ① Data marking: Uniquely identify and classify the marked data after analysis;
[0166] ② Data partition comparison: Partition the marked data according to specific rules and gradually compare it with the standard data in the database;
[0167] ③ Result judgment: If a matching item is found for the marked data in the database, it is judged that the data is correct and the detection process ends. If there is no match, the error correction process is executed to improve the detection accuracy.
[0168] It should be noted that:
[0169] 1. Backbone network: The present invention uses DSP Darknet53 as the backbone feature extraction network of the YOLOX algorithm. The Backbone is composed of a Residual residual network, a Focus network, a CBS network, a CSPNet, and an SPP module. Among them:
[0170] (1) The Focus module slices and downsamples the input image without losing information, reduces the number of parameters, improves the operation efficiency. At the same time, it adopts the Anchor-free mechanism to replace the traditional Anchor-base method, and only takes the position of the target center point as the positive sample, alleviating the problem of imbalance between positive and negative samples and reducing the time cost;
[0171] (2) CSPNet effectively divides the stacked residual blocks by introducing the ResNet residual structure into the network structure. CSPNet alleviates the problem of large computational requirements during previous inferences from the perspective of network design. The solution is to integrate the change of gradients into the feature map from beginning to end, which can ensure the accuracy while reducing the computational amount. CSPNet is an idea of processing and can be combined with ResNet, ResNeXt, and DenseNet;
[0172] (3) The SPP module (such as Figure 5 ) increases the network receptive field through multi-scale max pooling operations and improves the model's detection ability for targets of different scales.
[0173] 2. Neck network: The Neck structure of the present invention combines FPN and PAN. FPN transmits high-level semantic information from top to bottom to the shallow feature map, and PAN transmits position information from bottom to top to the high-level feature map to enhance the feature fusion effect. In addition, a CBAM attention module is introduced after each CSPLayer module in the Neck network to optimize the fusion of channel and spatial information and improve the feature expression ability.
[0174] 3. Detection Head: The detection head of the present invention adopts a Decoupled Head structure, which divides the feature map into three branches for object classification, bounding box regression, and object confidence prediction respectively, realizing the decoupling of classification and localization and improving the detection effect.
[0175] 4. Improved YOLOX algorithm: The present invention proposes an SCC-YOLOX improvement scheme based on the YOLOX-s model, specifically as follows:
[0176] (1) Introduce an SE attention module into the BaseConv module to enhance the model's ability to focus on key information channels through a channel weighting mechanism;
[0177] (2) Introduce a CA attention module in the horizontal connection part of the feature pyramid to improve the expressiveness and aggregation ability of feature information;
[0178] (3) Add a CBAM module after the CSPLayer module in the Neck network to further optimize channel and spatial feature information and improve detection accuracy.
[0179] 4.1 SE attention module:
[0180] The Squeeze-and-Excitation (SE) module (as shown in Figure 2 ) weights each channel through global information, enabling the network to pay more attention to key information channels, suppressing useless channel features. The SE module is added to the BaseConv convolution operation of the model. The original BaseConv is a normal convolution, and the features of all channels are treated equally. After adding the SE module, each channel will be assigned different weights according to the global context information. More important channels are enhanced, and redundant channels are suppressed, making the model pay more attention to the detection of small targets;
[0181] The SE module includes two stages: squeezing and excitation. In the squeezing stage, through global average pooling, the feature map of each channel is compressed into a vector with a shape of 1×1×C, where C is the number of channels of the feature map, and then it is passed as input to the activation function, as shown in formula (1):
[0182]
[0183] where, H and W represent the height and width of the input feature map, and z c is the feature after global average pooling of the Cth channel, and the double summation in formula (1) sums over all positions within the input channels.
[0184] In the activation stage, two fully connected layers, namely FC1 and FC2, are used. To avoid excessive computation, an intermediate dimension r (usually a small proportion of the number of input channels) is typically used in the fully connected layer. In this way, the computational complexity is reduced. The global feature z is mapped to a smaller dimension r through a fully connected layer (FC1), and then ReLU activation is performed, as shown in Equation (2):
[0185] s r = δ(W1z + b1) (2);
[0186] where W1 and b1 are the weights and biases of the fully connected layer, and δ is the ReLU activation function.
[0187] Next, another fully connected layer (FC2) is used to map the feature back to the number of channels C, and then the final channel attention weights are generated through the Sigmoid activation function, as shown in Equation (3):
[0188] s = σ(W2s r + b2) (3)
[0189] where W2 and b2 are the weights and biases of the second fully connected layer, σ is the Sigmoid activation function, and the output s ∈ R C is the attention weight for each channel.
[0190] Finally, the generated attention weight s is multiplied with the input feature map X channel by channel to obtain the weighted feature map X′, as shown in Equation (4):
[0191] X'(i,j,c) = X(i,j,c) · s c (4);
[0192] where s c is the attention weight for the Cth channel.
[0193] The global average pooling of the SE module introduces global context information to a certain extent, enabling the convolutional operation to not be limited to the local receptive field only. The convolutional operation itself is local and has limited ability to model the relationships between channels. Through the fully connected operation in the Excitation part, the SE module can learn the dependencies between channels, thereby further optimizing the feature representation.
[0194] 4.2 CA Attention Module
[0195] The CT image is a single-channel gray image with dull colors, which is likely to cause large errors in target detection and recognition. To improve the detection accuracy and precision, the Coordinate Attention (CA) module is embedded in the lateral connection part of the feature pyramid to enhance the expressive power and aggregation ability of feature information.
[0196] Coordinate Attention is a lightweight attention mechanism module (as shown in Figure 3 ), which mainly improves the feature expression ability of the model by decomposing channel attention and spatial attention, while retaining position information. Different from traditional channel attention, the CA module decomposes channel attention into two feature encoding processes, aggregating features along two spatial directions respectively. This method can capture long-range dependencies along one spatial direction while retaining the precise position information along the other spatial direction.
[0197] First, perform global average pooling on the input feature map X to obtain a 1×1×C vector, where each element represents the global average feature of the corresponding channel, as shown in formula (5):
[0198]
[0199] where, z c is the global feature of the C-th channel.
[0200] Next, process the global feature of each channel through a shared fully connected layer. Generally, first map the feature to a smaller dimension through a fully connected layer, then activate it through an activation function (usually ReLU), then map it back to the number of channels through a fully connected layer, and finally generate the channel attention weight through the Sigmoid function. The output obtained in this way is a 1×1×C vector, representing the importance of each channel, as shown in formula (6):
[0201] M = σ(W2δ(W1z)) (6);
[0202] where, W1 and W2 are the weight matrices of the fully connected layer; δ is the ReLU activation function;
[0203] σ is the Sigmoid activation function, which is used to normalize the obtained attention value.
[0204] Finally, multiply the obtained attention weight M with the original feature map X channel by channel to obtain the weighted feature map X′, as shown in formula (7):
[0205] X'(i, j, c) = X(i, j, c)·M(c) (7);
[0207] This means that the feature map of each channel is adjusted by a scalar weight M(c), where important channels are amplified and unimportant channels are suppressed.
[0208] 4.3 CBAM Attention Module
[0209] CBAM (Convolutional Block Attention Module) is a module that combines channel attention and spatial attention (as shown in Figure 4 ). Channel attention refers to extracting channel information through global average pooling and global max pooling to enhance the attention to specific channels, thereby helping the model learn more effective feature representations. Spatial attention refers to generating spatial attention weights from the pooled feature map to enhance the attention to specific regions, enabling the model to focus on important regions in the spatial dimension.
[0210] The overall role of the CBAM attention module is to enhance the model's feature expression ability by explicitly modeling the feature importance in the channel and spatial dimensions. Adding CBAM after each CSPLayer in the Neck network can further optimize the fused features and highlight key channels and spatial regions.
[0211] The calculation process of CBAM includes two stages: channel attention calculation and spatial attention calculation. The output of each stage is multiplied by the original feature map respectively to obtain the final feature map through weighting.
[0212] (1) Channel attention: Given an input feature map X ∈ R H×W×C , first perform global average pooling and global max pooling on the input feature map along the spatial dimensions (height H and width W) to obtain two 1×1×C feature maps, as shown in equations (8) and (9):
[0213]
[0214] The purpose of these two operations is to capture the global information of each channel in the input feature map.
[0215] Then, pass these two feature maps through a shared multi-layer perceptron (MLP) to generate the attention weights for each channel. Subsequently, use a fully connected layer (FC) to map the two pooled feature maps to a lower dimension r, then activate through ReLU, and then map back to the number of channels C through another fully connected layer, and obtain the channel attention weights through the Sigmoid function, as shown in equation (10):
[0216] M c = σ(W2δ(W1[z avg ; zmax )) (10);
[0217] Among them, W1 and W2 are the weight matrices of the fully connected layers, and [z avg ; z max represents concatenating the results of average pooling and max pooling. δ is the ReLU activation function, σ is the Sigmoid activation function, and the finally obtained M c ∈R C is the channel attention weight.
[0218] The channel attention weight M c is multiplied element-wise with the input feature map X to obtain the weighted feature map as shown in Equation (11):
[0219] X′ c = X · M c (11);
[0220] (2) Spatial attention: After the channel attention module, we obtain the weighted feature map X′ c ∈R H×W×C . The spatial attention obtains a description of each spatial position by performing global average pooling and global max pooling operations on this feature map along the channel dimension, as shown in Equations (12) and (13):
[0221]
[0222]
[0223] The two feature maps obtained above are concatenated to obtain a 1×1×2C feature map, and then a 7×7 convolutional layer (or a smaller convolutional kernel) is used to generate the spatial attention map, and the final spatial attention weight is obtained through the Sigmoid function, as shown in Equation (14):
[0224] M s = σ(Conv7([f avg ; f max )) (14);
[0225] Among them, Conv7 represents a 7×7 convolutional operation, and the obtained M s σR H×W is the spatial attention weight.
[0226] Finally, the spatial attention weight M s is multiplied element-wise with the weighted feature map X′ c to obtain the final weighted feature map, as shown in Equation (15):
[0227] X' s = X′c ·M s (15);
[0228] 4.4 Error correction logic judgment module includes a data storage module, a data acquisition module, a data analysis module, a data comparison and judgment module, and an error correction execution module;
[0229] (S1) Data storage: Upload standard lesion data to the data storage module. The data is processed by the modeling module and constructed into a tree-structured database for efficient querying and matching;
[0230] (S2) Data acquisition: The data acquisition module obtains the current detection data and uploads it to the data analysis module for processing;
[0231] (S3) Data analysis: The data analysis module standardizes the acquired data to make its format consistent with the database storage format, and uploads the processed data to the data comparison and judgment module;
[0232] (S4) Data comparison: The data comparison and judgment module compares the analyzed data with the standard data in the database to determine its matching degree;
[0233] (S5) Error correction execution: If the comparison result shows data errors, the error correction execution module corrects the error data to improve the detection accuracy;
[0234] (S6) Exception handling: If no matching data is found in the database, it is determined that the current data is abnormal. Execute step (S5) for error correction and record the abnormal situation to optimize the subsequent detection ability of the system.
[0235] 5. Experimental results and analysis:
[0236] 5.1 Experimental parameter settings:
[0237] The environment for this experiment was built using the Pytorch framework. The GPU model is Nvidia GeForce RTX3080, the PyTorch version is 1.10.0, the Python version is 3.8, the CUDA version is 11.3. The size of the input images (Input_size) of the kidney stone dataset is (640, 640). The number of training epochs is 200. The training batch size (Batch_size) is 16 during the freezing stage in the first 50 rounds and then becomes 8 (the number of data passed to the model for training each time is 8). The optimizer type (Optimizer_type) uses the sgd optimizer. The maximum learning rate (Init_Ir) is 0.01, and the minimum learning rate (Min_Ir) is 0.0001. The learning rate decay adopts the cosine annealing method. The magnitude of the learning rate determines the convergence rate of the objective function. The parameters used are shown in Table 1:
[0238] Table 1 Training Parameters
[0239] Parameter Name Value Input_size 640×640 Epoch 200 Freeze_Epoch 50 Freeze_batch_size 16 Unfreeze_batch_size 8 Optimizer_type sgd Init_lr 0.01 Min_lr 0.0001 lr_decay_type cos
[0240] 5.2 Dataset
[0241] The public kidney stone dataset was obtained on Roboflow. This dataset contains various kidney stone images from CT scans. Each image is accompanied by a marked bounding box, covering the size, shape, and location of different stones within the urinary system. The dataset is annotated in the Pascal VOC format with a resolution of 391×320. Data augmentation was performed on each image with a 50% horizontal flip and random rotation from -10 to +10 degrees. The kidney stone dataset contains 1300 images, which were re-divided into a training set of 1040 images and a validation set of 260 images at a ratio of 8:2. Transparency and traceability were ensured during the annotation and processing of the dataset, guaranteeing the repeatability of the SCC-YOLOX model. Moreover, the data quality on the Roboflow platform has been strictly verified, without masking the impact of data quality on performance, ensuring that the experimental results truly reflect the relationship between the data and the model performance.
[0242] 5.3 Evaluation Metrics
[0243] To evaluate the detection performance of the model, Precision, AP, the number of parameters, and FLOPs were selected as the evaluation metrics for the model, where:
[0244] The prediction metric Precision is the detection accuracy, and the calculation formula is:
[0245]
[0246] Where TP is True Positive, that is, the prediction result is kidney stone, and the label value is also kidney stone, which means the prediction is correct. FP is False Positive, that is, the prediction result is kidney stone, but there is no label value, which means the prediction is incorrect. When Precision is larger, FP is smaller, and the number of objects without labels predicted as kidney stones is also smaller. It can be understood that the purity of the predicted positive examples is higher and the false detection is less.
[0247] Recall refers to the recall rate, and the definition of Recall is as follows:
[0248]
[0249] Analyzing the formula, it can be seen that Recall is concerned with the predicted positive and negative examples, as well as the true positive examples (FN). When Recall is larger, FN is smaller. At this time, the number of positive examples predicted as negative examples is smaller, that is, more of all positive examples are picked out. The higher the Recall, the less the missed detection.
[0250] mAP (mean Average Precision) is the average value of APs for all classes. In this invention, there is only one class of kidney stones, so mAP is AP. AP is the area enclosed by the curve formed by Precision (accuracy) and Recall (recall rate) and the coordinate axes. AP is the most important indicator in object detection, reflecting the overall detection level of the model. If the AP of a model is larger, it means the area enclosed by the PR curve and the coordinate axes is larger, and Precision and Recall are relatively higher overall.
[0251] The number of parameters refers to the total number of parameters that need to be trained during model training, which is used to measure the size of the model (computational space complexity).
[0252] 5.4 Experimental Results
[0253] To verify the effectiveness of the improved YOLOX model in this paper for the kidney stone dataset, ablation experiments were carried out under the same experimental environment and parameters. From the data in Table 2, it can be concluded that the improved model has certain improvements compared with the original model. The model with only the SE attention mechanism has an mAP increase of 1.45 percentage points compared with the original model. On the basis of the SE module, adding the CA attention mechanism also relatively increases the accuracy by 3.4 percentage points. Finally, for the improved model introducing the three attention mechanisms of SE, CA, and CBAM, although the number of parameters of the model has increased, the mean average precision has increased by 2.74 percentage points, and the recall rate has increased by 0.52 percentage points. This shows that the improved SCC - YOLOX model has certain improvements in various performance indicators, further proving the feasibility of this model.
[0254] Table 2 Ablation Experiment Results
[0255]
[0256] By analyzing the experimental data in Table 3, it can be concluded that the improved SCC-YOLOX model has a significant increase in mAP, and its final mAP reaches 76.74%. It not only comprehensively exceeds the basic YOLOX model (74.00%), but also surpasses the three object detection models of YOLOv5 (68.61%), YOLOv7 (74.23%), and YOLOv8 (74.98%). This indicates that by introducing attention mechanisms (SE, CA, and CBAM), the feature extraction ability of the model and the attention to key objects have been significantly enhanced, further improving the detection performance.
[0257] Table 3 Experimental Results of Comparative Models
[0258]
[0259] From Figure 6 it can be seen that the horizontal axis represents the number of training epochs (from 0 to 200), and the vertical axis is the mAP of the model. In the initial stage (10 - 50 epochs), the blue curve (the model with the attention module introduced) is slightly higher than the orange curve (the original model), indicating that the attention module starts to improve the model performance at the beginning of training; in the middle stage (50 - 100 epochs), both curves rise rapidly, indicating that the model gradually converges; in the later stage (100 - 200 epochs), the curves tend to be stable, indicating that the model is basically converged, and the blue curve is always slightly higher than the orange curve, indicating that the mAP of the model has been significantly improved after adding the attention mechanism.
[0260] The results of training the YOLOX model improved by the attention mechanism are as shown in Figure 7 (a) and (b). Figure 7 In (a), both the training and validation losses gradually decrease with the training process and finally tend to be stable, indicating that the model has successfully converged and there are no obvious problems of gradient explosion or gradient disappearance. Figure 7 In (b), it is the changing trend of the average detection accuracy with training. The model learns rapidly in the early stage of training and then gradually tends to be stable, indicating that the model has good convergence during the training process and there are no significant problems of underfitting or overfitting.
[0261] Figure 7 (c) and (d) are the Precision and AP obtained from the best results during training. Figure 7 From (c), it can be obtained that the model reaches a Precision of 86.27% when the scoring threshold is 0.5, indicating that it has a low false positive rate in the kidney stone detection task.Figure 7 (d) It can be seen that the AP of the model in kidney stone detection is 76.74%, indicating that it achieves a good balance between precision and recall. Especially in most intervals of Recall, Precision can maintain a high level.
[0262] In summary, the SCC-YOLOX model is superior to the original YOLOX model in multiple performance indicators. It has improved the mean average precision (mAP) by 2.74 percentage points, increased the accuracy by 2.5 percentage points, and the recall rate has also increased by 0.52 percentage points. This result fully demonstrates that after introducing the attention mechanism, the model can more effectively focus on the detailed information of kidney stones and maintain a high recognition ability when facing complex medical images.
[0263] In summary: By introducing the SE attention module, CoordAtt attention module, and CBAM attention module into the YOLOX model structure, the present invention can effectively improve the feature extraction ability and small target detection ability of the model, especially suitable for medical image targets such as kidney stones with small volume and unclear features. At the same time, the set error correction logic judgment module can reduce the risk of misdiagnosis and improve the reliability and stability of the system detection results. By adopting the above technical solutions, the present invention reduces the model parameter quantity and computational complexity while maintaining the detection accuracy, alleviates the problem of sample imbalance, improves the feature information expression ability and aggregation ability, and has the advantages of fast detection speed, high accuracy, and low misdiagnosis rate, and has broad clinical application value.
[0264] The disclosed technical features are not limited to the combination of the disclosed technical features and other features. Those skilled in the art can also make other combinations between the technical features according to the purpose of the invention, subject to achieving the purpose of the present invention.
Claims
1. A kidney stone detection system based on the SCC-YOLOX model, characterized in that: this system is mainly composed of a backbone network (Backbone), a neck network Neck, a detection head Head, an SE attention module, a CA attention module, a CBAM attention module, and an error correction logic judgment module (Error correction logic judgment), and the detection steps are as follows: The first step: Data input (1) Data input: Input a kidney stone CT image (640*640*3); (2) Preprocessing: Image normalization, resizing, data augmentation (such as mosaic, random flipping); (3) Input to the model: Input to YoloBody for object detection; The second step: Feature extraction of the backbone network (Backbone): (1) Perform preliminary feature extraction through the basic convolutional layer (BaseConv), and combine the SE attention module to enhance the expression ability of channel information; (2) Use CSPDarknet as the backbone network to extract features of different scales. During the forward process of YOLOPAFPN, CoordAtt attention modules are added to the P5 and P4 level features to enhance the position perception ability; (3) The Backbone structure is divided as follows: ① dark3 → low-level features (larger size, rich details); ② dark4 → intermediate-level features (medium size, balanced information); ③ dark5 → high-level features (small size, rich semantic information); The third step: Feature fusion of the neck network (Neck): YOLOX adopts an FPN (Feature Pyramid) + PAN (Path Aggregation) structure to enhance feature fusion, and a CBAM attention module is added to it to enhance the feature extraction effect; (1) Top-down (FPN); ① dark5 → P5 (reduce the number of channels); ② Upsample P5 and fuse it with dark4 → P4; ③ Upsample P4 and fuse it with dark3 → P3; (2) Bottom-up (PAN); ① Downsample P3 and fuse it with P4 → P4_out; ② Downsample P4_out and fuse it with P5 → P5_out; ③ The CBAM attention module further optimizes the feature representation; (3) Final output: ① P3_out (80×80, for detecting small targets); ② P4_out (40×40, for detecting medium targets); ③ P5_out (20×20, for detecting large targets); Fourth step: Classification and regression of the prediction head (YOLOXHead); (1) For each feature layer (P3, P4, P5), three types of predictions are made; ① Classification branch (cls_preds): Predict which class each pixel belongs to; ② Regression branch (reg_preds): Predict the bounding box of the target (4 values: x, y, w, h); ③ Object confidence branch (obj_preds): Predict whether there is an object at this point (1 value); (2) Finally, the prediction results of P3_out, P4_out, and P5_out are merged for post-processing; Among them, 1. When lesion information is scanned, it will also be input into the backbone network; 1.
1. The Focus module can reduce the number of parameters without losing information, improve the operation efficiency, and based on Focus, YOLOX replaces the traditional Anchor-base with Anchor-free, abandons the anchor boxes, and only takes the position where the center point of the target is located as the positive sample, alleviating the problem of imbalance between positive and negative samples and reducing the time cost; 1.
2. CSPNet uses the residual structure in ResNet[43] to split the stacked residual blocks, enhancing the network's feature learning ability while reducing the computational complexity; 1.
3. The SPP (Spatial Pyramid Pooling) module increases the receptive field of the network by performing multi-scale max pooling operations on the feature map; 2. Then it is input into the Neck network to transfer the rich spatial information in the shallow layer to the high-level feature map to enhance and fuse features; 3. Then it is input into the detection head Head for multi-scale fusion of features; The output scan information is input into the error correction logic judgment module for error analysis, so that when it is judged that the collected data does not match the original data in the database, that is, when the data is incorrect, the incorrect data can be corrected and modified to achieve the effect of automatic data error correction; Step 5: Error Correction Logic Judgment: (S1) Data storage: Construct a standard lesion data database and store it in a tree structure for efficient query and comparison; (S2) Data acquisition: Obtain the current detection result through the data acquisition module; (S3) Data analysis: Standardize the detection result to be consistent with the standard data format in the database; (S4) Data comparison and judgment: Compare the current detection data with the standard data to judge the accuracy of the detection result; (S5) Error correction execution: If there are abnormalities or errors in the detection result, automatically trigger the error correction module to correct the error result; (S6) Abnormality handling: If no matching data is found in the database, it is judged that the current data is abnormal, execute step (S5) for error correction, and record the abnormal situation to optimize the subsequent detection ability of the system.
2. The kidney stone detection system according to claim 1, wherein The CSPDarknet optimizes the computational complexity through the CSPNet structure, adopts the gradient flow splitting mechanism to reduce the computational cost while maintaining high accuracy, and can be used in combination with deep learning networks such as ResNet, ResNeXt, and DenseNet. Through the gradient flow splitting mechanism, CSPNet divides the input features into two parts. One part extracts features through residual blocks, and the other part is directly transmitted through cross-layer connections. Finally, the features of the two paths are combined in the fusion stage to reduce the computational amount while maintaining the accuracy.
3. The kidney stone detection system based on the SCC-YOLOX model according to claim 1, wherein The SPP (Spatial Pyramid Pooling) method is adopted to enhance the network's adaptability to input images of different scales, improve the feature extraction ability and detection accuracy. By adding a spatial pyramid pooling layer between the convolutional layer (including convolution operations such as Convolution and pooling operations such as Pooling) and the fully connected layer (Fully Connected Layer, FC), the fully connected layer can receive a feature vector of a fixed length, thus eliminating the limitation of the fully connected layer on the input size.
4. The kidney stone detection system based on the SCC-YOLOX model according to claim 3, wherein, The spatial pyramid pooling layer adopts a hierarchical pooling method to ensure that the length of the feature vector is fixed, which specifically includes the following steps: ① Multi-scale division: The feature map is divided into multiple grids according to different scales, such as 4×4, 2×2, and 1×1; ② Pooling calculation: Max Pooling is performed within each grid to extract key information; ③ Feature concatenation: Assuming the number of channels of the feature map is 256, features with dimensions of 16×256, 4×256, and 1×256 are formed after pooling; ④ Vector construction: The pooling results of different scales are concatenated into a feature vector of a fixed length and input into the fully connected layer to ensure that the network can stably process input images of different sizes.
5. The kidney stone detection system based on the SCC-YOLOX model according to claim 1, characterized in that The SE (Squeeze-and-Excitation) module includes two stages: the squeezing stage and the excitation stage. In the squeezing stage, first, the feature map of each channel is compressed into a vector with a shape of 1×1×C through global average pooling (Global Average Pooling, GAP), where C is the number of channels of the feature map. Then, the compressed vector is passed as input to the excitation stage for further processing.
6. The kidney stone detection system based on the SCC-YOLOX model according to claim 5, wherein In the excitation stage, two fully connected layers (Fully Connected Layer, FC1 and FC2) are used. To reduce the computational complexity, an intermediate dimension r is usually used in the fully connected layer, and this dimension is usually a smaller proportion of the input number of channels. First, the global feature vector z is mapped to a smaller dimension r through the first fully connected layer (FC1), and then the ReLU activation function is used for non-linear activation. Next, the second fully connected layer (FC2) further maps the activated features back to the number of channels C to generate the final channel weights and multiply them with the original feature map weighted.
7. The kidney stone detection system according to claim 1, characterized in that The CBAM attention module is used in the Neck network, and the CBAM module is added after each CSPLayer to optimize the fusion of channel and spatial information.
8. The kidney stone detection system according to claim 7, wherein The calculation process of CBAM includes: (1) Channel attention calculation: Global average pooling and max pooling are used to obtain channel information respectively, and the attention weights are calculated through the fully connected layer. (2) Spatial attention calculation: Max pooling and average pooling in the channel dimension are used to obtain spatial information, and the weights are calculated through convolution. (3) Weighted feature map: The results of channel attention and spatial attention are multiplied with the original feature map respectively to optimize the final feature representation.
9. The kidney stone detection system based on the SCC-YOLOX model according to claim 1, wherein The error correction logic judgment module (Error Correction Logic Judgment) consists of a data storage module, a data acquisition module, a data analysis module, a data comparison and judgment module, and an error correction execution module. Its working process is as follows: (S1) Data storage: Upload standard lesion data to the data storage module. The data is processed by the modeling module and constructed into a tree-structured database for efficient querying and matching; (S2) Data acquisition: The data acquisition module obtains the current detection data and uploads it to the data analysis module for processing; (S3) Data analysis: The data analysis module performs standardization processing on the acquired data to make its format consistent with the database storage format, and uploads the processed data to the data comparison and judgment module; (S4) Data comparison: The data comparison and judgment module compares the analyzed data with the standard data in the database to determine its matching degree; (S5) Error correction execution: If the comparison result shows that the data is incorrect, the error correction execution module corrects the incorrect data to improve the detection accuracy; (S6) Exception handling: If no matching data is found in the database, it is determined that the current data is abnormal. Step (S5) is executed for error correction, and the abnormal situation is recorded to optimize the subsequent detection ability of the system.
10. A kidney stone detection system based on the SCC-YOLOX model according to claim 9, characterized in that, The specific working process of the data comparison and judgment module in step (S4) is as follows: ① Data marking: Perform unique identification and marking classification on the analyzed data; ② Data partition comparison: Partition the marked data according to specific rules and gradually compare it with the standard data in the database; ③ Result judgment: If a matching item is found for the marked data in the database, it is determined that the data is correct and the detection process ends. If there is no match, the error correction process is executed to improve the detection accuracy.
Citation Information
Patent Citations
Ultrasonic image abdominal organ and viscera detection method based on YOLOX
CN117422701A
Power contact network foreign matter detection method and system based on improved YOLOv8 neural network
CN119027401A
Cited By
Chromosome image anomaly identification method based on deep learning
CN122049901A