Urine stone composition recognition method and system based on image recognition
By constructing the physical fracture edges of the stones and utilizing a convolutional neural network model, the problem of deep features of stones being obscured by the outer shell in existing technologies has been solved, enabling accurate identification and stable characterization of the components of urinary tract stones.
Patent Information
- Application Number
- CN202610890669.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-08-25
AI Technical Summary
Existing image recognition technologies cannot effectively isolate and identify the heterogeneous components inside and outside urinary tract stones, causing the deep core features to be obscured by the strong visual features of the outer shell, making accurate identification impossible during the stone fragmentation process.
The physical fracture edges of the stone are constructed by Laplace second-order differential operation. The compositional features of the internal core and the outer shell are extracted independently by using a convolutional neural network model. The weights are calculated by the area exposure ratio and exponential function to achieve accurate identification of the deep components.
It achieves independent extraction and precise decoupling of heterogeneous components in the inner and outer layers of stones, solves the feature suppression problem, and ensures high accuracy and high stability of component identification during dynamic lithotripsy.
Smart Images

Figure CN122636588A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology for urinary calculi, and more specifically, this application relates to a method and system for identifying the components of urinary calculi based on image recognition. Background Technology
[0002] Accurate digital identification of the composition of urinary tract stones is the core basis for clinical lithotripsy planning. In the real-world environment of clinical lithotripsy, many urinary tract stones exhibit heterogeneous characteristics, with their deep core components being distinctly different from their surface shell components. When the stone surface is physically penetrated to expose the deep cross-section, the visual texture of the outer shell and the heterogeneous pixels of the internal core coexist in the field of view.
[0003] Existing image recognition technologies are generally based on a single logic of target homogenization, directly applying uniform pooling or global weighting to the entire target area. Because the outer shell of kidney stones often has extremely high optical reflectivity and highly pronounced morphological texture, these high-intensity visual features result in strong feature suppression during global feature extraction. This causes the weak pixel features of the internal core region to be completely masked and annihilated by the high-intensity pixel signals of the outer layer. Consequently, machine vision systems can only perceive the surface components and cannot isolate and extract the true attributes of the deep, heterogeneous core, leading to the technical problem of failing to identify deep components in scenarios where the physical structure of kidney stones is dynamically evolving.
[0004] To address the aforementioned issues, there is an urgent need in this field for an identification scheme that can physically isolate and accurately decouple the characteristics of heterogeneous internal and external components in the case of physical fracture exposure of stones, thereby effectively solving the problem that the deep internal features of mixed stones are masked by the strong visual features of the outer shell. Summary of the Invention
[0005] To address the aforementioned technical problems, this paper provides a method and system for identifying the components of urinary tract stones based on image recognition. This technical solution solves the problems mentioned in the background section.
[0006] In a first aspect, embodiments of this application provide a method for identifying the components of urinary tract stones based on image recognition, comprising the following steps: acquiring an image of urinary tract stones collected by an endoscopic device, and obtaining a global contour mask representing the location of the target stone through a preset semantic segmentation algorithm; performing a Laplacian second-order differential operation within the pixel region corresponding to the global contour mask to obtain a second-order gradient matrix, and extracting zero-crossing points whose local gradient magnitude is greater than a first preset gradient threshold as first discrete edge points, and connecting the first discrete edge points through a morphological closing operation to construct a first closed gradient loop representing the physical fracture edge of the target stone; using the first closed gradient loop as the boundary, dividing the global contour mask into an internal core area mask located within the first closed gradient loop and a mask located within the first closed gradient loop. The outer shell region mask outside the gradient loop is used; the pixel regions corresponding to the inner core region mask and the outer shell region mask are extracted and input into a preset convolutional neural network model to obtain the core component classification probability and the shell component classification probability; the ratio of the pixel area of the inner core region mask to the total pixel area of the global contour mask is calculated to obtain the area exposure ratio; it is determined whether the area exposure ratio is greater than the preset noise reduction dead zone threshold. If so, the first core exposure weight is calculated according to the area exposure ratio and the first exponential function is used; the core component classification probability is weighted using the first core exposure weight, and the shell component classification probability is weighted using the complement of the first core exposure weight. The weighted sum of the two is calculated to obtain the first component identification ratio of the urinary stone image and output it.
[0007] Secondly, embodiments of this application provide a urinary tract stone component identification system based on image recognition, comprising: a data acquisition module for acquiring urinary tract stone images collected by an endoscopic device and obtaining a global contour mask representing the location of the target stone through a preset semantic segmentation algorithm; a closed gradient loop processing module for performing a Laplacian second-order differential operation within the pixel region corresponding to the global contour mask to obtain a second-order gradient matrix and extracting zero-crossing points whose local gradient magnitude is greater than a first preset gradient threshold as first discrete edge points, and connecting the first discrete edge points through a morphological closing operation to construct a first closed gradient loop representing the physical fracture edge of the target stone; and a mask processing module for dividing the global contour mask into an internal core area mask located inside the first closed gradient loop and a mask located outside the first closed gradient loop, using the first closed gradient loop as the boundary. The module includes a surface shell region mask; a classification probability processing module, which extracts the pixel regions corresponding to the internal core region mask and the surface shell region mask, and inputs them into a preset convolutional neural network model to obtain the classification probabilities of the core components and the shell components; a proportion processing module, which calculates the ratio of the pixel area of the internal core region mask to the total pixel area of the global contour mask to obtain the area exposure proportion; a judgment weight processing module, which determines whether the area exposure proportion is greater than a preset noise reduction dead zone threshold. If so, it calculates the first core exposure weight according to the area exposure proportion and a preset first exponential function; and an identification output module, which uses the first core exposure weight to weight the core component classification probability and the complement of the first core exposure weight to weight the shell component classification probability, calculates the weighted sum of the two, obtains the first component identification proportion of the urinary stone image, and outputs it.
[0008] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described image recognition-based method for identifying the components of urinary tract stones.
[0009] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0010] 1. This scheme locates the first closed gradient loop through the second-order Laplacian differential operation. Using this as the boundary, the global contour mask is forcibly split into a physically isolated internal core area mask and a surface shell area mask. The pixel regions are extracted and input into a preset convolutional neural network model, realizing the completely independent extraction and precise decoupling of the heterogeneous component image features of the inner and outer layers of the stone. This effectively solves the feature suppression and volume average fallacy problems caused by global feature extraction in existing technologies.
[0011] 2. This scheme calculates the area exposure ratio and the first core exposure weight according to the preset first exponential function. It uses this weight to weight the classification probability of the core component and its complement to weight the classification probability of the shell component. This realizes the nonlinear dynamic transfer of weight along with the degree of deep cross-section exposure, which accurately matches the process of advancing the depth of the crushed stone and effectively solves the technical problem that component recognition cannot adapt to the evolution of the physical environment in the dynamic crushing process.
[0012] 3. Before calculating the first core exposure weight using the area exposure ratio, this scheme determines whether the area exposure ratio is greater than the preset noise-proof dead zone threshold, successfully filtering out initial non-tomographic visual interference, ensuring the stability and high confidence of the first component identification ratio, and effectively solving the technical problem that the algorithm is prone to oscillation of recognition results when facing small noise or initial scratches. Attached Figure Description
[0013] Figure 1 A schematic diagram illustrating the steps of the image recognition-based method for identifying the components of urinary tract stones provided in an embodiment of this application;
[0014] Figure 2 A schematic diagram of the logic flow of the image recognition-based method for identifying the components of urinary tract stones provided in the embodiments of this application;
[0015] Figure 3 This is a schematic diagram of the structure of the image recognition-based urinary tract stone composition identification system provided in the embodiments of this application. Detailed Implementation
[0016] This application provides a method and system for identifying the components of urinary tract stones based on image recognition. This solves the core technical problem that in the endoscopic image recognition scenario of urinary tract stone fragmentation, existing algorithms treat the stone as a homogeneous whole for global feature extraction, which leads to the strong visual features of the outer shell forcibly suppressing and annihilating the weak heterogeneous pixels of the internal cross-section, thus causing the identification of the deep core components of mixed stones to fail.
[0017] This solution aims to address the core technical problem of completely failing to identify deep heterogeneous components during the lithotripsy process of urinary tract stones due to the strong visual features of the outer shell. Traditional image recognition methods treat stones as homogeneous, intact regions. When processing mixed stones that have been broken down, the bright or rough outer shell pixels forcibly suppress the relatively smooth core pixel features inside the cross-section, leading to misidentification of deep components.
[0018] To overcome the limitations of the homogenization assumption, this scheme starts from the evolution of the physical spatial topology of damaged stones. When the stone surface undergoes physical fracturing, the physical fracture edge will inevitably form a significant gradient change boundary in the image brightness space. This scheme acquires images of urinary stones obtained by an endoscopic device and obtains a global contour mask representing the location of the target stone through a preset semantic segmentation algorithm. A second-order Laplacian derivative operation is performed within the pixel region corresponding to the global contour mask to obtain a second-order gradient matrix. Zero-crossing points with local gradient magnitudes greater than a first preset gradient threshold are extracted as the first discrete edge points. Morphological closing operations are used to connect the first discrete edge points, successfully constructing the first closed gradient loop representing the physical fracture edge of the target stone.
[0019] Using the first closed gradient loop at the physical level as a natural isolation boundary, this scheme forcibly divides the global contour mask into an inner core region mask located inside the first closed gradient loop and a surface outer shell region mask located outside the first closed gradient loop. This forced spatial stripping based on physical discontinuity completely cuts off the mutual interference between inner and outer layer pixels during model inference. Subsequently, the pixel regions corresponding to the inner core region mask and the surface outer shell region mask are extracted and independently input into a preset convolutional neural network model to obtain the core component classification probabilities and outer shell component classification probabilities that do not interfere with each other.
[0020] Considering that the physical exposure area of the deep core section changes continuously as the clinical lithotripsy process progresses, this scheme further calculates the ratio of the pixel area of the internal core area mask to the total pixel area of the global contour mask to obtain the area exposure ratio. To prevent misjudgment caused by initial minor scratches or blisters, it is determined whether the area exposure ratio is greater than a preset noise reduction dead zone threshold. When this threshold condition is met, this scheme introduces a nonlinear mapping relationship, calculating the first core exposure weight according to the area exposure ratio and a preset first exponential function. As the physical exposure area increases, the decision weight of the deep core feature increases exponentially. Finally, the classification probability of the core component is weighted using the first core exposure weight, and the classification probability of the outer shell component is weighted using the complement of the first core exposure weight. The weighted sum of the two is calculated to obtain the first component identification ratio of the urinary stone image and output.
[0021] The core technical effect of this solution is that it uses the physical fracture edge of the stone itself as a visual isolation wall to achieve efficient and independent decoupling of spatial heterogeneous components. Combined with the exponential weight allocation mechanism that is adaptively updated with the physical process, it completely breaks the feature suppression dilemma caused by global feature extraction. It effectively solves the technical problem of failure in deep heterogeneous component identification in dynamic lithotripsy scenarios, and ensures high accuracy and high stability of component identification under complex working conditions.
[0022] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0023] like Figure 1 The diagram illustrates the steps of the image recognition-based urinary tract stone component identification method provided in this embodiment. To completely break the rigid assumption of existing technologies that treat stones as homogeneous wholes for global feature extraction, and to fundamentally solve the problem of strong visual features on the outer shell forcibly suppressing and annihilating weak heterogeneous pixels deep within, this specific embodiment provides an image recognition-based urinary tract stone component identification method, including the following steps: acquiring urinary tract stone images collected by an endoscopic device, and obtaining a global contour mask representing the target stone using a preset semantic segmentation algorithm; performing a Laplacian second-order differential operation within the pixel region corresponding to the global contour mask to obtain a second-order gradient matrix, and extracting zero-crossing points whose local gradient magnitude is greater than a first preset gradient threshold as first discrete edge points, and connecting the first discrete edge points through morphological closing operations to construct a representation of the target stone component. The first closed gradient loop at the edge of the fault is used as the boundary. The global contour mask is divided into an inner core region mask located inside the first closed gradient loop and a surface shell region mask located outside the first closed gradient loop. The pixel regions corresponding to the inner core region mask and the surface shell region mask are extracted and input into a preset convolutional neural network model to obtain the classification probabilities of the core components and the shell components. The ratio of the pixel area of the inner core region mask to the total pixel area of the global contour mask is calculated to obtain the area exposure ratio. It is determined whether the area exposure ratio is greater than the preset noise reduction dead zone threshold. If so, the first core exposure weight is calculated according to the area exposure ratio and the first exponential function is used to calculate the first core exposure weight. The first core exposure weight is used to weight the core component classification probability, and the complement of the first core exposure weight is used to weight the shell component classification probability. The weighted sum of the two is calculated to obtain the first component identification ratio of the urinary stone image and output it.
[0024] Regarding the core parameters and processing methods in the above steps, the preset semantic segmentation algorithm adopts a lightweight segmentation network model such as U-Net that conforms to medical digital imaging and communication standards. Its training dataset comes from real clinical endoscopy images of stones and can be expanded through data augmentation methods such as rotation, flipping, and color perturbation.
[0025] The segmentation network was trained under supervised supervision using the cross-entropy loss function. The model convergence condition was a validation set intersection-union ratio greater than 0.95 to ensure stable execution on computationally limited medical edge computing devices. The Laplacian second-order differential operation is a common operator in digital signal processing. Using a 3x3 or 5x5 discrete convolution kernel, its input is a grayscale pixel matrix, and its output is a second-order gradient matrix representing the isotropic second derivative of the image. This allows for sub-pixel-level spatial localization of optical shadow bands caused by deep physical craters.
[0026] Specifically, the operation of dividing the global contour mask into an inner core area mask and a surface outer shell area mask can be implemented through a flood-fill algorithm, such as Flood-fill, which uses a pixel on the first closed gradient loop as a hard boundary and fills the inside and outside of the loop with different identifier values, thereby achieving absolute isolation at the physical level.
[0027] The preset noise reduction dead zone threshold was obtained through a large number of in vitro lithotripsy experiments. Its value range is [0.01, 0.05]. The typical engineering value is set to 0.03. It is used to forcibly filter out false exposure areas caused by tiny bubbles or probe scratches in the initial stage of the algorithm, so as to avoid the system losing trust in the shell features too early.
[0028] Figure 2 This is a schematic diagram of the logic flow of the image recognition-based urinary tract stone component identification method provided in this application embodiment. Through the above technical solution, this embodiment introduces the core technical means of second-order differential closed gradient loop combined with flood filling algorithm to force pixel region splitting, which solves the specific detailed technical problem of recognition failure caused by the deep features being covered by the outer shell during the dismantling process of mixed stones. It achieves the technical effect of completely eradicating the volume average fallacy and accurately peeling off and independently extracting the image features of heterogeneous components at the machine vision bottom layer.
[0029] Furthermore, in order to accurately extract the physical tomographic edges weakened by optical scattering even under harsh conditions of high turbidity where the image contrast dynamically decreases due to endoscopic irrigation fluid scattering, and to achieve dynamic adaptive noise reduction feedback to the fluid physical environment, the data processing procedure of this embodiment also includes the specific acquisition process of the first discrete edge point as follows: acquiring a preset reference gradient threshold; acquiring the global pixel variance of the second-order gradient matrix within the pixel area covered by the global contour mask; if the global pixel variance is less than the preset turbidity reference value, then according to the difference between the global pixel variance and the turbidity reference value, the preset reference gradient threshold is lowered according to a preset proportional coefficient to obtain the first preset gradient threshold, and the zero-crossing points whose local gradient amplitude is greater than the first preset gradient threshold are extracted from the second-order gradient matrix as the first discrete edge point.
[0030] The baseline gradient threshold is a system preset value, and its calibration process is as follows: Under a standard laboratory testing environment, using pure physiological saline as the medium, multiple sets of endoscopic images of urinary stones with real physical tomographic edges are acquired. The second-order Laplacian derivative is performed on these images to obtain the second-order gradient matrix under standard conditions. The local gradient magnitudes of all pixels at the real tomographic edges are statistically analyzed, and the 15th percentile is taken as the baseline gradient threshold.
[0031] The preset turbidity baseline value is a key watershed parameter reflecting the intensity of diffuse optical reflection of the fluid, and is preferably set to 70% of the average global pixel variance of the clear image dataset. The preset scaling factor is a constant between [0.5, 2.0], with a typical value of 1.0.
[0032] The specific downgrading calculation model is as follows: First preset gradient threshold = Baseline gradient threshold - Scale coefficient × |Global pixel variance - Turbidity baseline value|. The termination condition for this dynamic processing step is that the global pixel variance recovers to above the preset turbidity baseline value, ensuring that the threshold downgrading only takes effect in the transient range where the field of view is obstructed.
[0033] Through the above technical solution, this embodiment solves the specific technical problem of the decrease in the gradient amplitude of the real fault edge caused by the scattering of turbid fluid, which leads to the omission of detection, by using the core technical means of dynamically lowering the reference gradient threshold of global pixel variance. It achieves the technical effect of forcibly finding the weak physical fault edge in a low contrast environment.
[0034] Furthermore, to prevent the fixed-size morphological kernel from causing breakage at breakpoints or excessively consuming core pixels under conditions where the physical fracture surface is extremely irregular and exhibits a star-shaped scattered distribution, and to achieve machine vision topological boundary construction with self-growing elasticity, this embodiment's data processing process also includes: if the global pixel variance is greater than or equal to a preset turbidity baseline value, then directly using a preset baseline gradient threshold as a second preset gradient threshold; extracting zero-crossing points from the second-order gradient matrix whose local gradient magnitude is greater than the second preset gradient threshold as second discrete edge points; obtaining the pixel coordinate system of the urinary calculus image; and obtaining all extracted second discrete edges. The coordinates of the point in the pixel coordinate system are calculated, and the area of the largest bounding rectangle surrounding all the second discrete edge points is calculated accordingly. The ratio of the area of the largest bounding rectangle to the total pixel area of the global contour mask is calculated to obtain the torsional spatial dispersion. The torsional spatial dispersion is input into a preset linear mapping function to obtain the kernel size of the morphological operation structuring element. The larger the torsional spatial dispersion, the larger the kernel size of the mapping output. According to the output kernel size, the corresponding morphological operation structuring element is generated according to the preset morphological rules. The morphological operation structuring element is used to perform a dilation-erosion morphological closing operation on the second discrete edge points to obtain the second closed gradient loop.
[0035] To address the aforementioned characteristics, a pre-defined linear mapping function is obtained through pre-calibrated offline methods. Specifically, the function is constructed as follows: First, a series of simulated stone sample images from fault regions with varying degrees of dispersion are prepared, and their ideal closed gradient loops are manually labeled. Second, morphological closing operations are performed on samples with different dispersion levels using different kernel sizes, recording the minimum kernel size that best connects edge points and forms a closed loop. Finally, linear regression fitting is performed with fault spatial dispersion as the independent variable and the corresponding optimal kernel size as the dependent variable. The pre-defined linear mapping function is expressed as: Kernel size = ceil(a × fault spatial dispersion + b). Here, ceil is the floor function, a ranges from [10, 30], with a typical engineering value of 20, and b is the basic minimum kernel size, typically 3. The structural elements generated by the pre-defined morphological rules can be circular, square, or cross-shaped.
[0036] Through the above technical solution, this embodiment solves the specific refinement problem that conventional morphological closing operations cannot close large, irregular, star-shaped craters due to excessively high dispersion by dynamically amplifying the core size of morphological operations through the core technical means of fault spatial dispersion. It achieves the technical effect of precisely encompassing any strangely shaped crater surface, just like an adaptive rubber band.
[0037] Furthermore, to eliminate the pseudo-incremental error of cross-sectional area introduced by using dynamically enlarged kernel sizes for morphological connections, and to achieve high-precision restoration and correction of the actual physical tomographic exposure area, this embodiment, after obtaining the second closed gradient loop, further includes: dividing the global contour mask into a second internal core region mask and a second surface shell region mask using the second closed gradient loop as the boundary, and inputting the corresponding pixel regions into the convolutional neural network model to obtain the core component classification probability and the shell component classification probability; calculating the ratio of the pixel area of the second internal core region mask to the total pixel area of the global contour mask to obtain the initial exposure ratio; obtaining the kernel size of the morphological operation structuring element used when generating the second closed gradient loop, and through... The system queries a preset attenuation mapping table to extract the corresponding area attenuation coefficient based on the kernel size. This area attenuation coefficient is then used to reduce and correct the initial exposure ratio, resulting in a corrected area exposure ratio. The corrected area exposure ratio is then used to replace the current area exposure ratio, resulting in a new area exposure ratio. It is then determined whether the new area exposure ratio exceeds a preset noise reduction dead zone threshold. If so, the second core exposure weight is calculated based on the new area exposure ratio using a preset second exponential function. The second core exposure weight is then used to weight the core component classification probability, and the complement of the second core exposure weight is used to weight the shell component classification probability. The weighted sum of these two weighted sums is then calculated to obtain and output the second component identification ratio of the urinary calculus image.
[0038] The calculation logic of the second exponential function is the same as that of the first exponential function. However, in the specific implementation, the result is recorded as the second core exposure weight. Since they are technical features under different judgment logic branches, the calculation logic is the same and they need to be distinguished.
[0039] The pre-defined decay mapping table is a set of key-value pairs constructed during the offline calibration phase and stored in system memory. Its keys are the morphological matrix dimensions, such as K=3,5,7,9, and its values are floating-point decay coefficients strictly less than 1, such as 0.92. The larger the kernel size, the smaller the corresponding value. This serves as a hard mathematical penalty for the geometrically artificial increase in area caused by large-size dilation operations, restoring the true exposed area eroded by morphological operations.
[0040] Through the above technical solution, this embodiment solves the specific technical problem of the "bloated" core area exposure algorithm layer caused by the outward expansion of the large kernel size closed operation by introducing a preset attenuation mapping table for reverse area reduction. It achieves the technical effect of high-precision merging and correction of two heterogeneous data processing streams in a physical sense.
[0041] Furthermore, to overcome the algorithm blinding defect caused by the instantaneous loss of spatial dimension and maintain the temporal stability of the identification parameters under extreme oscillation conditions where the fluid environment undergoes instantaneous temporal changes, resulting in optical dust artifacts obscuring large areas of real physical pits, this implementation method, after obtaining the second component identification ratio, establishes a historical state cache queue to record the type identifiers of closed gradient loops generated in multiple consecutive data processing cycles; obtaining the first component identification ratio or the second component identification ratio once is the end point of one data processing cycle and the start point of the next data processing cycle, with the moment of the first acquisition of the first component identification ratio or the second component identification ratio as the start point of the first data processing cycle; obtaining the cycle number of the data processing cycle, which is used to characterize the sorting number of the data processing cycle; in the current data processing cycle, if the cycle of the current data processing cycle is... When the number of processing cycles exceeds the first preset number of cycles, the current global pixel variance is less than the preset turbidity baseline value, and all data processing cycles in the previous second preset number of cycles in the historical state cache queue are processed through the second closed gradient loop, the area exposure ratio of the most recent data processing cycle in the historical state cache queue is extracted. The absolute difference between the area exposure ratio of the most recent data processing cycle and the average area exposure ratio of all data processing cycles within the third preset number of cycles before the current data processing cycle is calculated to obtain the absolute value of the area exposure ratio difference. If the absolute value of the area exposure ratio difference is greater than the preset area mutation threshold, the absolute value of the area exposure ratio difference is input into the preset threshold decay function to obtain the dead zone threshold. The larger the absolute value of the area exposure ratio difference, the smaller the calculated dead zone threshold. The dead zone threshold is used as the noise reduction dead zone threshold for the next data processing cycle.
[0042] The first, second, and third preset number of iterations are typically set to 5, representing the continuous image frame processing cycle, and are used to confirm the steady-state confidence level of the historical fault exposure state.
[0043] The preset area abrupt change threshold is set to 0.15. When the transient difference exceeds this boundary, the system determines that a non-physical collision optical occlusion abrupt change has occurred. The preferred form of the preset threshold decay function is:
[0044] Dead zone threshold = max(lower limit of dead zone threshold, original preset noise reduction dead zone threshold - attenuation coefficient × absolute value of the difference in area exposure ratio). Here, max is the maximum value function, and the lower limit of the dead zone threshold, such as 0.00, is used to ensure that the threshold does not decrease indefinitely and cause oscillations under extreme occlusion.
[0045] Through the above technical solutions, this embodiment solves the specific technical problem of the calculated area falling below the static dead zone due to sudden fluid changes and dust occlusion, which causes the system to misjudge real large pits as initial noise by using the core technical means of historical state cache queue and dead zone threshold reduction driven by sudden area drop. It achieves the technical effect of giving the machine vision system historical physical inertia common sense and completely eliminating the algorithm value flickering caused by blindness due to harsh working conditions.
[0046] Furthermore, to achieve zero-interference physical isolation of heterogeneous data matrices at the pixel level and ensure the purity of high-dimensional spatial features input to the neural network model, the specific acquisition process of the core component classification probability and the shell component classification probability in this embodiment includes: performing matrix multiplication between the internal core region mask and the urinary stone image to obtain the core feature pixel matrix; performing matrix multiplication between the surface shell region mask and the urinary stone image to obtain the shell feature pixel matrix; inputting the core feature pixel matrix and the shell feature pixel matrix into two independent parallel feature extraction layers of a preset convolutional neural network model, respectively, and outputting the core component classification probability and the shell component classification probability through fully connected layers and the Softmax function mapping, respectively. The preset convolutional neural network model is preferably based on a Siamese network, such as a multi-input model with a ResNet or DenseNet backbone network. When performing the dot multiplication operation, the single-channel binary matrix corresponding to the mask is multiplied element-wise with the R, G, and B channels of the three-dimensional color matrix corresponding to the urinary stone image, and the original image size is maintained by zero background filling. The Softmax function, as the last activation unit, maps the logits values output by the network to a probability distribution vector that sums to 1.
[0047] Through the above technical solution, this embodiment solves the specific technical problem that homogeneous pooling network architecture is easily contaminated by high-contrast background pixels crossing the boundary by using the core technical means of twin network architecture and dot product zeroing of mask matrix, and achieves the technical effect that heterogeneous textures inside and outside dot product ...
[0048] Furthermore, in order to accurately simulate the physical work done by laser pulse energy as it penetrates deeper into space, and to achieve a smooth and nonlinear dynamic transfer of decision-making power between the inner and outer layer components, this embodiment sets the specific calculation formula of the preset first exponential function as follows: ,in, This indicates the first core exposure weight. Represents the natural constant. Indicates the percentage of area exposed. The preset noise reduction dead zone threshold, This represents the preset weight gain coefficient. .
[0049] Preset weight gain coefficient This is used to control the rate at which the core exposure weight increases with the proportion of area exposure. The larger the preset weight gain coefficient value, the steeper the weight jump. The preset weight gain coefficient value is obtained through parameter scanning experiments: on endoscopic image datasets at different lithotripsy stages, with the final component recognition accuracy as the optimization objective, the range [5,20] is traversed to select the value that maximizes the average recognition accuracy, and its typical engineering value is set to 10.
[0050] The convergence boundary of this formula is: when When the exponent is non-negative, the system forces the weight to be 0; when After breaking through the dead zone threshold, the first core exposure weight exhibits a steep S-shaped upward curve and rapidly approaches 1.
[0051] Through the above technical solution, this embodiment solves the specific technical problem that linear averaging cannot reflect the decisive exposure moment of deep core, which leads to parameter lag, by introducing the core technical means of exponential nonlinear mapping formula. It achieves the technical effect of the transfer algorithm perfectly matching the exponential increase of the discourse power of core components in the process of layer-by-layer deep excavation of mixed stones.
[0052] Furthermore, in order to thoroughly eliminate isolated false positive noise points such as suspended dust under low gradient threshold extraction conditions by utilizing the physical continuity of microscopic space, and to ensure the purity of the final topological closed loop, the specific acquisition process of the first closed gradient loop under turbid conditions in this embodiment includes: acquiring the pixel coordinate system of the urinary stone image; acquiring the pixel coordinates of all extracted first discrete edge points in the pixel coordinate system; for each first discrete edge point, counting the number of other first discrete edge points contained in the neighborhood window with a preset pixel radius as the center, and obtaining the local neighborhood density; determining whether the local neighborhood density is greater than or equal to the preset edge continuity threshold; if so, determining that the first discrete edge point belongs to the true edge of the physical fault and retaining it; if not, determining that the first discrete edge point belongs to isolated noise and removing it, and collecting the retained first discrete edge points to obtain a purified discrete edge point set; performing morphological closing operation on the purified discrete edge point set using a morphological operation structuring element of a preset size to obtain a closed connected region; extracting the outer edge contour of the closed connected region as the first closed gradient loop.
[0053] The preset pixel radius ranges from 3 to 7 pixels, with a typical engineering value of 5, used to construct a local square analysis grid.
[0054] The preset edge continuity threshold is set based on the topological characteristics of physical faults. Since real mechanical faults inevitably exhibit a non-isolated clustering state in space, while random noise points exhibit a Poisson distribution, statistical analysis of a dataset of stone images with labeled true and false edges determined the threshold to be 3. This means that within a neighborhood window of a preset pixel radius, if fewer than three similar edge points cluster together, the center point is considered an isolated noise point.
[0055] The morphological structural elements of the preset size are fixed to the minimum dimension, such as a radius of 2, because noise has been purified by density filtering beforehand. Using a conservative fixed small kernel is sufficient to close extremely small real gaps without causing the region to become bloated.
[0056] Through the above technical solution, this embodiment solves the specific technical problem that a large number of suspended isolated dust noise points are forcibly connected into a deformed closed loop when the threshold is lowered during extraction by using the core technical means of local density statistics pre-filtering of the neighborhood window. It achieves the technical effect of accurately anchoring the real profile topological boundary in a highly interfered and turbid field of view by relying on the continuity of micro-physics.
[0057] Figure 3This is a schematic diagram of the structure of the image recognition-based urinary tract stone component identification system provided in this application embodiment. The image recognition-based urinary tract stone component identification system includes: a data acquisition module: used to acquire urinary tract stone images collected by an endoscopic device, and obtain a global contour mask representing the location of the target stone through a preset semantic segmentation algorithm; a closed gradient loop processing module: used to perform Laplacian second-order differential operation in the pixel region corresponding to the global contour mask, obtain a second-order gradient matrix, and extract the zero-crossing points whose local gradient magnitude is greater than a first preset gradient threshold as the first discrete edge points, and connect the first discrete edge points through morphological closing operation to construct a first closed gradient loop representing the physical fracture edge of the target stone; and a mask processing module: used to divide the global contour mask into an internal core area mask located inside the first closed gradient loop and a mask located outside the first closed gradient loop, with the first closed gradient loop as the boundary. The outer shell region mask is located outside the first closed gradient loop; the classification probability processing module is used to extract the pixel regions corresponding to the inner core region mask and the outer shell region mask, and input them into a preset convolutional neural network model to obtain the classification probabilities of the core components and the outer shell components; the proportion processing module is used to calculate the ratio of the pixel area of the inner core region mask to the total pixel area of the global contour mask to obtain the area exposure proportion; the judgment weight processing module is used to determine whether the area exposure proportion is greater than the preset noise reduction dead zone threshold. If so, the first core exposure weight is calculated according to the area exposure proportion and the preset first exponential function; the identification output module is used to weight the core component classification probability using the first core exposure weight and weight the outer shell component classification probability using the complement of the first core exposure weight, calculate the weighted sum of the two, obtain the first component identification proportion of the urinary stone image and output it.
[0058] This application also provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements a method for identifying the components of urinary tract stones based on image recognition.
[0059] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0060] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0061] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0062] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0063] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0064] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for identifying the composition of urinary tract stones based on image recognition, characterized in that, Includes the following steps: Acquire images of urinary stones from endoscopic equipment and obtain a global contour mask representing the location of the target stone through a preset semantic segmentation algorithm; Perform a second-order Laplacian differential operation within the pixel region corresponding to the global contour mask to obtain the second-order gradient matrix. Extract the zero-crossing points whose local gradient magnitude is greater than the first preset gradient threshold as the first discrete edge points. Connect the first discrete edge points through morphological closing operation to construct the first closed gradient loop that represents the edge of the physical fault of the target stone. Using the first closed gradient loop as the boundary, the global contour mask is divided into an inner core region mask located inside the first closed gradient loop and a surface shell region mask located outside the first closed gradient loop. Extract the pixel regions corresponding to the inner core area mask and the outer shell area mask, and input them into the preset convolutional neural network model respectively to obtain the classification probabilities of the core components and the outer shell components. The ratio of the pixel area of the inner core area mask to the total pixel area of the global contour mask is calculated to obtain the area exposure ratio. Determine whether the area exposure ratio is greater than the preset noise reduction dead zone threshold. If so, calculate the first core exposure weight according to the area exposure ratio and the preset first exponential function. The classification probabilities of core components are weighted using the first core exposure weight, and the classification probabilities of shell components are weighted using the complement of the first core exposure weight. The weighted sum of the two is calculated to obtain the first component identification ratio of the urinary stone image and output it.
2. The method for identifying the composition of urinary tract stones based on image recognition according to claim 1, characterized in that, The specific process for obtaining the first discrete edge point is as follows: Obtain the baseline gradient threshold; Obtain the global pixel variance of the second-order gradient matrix within the pixel region covered by the global contour mask; If the global pixel variance is less than the preset turbidity reference value, the reference gradient threshold is lowered according to the difference between the global pixel variance and the turbidity reference value by a preset proportional coefficient to obtain the first preset gradient threshold. Zero-crossing points whose local gradient magnitude is greater than the first preset gradient threshold are extracted from the second-order gradient matrix as the first discrete edge points.
3. The method for identifying the composition of urinary tract stones based on image recognition according to claim 2, characterized in that, If the global pixel variance is greater than or equal to the preset turbidity baseline value, the baseline gradient threshold is directly used as the second preset gradient threshold. The zero-crossing points whose local gradient magnitude is greater than the second preset gradient threshold are extracted from the second-order gradient matrix and used as the second discrete edge points; Obtain the pixel coordinate system of the image of urinary stones; The coordinates of all extracted second discrete edge points in the pixel coordinate system are used to calculate the area of the largest bounding rectangle that encloses all second discrete edge points. The ratio of the area of the largest bounding rectangle to the total pixel area of the global contour mask is calculated to obtain the spatial dispersion of the fault. The fault spatial dispersion is input into a preset linear mapping function to obtain the kernel size of the morphological operation structure element. The larger the fault spatial dispersion, the larger the kernel size of the mapping output. Based on the output kernel size, the corresponding morphological operation structuring element is generated according to the preset morphological rules. The morphological operation structuring element is then used to perform a morphological closing operation of first dilation and then erosion on the second discrete edge point to obtain the second closed gradient loop.
4. The method for identifying the composition of urinary tract stones based on image recognition according to claim 3, characterized in that, After obtaining the second closed gradient loop, it also includes: Using the second closed gradient loop as the boundary, the global contour mask is divided into the second inner core region mask and the second outer shell region mask, and the corresponding pixel regions are input into the convolutional neural network model to obtain the core component classification probability and the shell component classification probability. Calculate the ratio of the pixel area of the second inner core region mask to the total pixel area of the global contour mask to obtain the initial exposure ratio; Obtain the kernel size of the morphological operation structuring element used when generating the second closed gradient loop. Extract the corresponding area decay coefficient based on the kernel size by querying the preset decay mapping table. Use the area decay coefficient to reduce and correct the initial exposure ratio to obtain the corrected area exposure ratio. Replace the current area exposure ratio with the corrected area exposure ratio to obtain a new area exposure ratio. Determine whether the new area exposure ratio is greater than the preset noise reduction dead zone threshold. If so, calculate the second core exposure weight according to the preset second exponential function based on the new area exposure ratio. The classification probabilities of core components are weighted using the second core exposure weight, and the classification probabilities of shell components are weighted using the complement of the second core exposure weight. The weighted sum of the two is calculated to obtain the second component identification ratio of the urinary stone image and output it.
5. The method for identifying the composition of urinary tract stones based on image recognition according to claim 1 or 4, characterized in that, After obtaining the identification ratio of the second component, a historical state cache queue is established to record the type identifier of the closed gradient loop generated in multiple consecutive data processing cycles. The acquisition of the first component identification ratio or the second component identification ratio is the end point of one data processing cycle and the start point of the next data processing cycle. The moment when the first first component identification ratio or the second component identification ratio is acquired is taken as the start point of the first data processing cycle. Obtain the number of data processing cycles; the number of cycles is used to represent the sorting number of the data processing cycles. In the current data processing cycle, if the number of cycles in the current data processing cycle is greater than the first preset number and the current global pixel variance is less than the preset turbidity benchmark value, and the data processing cycles of the first two preset numbers in the historical state cache queue are all processed through the second closed gradient loop, the area exposure ratio of the most recent data processing cycle in the historical state cache queue is extracted. The absolute value of the area exposure ratio difference is calculated by comparing the area exposure ratio of the most recent data processing cycle with the average area exposure ratio of all data processing cycles within the third preset number of times before the current data processing cycle. If the absolute value of the difference in area exposure ratio is greater than the preset area mutation threshold, the absolute value of the difference in area exposure ratio is input into the preset threshold decay function to obtain the dead zone threshold. The larger the absolute value of the difference in area exposure ratio, the smaller the calculated dead zone threshold. Use the dead zone threshold as the noise reduction dead zone threshold for the next data processing cycle.
6. The method for identifying the composition of urinary tract stones based on image recognition according to claim 1, characterized in that, The specific process for obtaining the classification probabilities of the core components and the shell components includes: The core area mask is multiplied by the urinary stone image to obtain the core feature pixel matrix. The surface shell region mask is multiplied with the urinary stone image to obtain the shell feature pixel matrix; The core feature pixel matrix and the shell feature pixel matrix are respectively input into two independent parallel feature extraction layers of a pre-defined convolutional neural network model. After being mapped by a fully connected layer and a Softmax function, the classification probabilities of the core component and the shell component are output respectively.
7. The method for identifying the composition of urinary tract stones based on image recognition according to claim 1, characterized in that, The specific calculation formula for the preset first exponential function is as follows: ,in, This indicates the first core exposure weight. Represents the natural constant. Indicates the percentage of area exposed. The preset noise reduction dead zone threshold, This represents the preset weight gain coefficient. .
8. The method for identifying the composition of urinary tract stones based on image recognition according to claim 1, characterized in that, The specific process of obtaining the first closed gradient loop includes: Obtain the pixel coordinate system of the image of urinary stones; The pixel coordinates of all extracted first discrete edge points in the pixel coordinate system; For each first discrete edge point, using its pixel coordinates as the center, count the number of other first discrete edge points contained in the neighborhood window with a preset pixel radius to obtain the local neighborhood density. Determine whether the local neighborhood density is greater than or equal to a preset edge continuity threshold; If yes, the first discrete edge point is determined to be a real edge of the physical fault and is retained; otherwise, the first discrete edge point is determined to be an isolated noise point and is removed. All retained first discrete edge points are then collected to obtain a purified discrete edge point set. A morphological closing operation is performed on the set of discrete edge points to be purified using morphological operation structuring elements of a preset size, resulting in a closed connected region. Extract the outer edge contour of the closed connected region as the first closed gradient loop.
9. A system for identifying the composition of urinary tract stones based on image recognition, characterized in that, include: Data acquisition module: used to acquire images of urinary stones collected by endoscopic equipment, and obtain a global contour mask representing the location of the target stone through a preset semantic segmentation algorithm; Closed gradient loop processing module: It is used to perform the second-order Laplacian differential operation in the pixel area corresponding to the global contour mask, obtain the second-order gradient matrix, extract the zero-crossing points whose local gradient magnitude is greater than the first preset gradient threshold as the first discrete edge points, and connect the first discrete edge points through morphological closing operation to construct the first closed gradient loop representing the physical fault edge of the target stone. Mask processing module: used to divide the global contour mask into an inner core region mask located inside the first closed gradient loop and a surface shell region mask located outside the first closed gradient loop, with the first closed gradient loop as the boundary; Classification probability processing module: used to extract the pixel regions corresponding to the inner core area mask and the outer shell area mask, and input them into the preset convolutional neural network model respectively to obtain the classification probability of the core component and the classification probability of the shell component; Proportion processing module: used to calculate the ratio of the pixel area of the internal core area mask to the total pixel area of the global contour mask, to obtain the area exposure proportion; Weighting module: Used to determine whether the area exposure ratio is greater than the preset noise reduction dead zone threshold. If so, the first core exposure weight is calculated according to the area exposure ratio and the preset first exponential function. The identification output module is used to weight the classification probability of the core component using the first core exposure weight, and to weight the classification probability of the shell component using the complement of the first core exposure weight. The weighted sum of the two is calculated to obtain the first component identification ratio of the urinary stone image and output it.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-8.