Self-adaptive segmentation method and system for lesion area of seminal vesicle endoscope image
Through synchronous acquisition and posture correction, geometric deviations in laparoscopic images are eliminated, and resampling is adaptively adjusted and lesion segmentation network is optimized to generate a continuous boundary model, which solves the resolution imbalance and artifact problems of lesion areas in laparoscopic images, and realizes real-time precise segmentation and treatment planning of lesion boundaries.
Patent Information
- Application Number
- CN202510779499.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-12
AI Technical Summary
The prior art adaptive segmentation method of lesion areas in laparoscopic images cannot effectively suppress geometric deviations and resolution imbalances caused by thick layer sampling, affecting the continuity and accuracy of lesion boundaries, and leading to errors in biopsy positioning and treatment dose planning.
The geometric bias of thick-layer sampling is eliminated through synchronous acquisition and attitude correction, and the resampling strategy is adaptively adjusted using key geometric features, combined with smooth regularity and geometric constraints to optimize the lesion segmentation network, generate a continuous boundary model, and superimpose the lesion mask to the image frame stream in real time.
Achieve the continuity and geometric accuracy of the lesion boundary within the strict time window, enhance the operator's perception of small pathological changes, inhibit motion blur and spot artifacts, and ensure the accuracy of biopsy path planning and photodynamic dose scheduling.
Smart Images

Figure CN120298272A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical image processing, and more particularly, to a method and system for adaptively segmenting lesion regions for seminal vesicle endoscope images. Background Art
[0002] Endoscope images provide real-time quantitative support in the detection of seminal vesicle lesions: when the operator advances the lens along the long axis of the seminal vesicle, in order to reduce the examination time, thick-layer transverse sampling is often used to continuously obtain video frames and construct an approximate three-dimensional view during the operation, hoping to quickly lock the positions of congestion, fibrosis or micro-nodules with the help of an adaptive segmentation mask, and then guide the biopsy needle approach and the trajectory of the energy knife. Such scenarios pose high requirements for the accuracy of three-dimensional reconstruction and the integrity of the lesion boundary, because measurement errors directly affect the sampling depth and treatment dose.
[0003] If the thick-layer sampling has an angle with the long axis of the seminal vesicle, it will form anisotropic voxels with a much higher in-plane resolution than the inter-layer resolution. The interpolation algorithm needs to splice the curved surface over a long distance, and the inter-layer error accumulates at the edge and appears as serrated artifacts. After receiving the distorted data, the adaptive segmentation network shows faults and holes, and the volume deviation of the lesion expands significantly, and the biopsy positioning and photodynamic dose planning shift accordingly. The method for adaptively segmenting lesion regions for seminal vesicle endoscope images must suppress such artifacts within a strict time window, otherwise the real-time navigation cannot maintain reliability.
[0004] In order to solve the above problems, a technical solution is provided now. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present invention provide a method and system for adaptively segmenting lesion regions for seminal vesicle endoscope images. By synchronously collecting and posture correcting to eliminate the geometric deviation caused by thick-layer sampling, and then using key geometric features to adaptively adjust the resampling strategy, effectively weakening the inter-layer artifacts and resolution imbalance problems. Further optimizing the lesion segmentation network through smoothing regularization and geometric constraints to ensure the continuity and geometric accuracy of the lesion boundary. Finally, dynamically superimposing the accurate lesion mask on the real-time frame stream to provide a quantitative basis for biopsy path planning and photodynamic dose scheduling; completed within a strict time window, outputting smooth and continuous images, enhancing the operator's perception ability of minor pathological changes, while adapting to a variety of endoscopic devices, suppressing motion blur and spot artifacts, and keeping the lesion details clear, so as to solve the problems proposed in the above background art.
[0006] To achieve the above object, the present invention provides the following technical solutions: A method for adaptively segmenting lesion regions for seminal vesicle endoscope images, characterized by including the steps of: S1: The acquisition end synchronously obtains thick-layer transverse frames and pose matrices, and writes the frame sequence together with the serial number-pose mapping table into the buffer; S2: Inversely deduce the cross-section tilt angle based on the pose matrix, construct an affine correction operator, align the coordinate system of each frame to the transverse reference plane, and output a sequence of corrected frames; S3: Extract two types of key geometric features in the sequence of corrected frames that reflect layer-wise proportional imbalance and contour continuity, fuse the feature results to form a comprehensive consistency index; when the index meets the standard, perform block anisotropic compensation resampling, otherwise perform cubic spline resampling, and output an isotropic volume data stack; S4: Apply slice smoothing regularization to the isotropic volume data stack, and fine-tune the lesion segmentation network in combination with the surface normal similarity and curvature penalty strategies to generate a continuous boundary model; S5: Apply the continuous boundary model to the real-time corrected frame stream, and stack the non-sectioned lesion masks onto the display channel according to the serial number-pose mapping table.
[0007] In a preferred embodiment, step S1 includes the following: The acquisition end synchronously obtains video frames and their corresponding transformation matrices through thick-layer transverse sampling. The video frames are cross-sectional images intercepted at different positions when the lens advances along the long axis of the seminal vesicle during seminal vesicle endoscopy. The transformation matrix describes the position and orientation of the lens in three-dimensional space; bind the video frames and the transformation matrices through timestamp matching to ensure their time consistency; arrange the video frames in the acquisition order as a frame sequence, and assign a unique serial number to each frame, constructing a serial number-pose mapping table in the form of a key-value pair of the serial number and the transformation matrix; store the frame sequence and the serial number-pose mapping table in the cache.
[0008] In a preferred embodiment, step S2 includes the following: Extract the rotation matrix of each frame according to the transformation matrix in the serial number-pose mapping table, calculate the angle between the lens optical axis direction vector and the global longitudinal axis direction vector to determine the cross-section tilt angle; construct an affine correction operator according to the cross-section tilt angle, correct the cross-section direction through the rotation matrix and retain the translation vector to maintain the spatial position; apply the affine correction operator to each frame in the frame sequence for coordinate transformation, and calculate the pixel values of the corrected image using bilinear interpolation to generate a spatially consistent sequence of corrected frames.
[0009] In a preferred embodiment, step S3 further includes the following: The key geometric features include the global layer-wise anisotropic gradient difference and the global curvature continuity deviation. Normalize the global layer-wise anisotropic gradient difference and the global curvature continuity deviation and fuse them into a comprehensive consistency index; finally, based on the comparison between the comprehensive consistency index and the standard threshold, adaptively select conventional cubic spline resampling or block anisotropic compensation resampling to generate an isotropic volume data stack.
[0010] In a preferred embodiment, step S3 further includes the following: For adjacent frames in the correction frame sequence, calculate the layer-wise gradient by dividing the pixel value difference by the physical distance between layers and normalize it. At the same time, calculate the in-plane gradient magnitude for each frame and normalize it. Subsequently, calculate the logarithm of the ratio of the layer-wise gradient to the in-plane gradient magnitude as the layer-wise anisotropic gradient difference, and take the average of all adjacent frame pairs to generate the global layer-wise anisotropic gradient difference.
[0011] In a preferred embodiment, step S3 further includes the following: Extract the contour points of each frame through edge detection and calculate the local curvature. Match the contour point pairs of adjacent frames and calculate the exponential average of the curvature difference as the curvature continuity deviation. Take the average of all adjacent frame pairs to generate the global curvature continuity deviation.
[0012] In a preferred embodiment, step S4 includes the following: Apply a Gaussian smoothing filter to each slice of the isotropic volume data stack along the depth direction, calculate the smoothed regular loss by accumulating the second-order change rate, generate the smoothed regularized three-dimensional volume data through gradient descent, input the smoothed regularized three-dimensional volume data into a pre-trained lesion segmentation network to generate an initial segmentation mask, extract the lesion boundary surface, calculate the normal vector similarity of adjacent point pairs and the sum of squares of local curvatures, define the normal similarity loss and the curvature penalty loss, and combine them with the cross-entropy loss through weighted combination. Fine-tune the lesion segmentation network through gradient descent to generate an optimized segmentation mask, apply an isosurface extraction algorithm to the optimized segmentation mask to generate a triangular mesh model, and optimize it through Laplacian smoothing and the normal consistency loss accumulated by the complement of the dot product of adjacent patch normal vectors to generate a continuous boundary model.
[0013] In a preferred embodiment, step S4 includes the following: The second-order change rate is the acceleration rate of spatial change calculated through the difference between adjacent pixel values.
[0014] In a preferred embodiment, step S5 includes the following: For each frame in the thick transverse frame stream collected in real time, synchronously obtain the pose matrix and calculate the cross-sectional tilt angle, construct a real-time affine correction operator to align the real-time frame to the transverse reference plane, and generate a real-time correction frame stream; according to the spatial difference between the pose matrix of the real-time correction frame stream and the pose matrices of the training data recorded in the serial number-pose mapping table, match the closest training frame, calculate the relative pose transformation, and apply the relative pose transformation to the vertex set of the continuous boundary model to generate a real-time boundary model; generate a lesion mask by projecting the real-time boundary model onto a two-dimensional plane and filling it, and superimpose the lesion mask on the real-time correction frame to generate an enhanced display frame and send it to the display channel.
[0015] A lesion area adaptive segmentation system for seminal vesicle endoscope images, comprising: a data acquisition module, a pose correction module, a feature fusion module, a segmentation optimization module, and a real-time overlay module; Data acquisition module: The acquisition end synchronously acquires thick cross-sectional frames and pose matrices, and writes the frame sequence together with the serial number-pose mapping table into the buffer; Pose correction module: Based on the pose matrix, inversely deduce the cross-sectional tilt angle, construct an affine correction operator, align the coordinate system of each frame to the cross-sectional reference plane, and output the corrected frame sequence; Feature fusion module: Extract two types of key geometric features reflecting layer ratio imbalance and contour continuity from the corrected frame sequence, fuse the feature results to form a comprehensive consistency index; when the index reaches the standard, perform block anisotropic compensation resampling, otherwise perform cubic spline resampling, and output an isotropic volume data stack; Segmentation optimization module: Apply slice smoothing regularization on the isotropic volume data stack, and fine-tune the lesion segmentation network in combination with the surface normal similarity and curvature penalty strategies to generate a continuous boundary model; Real-time overlay module: Apply the continuous boundary model to the real-time corrected frame stream, and overlay the non-faulty lesion mask to the display channel according to the serial number-pose mapping table.
[0016] Technical effects and advantages of the lesion area adaptive segmentation method and system for seminal vesicle endoscope images of the present invention: The present invention eliminates geometric deviations caused by thick-layer sampling through synchronous acquisition and pose correction, then adaptively adjusts the resampling strategy using key geometric features, effectively weakens the problems of interlayer artifacts and resolution imbalance, further optimizes the lesion segmentation network through smoothing regularization and geometric constraints to ensure the continuity and geometric accuracy of the lesion boundary, and finally dynamically superimposes the accurate lesion mask on the real-time frame stream to provide a quantitative basis for biopsy path planning and photodynamic dose scheduling; the entire process is completed within a strict time window, outputs smooth and continuous images, enhances the operator's perception ability of minor pathological changes, adapts to a variety of endoscopic devices at the same time, suppresses motion blur and spot artifacts, keeps the lesion details clear, and provides efficient and accurate technical support for the diagnosis and treatment of seminal vesicle lesions. Brief Description of the Drawings
[0017] Figure 1 It is a schematic flow chart of the lesion area adaptive segmentation method for seminal vesicle endoscope images of the present invention.
[0018] Figure 2 It is a schematic structural diagram of the lesion area adaptive segmentation system for seminal vesicle endoscope images of the present invention. Detailed Embodiments
[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0020] Embodiment 1: Figure 1 An adaptive segmentation method for lesion regions facing seminal vesicle endoscopy images of the present invention is presented, including: S1: The acquisition end synchronously obtains thick-layer transverse frames and pose matrices, and writes the frame sequence together with the serial number-pose mapping table into the cache.
[0021] S2: According to the pose matrix, the cross-section tilt angle is inversely deduced, and an affine correction operator is constructed to align the coordinate system of each frame to the transverse reference plane, and a corrected frame sequence is output.
[0022] S3: Two key geometric features reflecting layer-wise proportional imbalance and contour continuity are extracted from the corrected frame sequence, and the feature results are fused to form a comprehensive consistency index; when the index reaches the standard, block anisotropic compensation resampling is performed, otherwise cubic spline resampling is performed, and an isotropic volume data stack is output.
[0023] S4: Slice smoothing regularization is applied to the isotropic volume data stack, and the lesion segmentation network is finely tuned in combination with the surface normal similarity and curvature penalty strategies to generate a continuous boundary model.
[0024] S5: The continuous boundary model is applied to the real-time corrected frame stream, and the non-slice lesion mask is superimposed on the display channel according to the serial number-pose mapping table.
[0025] During seminal vesicle endoscopy, doctors detect seminal vesicle lesions (such as congestion, fibrosis or micro-nodules) through endoscopic images to guide biopsy and treatment. Since seminal vesicle examination needs to be completed within a limited time, operators usually adopt thick-layer transverse sampling technology, advancing the lens along the long axis of the seminal vesicle, quickly collecting video frames and constructing an approximate three-dimensional view. However, due to the thick sampling layer and the angle with the long axis of the seminal vesicle, the inter-layer resolution is much lower than the in-plane resolution, forming anisotropic voxels. Such voxels generate jagged artifacts during three-dimensional reconstruction, especially at the lesion boundaries, affecting the accurate segmentation and positioning of the lesion contour, and directly reducing the accuracy of biopsy needle approach and treatment dose planning. To solve this problem, the present invention proposes an adaptive segmentation method for lesion regions facing seminal vesicle endoscopy images. By synchronously collecting thick-layer transverse frames and pose matrices and performing subsequent processing, geometric distortion is suppressed, and continuous output of the lesion contour is achieved, providing quantitative support for real-time navigation. Step S1, as the basis for data acquisition and preprocessing of the entire method, aims to ensure the data integrity and consistency for subsequent pose correction and resampling.
[0026] The purpose of step S1 is to synchronously obtain thick cross-sectional frames and pose matrices through the acquisition end during the seminal vesicle endoscopy examination, construct a frame sequence and a serial number-pose mapping table, and write them into the cache, providing a reliable data basis for subsequent steps. The following is a detailed description of the specific processing logic: Step S1 includes the following: S1.1, Data acquisition: During the seminal vesicle endoscopy examination, the acquisition end continuously obtains video frames in a thick cross-sectional sampling manner. The video frames are cross-sectional images intercepted at different positions when the lens advances along the long axis of the seminal vesicle. Each frame represents the two-dimensional image data of a certain cross-section of the seminal vesicle. For subsequent processing convenience, each frame is assigned a unique serial number and arranged in the acquisition order. At the same time, the acquisition end records the spatial pose information of each frame, describing the position and orientation of the lens in three-dimensional space. The spatial pose information is represented in the form of a transformation matrix, which contains a translation vector describing the position of the lens and a rotation matrix describing the orientation of the lens. Each group of transformation matrices corresponds one-to-one with the corresponding video frame, jointly describing the geometric position of the frame in space.
[0027] Acquiring video frames through thick cross-sectional sampling and recording spatial pose information provides the necessary data basis for subsequent spatial correction and three-dimensional reconstruction. Thick sampling can quickly obtain continuous image data, shorten the examination time, and improve efficiency. The recording of spatial pose information provides an accurate spatial reference for each frame, enabling subsequent steps to accurately restore the spatial relationship between video frames, suppressing geometric distortion caused by sampling angle deviation, and thus improving the usability and accuracy of the image data.
[0028] S1.2, Data synchronization: To ensure that the video frames and the corresponding spatial pose information are consistent in time, the acquisition end binds each frame of image with its corresponding transformation matrix through timestamp matching. Timestamp matching means that during the acquisition process, the generation time is recorded for each frame of image and transformation matrix respectively, and the corresponding relationship between the two is ensured by comparing the timestamps. This synchronization mechanism avoids data misalignment caused by acquisition delay or device response differences, ensuring that the spatial pose information of each frame completely matches its image content.
[0029] S1.3, Frame sequence and mapping table construction: The acquired video frames are arranged in chronological order to form a frame sequence. The frame sequence reflects the continuous image data obtained when the lens advances along the long axis of the seminal vesicle. At the same time, a unique serial number is assigned to each frame and associated with its corresponding transformation matrix to construct a serial number-pose mapping table. The serial number-pose mapping table is organized in the form of key-value pairs, where the key is the serial number of the video frame and the value is the corresponding transformation matrix. This structured design facilitates subsequent steps to quickly retrieve the spatial pose information according to the serial number of the video frame.
[0030] S1.4, Data writing to cache: Store the constructed frame sequence and the sequence number - pose mapping table into the cache. During the storage process, the frame sequence is arranged according to the acquisition order, and the sequence number - pose mapping table is organized in the form of key - value pairs to ensure the temporal consistency of data access. The cache, as a temporary storage unit, provides immediately available data support for subsequent processing.
[0031] Step S1 synchronously obtains the video frames of the thick - layer transverse sampling method and their corresponding transformation matrices through the acquisition end, constructs the frame sequence and the sequence number - pose mapping table, and finally stores them in the cache, ensuring that the spatial position of each frame of image can be accurately tracked. It effectively suppresses the geometric distortion caused by sampling angle deviation, creating conditions for high - precision lesion segmentation and three - dimensional reconstruction. The frame sequence and the sequence number - pose mapping table in the cache will be directly called by subsequent steps for back - calculating the cross - section tilt angle and coordinate system alignment.
[0032] Step S1 synchronously obtains the thick - layer transverse frames and pose matrices through the acquisition end, constructs the frame sequence and the sequence number - pose mapping table, and stores them in the cache. These data provide the basis for the original image and spatial positioning for subsequent processing, ensuring the spatial consistency of the image sequence in real - time navigation. However, due to the angle between the lens and the long axis of the seminal vesicle during the thick - layer sampling process, the acquired transverse frames are not completely perpendicular to the long axis of the seminal vesicle, forming anisotropic voxels and zigzag artifacts, which directly affect the three - dimensional reconstruction accuracy and the integrity of the lesion boundary. To solve this problem, step S2 focuses on back - calculating the cross - section tilt angle based on the pose matrix and performing coordinate system correction, outputting the corrected frame sequence, laying a geometric consistency foundation for the subsequent resampling in step S3 and lesion segmentation in step S4.
[0033] Step S2 includes the following: S2.1, Back - calculating the cross - section tilt angle During the process of back - calculating the cross - section tilt angle, first, use the transformation matrix recorded in the sequence number - pose mapping table to extract the rotation matrix corresponding to each frame. The rotation matrix describes the orientation of the lens in three - dimensional space, where the third - column vector represents the direction vector of the lens optical axis in the global coordinate system. Assume that the long axis of the seminal vesicle is approximately the longitudinal axis direction of the global coordinate system, that is, the up - down direction, and the transverse reference plane is defined as the horizontal plane perpendicular to the long axis of the seminal vesicle. Then, calculate the angle between the lens optical axis direction vector and the global longitudinal axis direction vector, defined as the cross - section tilt angle. Specifically, when calculating, first find the ratio of the projection component of the lens optical axis direction vector on the global longitudinal axis direction to the modulus of the lens optical axis direction vector to obtain the cosine value of the angle, and then determine the size of the cross - section tilt angle through the arccosine operation.
[0034] The purpose of the reverse thrust section tilt angle is to quantify the tilt degree of each frame's cross-section caused by the lens attitude deviation. In seminal vesicle endoscopy, the ideal cross-section should be perpendicular to the long axis of the seminal vesicle. However, in actual operation, there is an angle between the optical axis of the lens and the long axis of the seminal vesicle, resulting in the tilt of the collected cross-section and further causing geometric distortion. By accurately calculating the section tilt angle, key parameters can be provided for subsequent coordinate system correction. This quantification method ensures the accuracy of the correction process, effectively supports the subsequent steps to eliminate geometric distortion, and lays a foundation for three-dimensional reconstruction and lesion segmentation.
[0035] S2.2, construct an affine correction operator: In the process of constructing the affine correction operator, for the section tilt angle of each frame, a coordinate transformation operator is designed to correct the attitude deviation of the frame.
[0036] First, determine the direction of the rotation axis. By calculating the cross product of the lens optical axis direction vector and the global longitudinal axis direction vector, a vector perpendicular to the plane formed by the two is obtained, and this vector is the rotation axis. Then, according to the negative value of the section tilt angle (used to cancel the original tilt), a rotation matrix is generated to adjust the direction of the lens coordinate system to be parallel to the transverse reference plane. After that, this rotation matrix is combined with the translation vector of the transformation matrix in the serial number-pose mapping table to construct a complete affine correction operator, where the translation vector keeps the spatial position of the frame unchanged in the global coordinate system.
[0037] The purpose of constructing the affine correction operator is to eliminate the tilt of each frame's cross-section caused by the lens attitude deviation through coordinate transformation. The rotation matrix ensures that the cross-section direction is consistent with the transverse reference plane, and the retention of the translation vector avoids the position offset of the frame in space. This method can effectively correct the geometric distortion caused by the lens attitude and generate spatially consistent image data. The corrected frame sequence provides a reliable geometric basis for subsequent processing, helping to improve the accuracy of three-dimensional reconstruction and the accuracy of lesion segmentation.
[0038] S2.3, coordinate system alignment: In the process of coordinate system alignment, the corresponding affine correction operator is applied to each frame in the frame sequence for spatial transformation. Specifically, the two-dimensional image pixel points of each frame are regarded as points in three-dimensional space, assuming their depth values are zero. These points are rotated and translated through the affine correction operator to obtain the corrected three-dimensional coordinates, and then these coordinates are projected back to the two-dimensional plane. Since the transformed coordinate values are usually non-integers, the bilinear interpolation method is used to calculate the pixel values of the corrected image to ensure the retention of image details and quality. Finally, the cross-sections of each frame are spatially aligned to a unified transverse reference plane.
[0039] The purpose of coordinate system alignment is to eliminate the geometric distortion caused by the deviation of the lens sampling angle and generate a spatially consistent image sequence. Through precise coordinate transformation, the corrected frame sequence is unified on the transverse reference plane, eliminating the image misalignment caused by the difference in lens attitude. This spatial consistency significantly improves the geometric reliability of the frame sequence and provides support for subsequent resampling and lesion segmentation. The corrected image sequence can enhance the accuracy of 3D reconstruction and ensure the integrity and continuity of the lesion boundary.
[0040] Step S2 completes the spatial correction of the thick-layer transverse frame sequence through three sub-steps: back-calculating the cross-section tilt angle, constructing an affine correction operator, and coordinate system alignment. The corrected frame sequence eliminates the geometric inconsistency caused by the angle between the lens optical axis and the long axis of the seminal vesicle. In the scenario of adaptive segmentation of the lesion area in the seminal vesicle endoscopic image, this step ensures that the subsequent resampling is based on a unified transverse reference plane, thereby improving the balance of the layer ratio and the continuity of the contour. Finally, step S2 provides a high-quality geometric basis for generating a continuous boundary model for the lesion segmentation network, significantly enhancing the accuracy and reliability of the processing results.
[0041] In step S2, through pose correction, the cross-section tilt angle is back-calculated using the pose matrix and an affine correction operator is constructed to align the spatial coordinate system of the thick-layer transverse frame sequence to the transverse reference plane, and the corrected frame sequence is output. This process effectively eliminates the geometric distortion caused by the lens pose deviation and lays a foundation for subsequent 3D reconstruction in terms of spatial consistency. However, due to the inherently low interlayer resolution of thick-layer sampling, the corrected frame sequence still shows anisotropic voxels with a much higher in-plane resolution than the interlayer resolution. This resolution imbalance is prone to cause cumulative interlayer errors in 3D interpolation, especially forming jagged artifacts at the lesion boundary, thereby affecting the accuracy of the adaptive segmentation network. To solve this problem, step S3 aims to construct a comprehensive consistency index by extracting key geometric features reflecting the interlayer ratio imbalance and contour continuity, and adaptively select a resampling strategy according to this index to generate an isotropic voxel data stack, providing high-quality 3D data support for subsequent lesion segmentation.
[0042] Step S3 includes the following: S3.1, Extract the global interlayer anisotropic gradient difference: In the process of extracting the global interlayer anisotropic gradient difference, first, for adjacent frames in the corrected frame sequence, the interlayer gradient is calculated to characterize the change in pixel intensity between frames. The calculation method of the interlayer gradient is to subtract the pixel values at the same position in adjacent frames, and after obtaining the difference, divide it by the physical distance between adjacent frames for normalization to reflect the gradient change amplitude in the real space.
[0043] Next, for each frame in the corrected frame sequence, the in-plane gradient is calculated. Specifically, by taking the difference in pixel values in the horizontal and vertical directions, the horizontal gradient and the vertical gradient are obtained respectively. Then, the square roots of the sum of the squares of the horizontal gradient and the vertical gradient are calculated to obtain the in-plane gradient magnitude, and it is normalized by dividing by the in-plane pixel pitch.
[0044] Subsequently, the ratio of the out-of-plane gradient to the in-plane gradient magnitude is calculated, and the natural logarithm of this ratio is taken to amplify the difference between the two and stabilize the numerical range, obtaining the out-of-plane anisotropy gradient difference for each pair of adjacent frames.
[0045] Finally, the out-of-plane anisotropy gradient differences for all adjacent frame pairs in the corrected frame sequence are added up and averaged to generate the global out-of-plane anisotropy gradient difference.
[0046] The purpose of extracting the out-of-plane anisotropy gradient difference is to quantify the imbalance between the out-of-plane and in-plane resolutions in the corrected frame sequence. Thick layer sampling results in lower inter-layer resolution than in-plane resolution, making the out-of-plane gradient generally smaller than the in-plane gradient. This imbalance reduces the quality of 3D reconstruction. By calculating the ratio of the out-of-plane gradient to the in-plane gradient and taking the natural logarithm, the sensitivity to the resolution imbalance can be enhanced, thus accurately capturing its degree. This feature provides a key basis for forming a comprehensive consistency index for subsequent fusion features, helps to adaptively adjust the resampling strategy, and improves the resolution consistency and overall quality of 3D data.
[0047] For example, to help understanding, the global out-of-plane anisotropy gradient difference can be obtained in the following way: Input: Corrected frame sequence , where each frame is a corrected 2D image with a size of , and the pixel position is denoted as . Among them, represents the width of the image, and represents the height of the image.
[0048] Processing: Out-of-plane gradient calculation: For adjacent frames and , the out-of-plane gradient is calculated to characterize the change in pixel intensity between frames. Define the out-of-plane gradient as: ; where represents the pixel value of frame at position , and is the physical inter-layer distance between adjacent frames, which is used to normalize the gradient value to reflect the real-space change.
[0049] In-plane gradient calculation: For frame Apply the Sobel operator to calculate the horizontal gradient respectively and the vertical gradient , and then calculate the in-plane gradient magnitude : ; where is the in-plane pixel spacing, which is used to normalize the in-plane gradient.
[0050] Layer-wise anisotropic gradient difference: The layer-wise anisotropic gradient difference is used to quantify the imbalance in the ratio of the layer-wise to in-plane gradients. It is defined as the ratio of the two and then taking the logarithm to amplify the difference and stabilize the numerical range: ; where is a small positive number (e.g., ), to avoid a zero denominator; adding 1 to the logarithmic operation ensures a non-negative result.
[0051] Global calculation: For all adjacent frame pairs calculate , and take the average as the global layer-wise anisotropic gradient difference .
[0052] Output: The global layer-wise anisotropic gradient difference .
[0053] Purpose: Quantify the imbalance degree of the correction frame sequence in the layer-wise and in-plane resolutions, and provide a basis for the subsequent comprehensive consistency index.
[0054] S3.2, Extract the curvature continuity deviation: In the process of extracting the curvature continuity deviation, first apply the edge detection algorithm to each frame in the correction frame sequence to extract the set of points on the contour line. Subsequently, calculate the local curvature for each contour point based on the second-order difference of its adjacent points to characterize the degree of bending of the contour. The specific calculation method is to take the coordinates of the contour point and its adjacent points before and after, calculate the second-order difference and normalize it to obtain the local curvature value. Then, establish the correspondence between the contour points of adjacent frames through the nearest neighbor matching method, and calculate the difference in curvature values of the corresponding contour point pairs to obtain the curvature difference. Then, sum up the curvature differences of all corresponding contour point pairs and take the average, and then perform an exponential operation on this average and subtract 1 to amplify the significant curvature changes to generate the curvature continuity deviation for each pair of adjacent frames. Finally, sum up the curvature continuity deviations of all adjacent frame pairs in the correction frame sequence and take the average to generate the global curvature continuity deviation.
[0055] The extraction of curvature continuity deviation aims to evaluate the degree of contour continuity of the corrected frame sequence in the layer direction. In an ideal three-dimensional space, the lesion contour should exhibit continuous and smooth characteristics. However, thick-layer sampling may lead to discontinuous inter-layer contours, manifested as sudden changes in curvature values. By calculating the curvature differences between corresponding contour points in adjacent frames and performing exponential operations, the sensitivity to discontinuities can be enhanced, effectively quantifying the deviation degree of contour continuity. This feature provides a supplementary basis for forming a comprehensive consistency index for subsequent fusion features, ensuring that the resampling strategy can be optimized for contour continuity problems and improving the geometric consistency of three-dimensional data.
[0056] For example, the following method can be adopted to help understand the acquisition of curvature continuity deviation: Input: Corrected frame sequence .
[0057] Processing: Contour extraction: For each frame Apply the Canny edge detection algorithm to extract the set of contour lines , where are the contour point coordinates , is the frame 's total number of contour points.
[0058] Curvature calculation: For the points on the contour , calculate the local curvature based on the second-order difference approximation of adjacent points: ; where and are the adjacent points before and after . If it is a boundary point, unilateral difference adjustment is used.
[0059] Curvature continuity deviation: Between adjacent frames and , determine the corresponding point pairs by contour point matching (such as nearest neighbor matching). Calculate the curvature difference: ; The curvature continuity deviation is defined as the mean of the curvature differences of the corresponding point pairs and then taking the exponent to amplify significant changes: ; where is the number of matching point pairs, and the exponential operation minus 1 ensures that the result starts from zero.
[0060] Global calculation: For all adjacent frame pairs calculate , take the average value as the global curvature continuity deviation .
[0061] Output: Global curvature continuity deviation .
[0062] Purpose: Evaluate the profile continuity of the corrected frame sequence in the layer-up direction and provide supplementary basis for the comprehensive consistency index.
[0063] S3.3, Fuse features to form a comprehensive consistency index: In the process of fusing features to form a comprehensive consistency index, first perform min-max normalization on the global layer-wise anisotropic gradient difference and the global curvature continuity deviation to unify the dimension and numerical range of the two. Then, perform weighted fusion on the normalized global layer-wise anisotropic gradient difference and the global curvature continuity deviation to generate a comprehensive consistency index. This fusion process comprehensively considers the impacts of resolution imbalance and profile discontinuity.
[0064] S3.4, Adaptive resampling: In the process of adaptive resampling, first compare the comprehensive consistency index with a preset standard threshold to determine the resampling strategy to be adopted.
[0065] If the comprehensive consistency index is less than or equal to the standard threshold, it indicates good layer-wise consistency, and then conventional cubic spline resampling is adopted; otherwise, block anisotropic compensation resampling is adopted.
[0066] In conventional cubic spline resampling, based on the in-plane resolution, calculate the number of interpolation points required in the layer-up direction, and interpolate the corrected frame sequence through the cubic spline interpolation method to generate an isotropic volume data stack. In block anisotropic compensation resampling, divide the corrected frame sequence into multiple sub-blocks in the layer-up direction, calculate the local layer-wise anisotropic gradient difference and the local curvature continuity deviation for each sub-block respectively, and then generate a local comprehensive consistency index, and determine the local resampling rate according to the local comprehensive consistency index. Subsequently, perform local interpolation processing on each sub-block, and finally splice the interpolation results of all sub-blocks to generate a global isotropic volume data stack.
[0067] Adaptive resampling aims to dynamically select appropriate interpolation strategies based on comprehensive consistency indicators to optimize slice resolution and generate high-quality three-dimensional data. When the slice consistency is good, conventional cubic spline resampling can quickly generate isotropic volume data stacks; when the consistency is poor, block anisotropic compensation resampling can more finely handle resolution imbalance and contour discontinuity problems by locally adjusting the resampling rate. This feature improves the flexibility and accuracy of resampling, ensuring that the generated isotropic volume data stacks have high-quality geometric consistency and resolution uniformity, providing a reliable three-dimensional data foundation for subsequent lesion segmentation.
[0068] Step S3 constructs a comprehensive consistency index by extracting the layer-wise anisotropic gradient difference and curvature continuity deviation, and adaptively selects the resampling strategy based on the index to successfully generate an isotropic volume data stack. In the adaptive segmentation scenario of the lesion area of the seminal vesiculoscopic image, this step effectively improves the quality and consistency of the three-dimensional data by quantifying key geometric features and dynamically adjusting the processing method to address the problems of insufficient inter-layer resolution and artifacts caused by thick layer sampling. The generated isotropic volume data stack provides high-quality three-dimensional data support for the subsequent lesion segmentation network, ensuring the geometric consistency and continuity of the lesion boundary, thereby enhancing the accuracy of biopsy navigation and dose planning.
[0069] Step S3 constructs a comprehensive consistency index by extracting the layer-wise anisotropic gradient difference and curvature continuity deviation, and adaptively selects the resampling strategy based on the index to generate an isotropic volume data stack. This process effectively alleviates the problem of insufficient inter-layer resolution and artifacts caused by thick layer sampling, and provides a high-quality three-dimensional data foundation for subsequent lesion segmentation. However, relying solely on the resolution balance of isotropic volume data stacks cannot fully meet the needs of accurate segmentation of lesion boundaries, especially in the face of complex lesion morphology (such as congestion, fibrosis or micronodules) and noise interference in seminal vesiculoscopic images. The segmentation results are prone to faults or holes, affecting the accuracy of biopsy navigation and dose planning. Therefore, step S4 needs to further optimize the data smoothness and fine-tune the segmentation network on the isotropic volume data stack to generate a continuous and geometrically accurate lesion boundary model.
[0070] Step S4 includes the following contents: S4.1, applying slice smoothing regularization: During the application of slice smoothing regularization, first, for each slice along the depth direction of the isotropic volume data stack, a Gaussian smoothing filter is applied to reduce the influence of in-plane noise on subsequent lesion segmentation. The kernel size of the Gaussian smoothing filter is determined according to the in-plane resolution to balance the smoothing effect and detail preservation. Next, for the slices processed by the Gaussian smoothing filter, the second-order rate of change of pixel values in space is calculated, that is, the acceleration rate of spatial change is calculated through the difference between adjacent pixel values. Then, the sum of the squares of the second-order rates of change of all slices is accumulated and defined as the smoothing regularization loss, which is used to measure the smooth transition degree of pixel values between slices. After that, by repeatedly adjusting the pixel values of each slice in the isotropic volume data stack, the smoothing regularization loss is gradually reduced. This adjustment process is based on the optimization idea of gradient descent, and finally, the three-dimensional volume data after smoothing regularization is generated.
[0071] Through the Gaussian smoothing filter and the second-order rate of change constraint, the suppression of inter-slice artifacts and in-plane noise is achieved, thereby improving the smoothness and stability of the three-dimensional volume data. The Gaussian smoothing filter reduces noise interference by performing weighted averaging on pixel values; the sum of the squares of the second-order rates of change is used as the smoothing regularization loss to limit the sharp change of pixel values in space, ensure the smooth transition between slices, and reduce artifacts caused by thick-layer sampling. It provides stable input data for the subsequent lesion segmentation network, significantly improves the accuracy and continuity of the lesion segmentation results, and lays a reliable foundation for the subsequent steps.
[0072] S4.2, Fine-tuning the lesion segmentation network: During the fine-tuning of the lesion segmentation network, first, the three-dimensional volume data after smoothing regularization is input into the pre-trained lesion segmentation network to generate an initial segmentation mask for marking the lesion area and the background area. Then, the surface of the lesion boundary is extracted from the initial segmentation mask, and the normal vector of each point on this surface is calculated. Subsequently, for adjacent point pairs on the surface, the similarity between their normal vectors is calculated. Specifically, the complement of the dot product of the normal vectors is calculated and defined as the normal similarity loss to measure the continuity of normal vectors in adjacent regions. At the same time, the local curvature of each point on the surface is calculated, and the curvature value is determined by the position change of adjacent points. The sum of the squares of all curvature values is accumulated and defined as the curvature penalty loss to limit the sharp change on the boundary surface. After that, the cross-entropy loss calculated based on the labeled data is combined with the normal similarity loss and the curvature penalty loss with weights and defined as the total loss. Finally, by repeatedly adjusting the parameters of the lesion segmentation network, the total loss is gradually reduced. This optimization process is based on the idea of gradient descent, and the fine-tuned lesion segmentation network and the optimized segmentation mask are generated.
[0073] Geometric constraints are introduced through normal similarity loss and curvature penalty loss to optimize the smoothness and continuity of the lesion boundary. The normal similarity loss reduces the discontinuity of the boundary surface by restricting the difference in normal vectors of adjacent regions; the curvature penalty loss smooths the boundary surface and reduces jagged artifacts by constraining the change in curvature values. The geometric accuracy of the segmentation result is improved, effectively reducing faults and holes in the segmentation result in the complex lesion morphology and noise interference scenarios of the seminal vesicle endoscopy images, providing a high-quality segmentation basis for subsequent generation of a continuous boundary model.
[0074] S4.3, Generate a continuous boundary model: In the process of generating a continuous boundary model, first, the marching cubes algorithm is applied to the optimized segmentation mask to generate a triangular mesh model of the lesion area, which consists of a vertex set and a face set. Then, Laplacian smoothing is performed on the triangular mesh model. By iteratively updating the vertex positions, each vertex is moved towards the average position of its adjacent vertices to smooth the surface and reduce jagged artifacts. Subsequently, the normal vector of each face in the triangular mesh model is calculated, and the complement of the dot product of the normal vectors of adjacent faces is calculated and accumulated to define the normal consistency loss to measure the continuity of the surface normal. After that, by adjusting the vertex positions, the normal consistency loss is gradually reduced. This optimization process is based on the idea of minimization, and finally, an optimized continuous boundary model is generated.
[0075] Through marching cubes extraction, Laplacian smoothing, and normal consistency adjustment, the geometric accuracy and continuity of the lesion boundary are ensured. The marching cubes algorithm converts the segmentation mask into a triangular mesh model. Laplacian smoothing smooths the surface by averaging the vertex positions. The normal consistency loss further improves the surface quality by constraining the difference in normal vectors of adjacent faces. Provide a high-quality boundary model for real-time navigation, ensuring the smoothness and continuity of the lesion contour, thus significantly improving the accuracy of biopsy navigation and dose planning.
[0076] Step S4 realizes the optimization of data smoothness and lesion boundary accuracy on the isotropic volume data stack through three sub-steps: applying slice smoothing regularization, fine-tuning the lesion segmentation network, and generating a continuous boundary model. Finally, a continuous boundary model is generated. In the adaptive segmentation scenario of the lesion area in the seminal vesicle endoscopy images, applying slice smoothing regularization improves data stability by suppressing inter-slice artifacts, fine-tuning the lesion segmentation network optimizes the continuity of the lesion boundary through geometric constraints, and generating a continuous boundary model ensures boundary accuracy through surface smoothing. These steps together reduce faults and holes in the segmentation result, ensure the geometric accuracy of the lesion contour, provide a reliable basis for subsequent real-time correction of frame flow superposition without-fault lesion masks, and significantly improve the accuracy of biopsy navigation and dose planning.
[0077] The above-mentioned step S4 fine-tunes the lesion segmentation network by applying slice smoothing regularization on the isotropic body data stack and combining the surface normal similarity and curvature penalty strategies to generate a continuous boundary model. This model has high-quality geometric consistency and boundary continuity, laying a foundation for the accurate segmentation of lesion contours. However, in the real-time clinical scenario of cystoscope navigation, the static continuous boundary model cannot directly meet the dynamic operation requirements. The operator needs to accurately superimpose the lesion mask on each frame in the real-time video frame stream obtained by advancing the lens to achieve dynamic guidance for the biopsy needle approach and the trajectory of the energy knife. Therefore, step S5 needs to apply the continuous boundary model to the real-time corrected frame stream, and complete the accurate superimposition of the non-slice lesion mask in combination with the serial number-pose mapping table, providing real-time quantitative support for biopsy navigation and dose planning.
[0078] Step S5 includes the following: S5.1, Generation of real-time corrected frame stream: The processing logic for generating the real-time corrected frame stream first synchronously obtains the corresponding pose matrix for each frame in the thick transverse frame stream collected in real time, which is used to record the spatial pose of the lens at that moment. Next, the cross-section tilt angle is deduced backward using the pose matrix. Specifically, the degree of cross-section tilt is determined by calculating the angle difference between the normal vector corresponding to the pose matrix and the normal vector of the preset transverse reference plane. Then, a real-time affine correction operator is constructed, and the geometric position of the real-time frame is adjusted to be consistent with the transverse reference plane through spatial rotation and translation operations, thereby generating a corrected frame. Finally, all the corrected frames are organized in time series to form a real-time corrected frame stream.
[0079] Using the spatial information of the pose matrix, the cross-section tilt is quantified by the angle difference of the normal vectors, and then the geometric deviation is eliminated through rotation and translation operations. The spatial correction of the real-time frame is realized through the pose matrix to ensure the geometric alignment between the real-time frame and the training data. Using the angle difference of the normal vectors to quantify the pose deviation is to accurately describe the tilt state of the real-time frame, while the real-time affine correction operator eliminates the geometric distortion through rotation and translation to provide a unified spatial reference.
[0080] S5.2, Mapping of the continuous boundary model: The processing logic of the continuous boundary model mapping first targets each frame in the real-time correction frame stream and matches the closest frame in the training data according to its pose matrix and the pre-constructed sequence-pose mapping table. The specific matching process determines the optimal matching frame by comparing the spatial differences between the real-time pose matrix and the pose matrices of each frame in the training data, where the spatial difference is represented by the square root of the sum of the squares of the differences of each component of the pose matrix. Then, the relative pose transformation is calculated. Specifically, by multiplying the real-time pose matrix by the inverse matrix of the optimal matching frame's pose matrix, the spatial transformation relationship from the training frame coordinate system to the real-time frame coordinate system is obtained. Then, the vertex set of the continuous boundary model is applied with this relative pose transformation to generate the mapped vertex set, and combined with the original patch set, a real-time boundary model spatially aligned with the real-time frame is generated.
[0081] The matching degree is quantified by the spatial differences of the pose matrix, and the coordinate system transformation is realized through matrix multiplication, and finally the spatial position of the boundary model is adjusted. The dynamic adjustment of the continuous boundary model is realized through pose matching and relative transformation to ensure the geometric consistency between the lesion boundary and the real-time frame. Using spatial differences to quantify the matching accuracy is to ensure the accuracy of the optimal matching frame, and the relative pose transformation realizes precise mapping through matrix operations to maintain the spatial correspondence of the boundary model. Significantly enhance the real-time performance and reliability of navigation, providing an accurate spatial basis for subsequent lesion mask superposition.
[0082] S5.3, Non-slice lesion mask superposition: The processing logic of non-slice lesion mask superposition first targets each frame in the real-time correction frame stream and generates a lesion mask according to the real-time boundary model. The specific process projects the real-time boundary model onto a two-dimensional plane and fills its internal area to generate a binary mask for marking the lesion area and the background area. Then, the generated lesion mask is superimposed on the real-time correction frame to generate an enhanced display frame. Specifically, by applying pseudo-color highlighting in the lesion area and retaining the original gray value in the background area to maintain the contrast. Finally, the enhanced display frame is sent to the display channel to realize the dynamic visualization of the lesion area.
[0083] The calculation idea is to generate an accurate mask through geometric projection and area filling, and then enhance the visualization effect through color differentiation. The accurate generation of the lesion mask is realized through projection and filling, and the visual recognition of the lesion area is improved through pseudo-color highlighting. Using projection and filling to generate the mask is to ensure the geometric consistency between the mask and the real-time boundary model, and pseudo-color highlighting to enhance visualization is to provide intuitive lesion localization information. Significantly improve the accuracy of the biopsy needle approach and the energy knife trajectory, providing real-time and clear guidance for clinical operations.
[0084] Step S5 dynamically applies the continuous boundary model to the real-time corrected frame stream through three sub-steps: real-time corrected frame stream generation, continuous boundary model mapping, and non-slice lesion mask superposition. It precisely superimposes the lesion mask based on the serial number-pose mapping table, and finally generates an enhanced display frame stream. In the scenario of adaptive segmentation of the lesion area in seminal vesicle endoscopy images, real-time corrected frame stream generation ensures the geometric alignment of real-time frames with training data. Continuous boundary model mapping dynamically adjusts the boundary model through pose matching. Non-slice lesion mask superposition provides an intuitive visualization effect through projection and pseudo-color highlighting. These sub-steps jointly ensure the spatial consistency and boundary continuity of the lesion contour in dynamic navigation, providing real-time and accurate quantitative guidance for biopsy needle access and energy knife trajectory, and significantly improving the reliability and precision of clinical operations.
[0085] Embodiment 2: Figure 2 An adaptive segmentation system for the lesion area of seminal vesicle endoscopy images according to the present invention is given, including: a data acquisition module, a pose correction module, a feature fusion module, a segmentation optimization module, and a real-time superposition module.
[0086] Data acquisition module: The acquisition end synchronously obtains thick-layer cross-sectional frames and pose matrices, and writes the frame sequence together with the serial number-pose mapping table into the cache.
[0087] Pose correction module: According to the pose matrix, the cross-section tilt angle is inversely deduced, an affine correction operator is constructed, and the coordinate system of each frame is aligned to the cross-sectional reference plane, and a corrected frame sequence is output.
[0088] Feature fusion module: Two types of key geometric features reflecting layer-wise ratio imbalance and contour continuity are extracted from the corrected frame sequence, and the feature results are fused to form a comprehensive consistency index; when the index reaches the standard, block anisotropic compensation resampling is performed, otherwise cubic spline resampling is performed, and an isotropic volume data stack is output.
[0089] Segmentation optimization module: Slice smoothing regularization is applied to the isotropic volume data stack, and the lesion segmentation network is fine-tuned in combination with the surface normal similarity and curvature penalty strategies to generate a continuous boundary model.
[0090] Real-time superposition module: The continuous boundary model is applied to the real-time corrected frame stream, and the non-slice lesion mask is superimposed on the display channel according to the serial number-pose mapping table.
[0091] The above formulas are all dimensionless and take their numerical calculations. The formulas are obtained by software simulation of a large amount of collected data to get a formula closest to the real situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0092] It should be noted that the system of the present invention can be deployed on the device itself to achieve embedded applications, or can also run on a PC or other terminal with a user interface, so as to meet various hardware environments and usage requirements.
[0093] Only some exemplary embodiments of the present invention have been described above by way of illustration. Without doubt, for those of ordinary skill in the art, various different ways can be used to modify the described embodiments without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the protection scope of the claims of the present invention.
[0094] It should be noted that in this text, if there are relational terms such as first and second, they are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0095] As described above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, and all should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An adaptive segmentation method for lesion regions in seminal vesicle endoscopy images, characterized in that Including the steps: S1: The acquisition end synchronously obtains thick-layer cross-sectional frames and pose matrices, and writes the frame sequence together with the serial number-pose mapping table into the cache; S2: Based on the pose matrix, inversely deduce the cross-section tilt angle, construct an affine correction operator, align the coordinate system of each frame to the cross-sectional reference plane, and output the corrected frame sequence; S3: Extract two types of key geometric features in the corrected frame sequence that reflect layer-wise proportional imbalance and contour continuity, and fuse the feature results to form a comprehensive consistency index; when the index reaches the standard, perform block anisotropic compensation resampling, otherwise perform cubic spline resampling, and output an isotropic volume data stack; S4: Apply slice smoothing regularization on the isotropic volume data stack, and fine-tune the lesion segmentation network in combination with the surface normal similarity and curvature penalty strategies to generate a continuous boundary model; S5: Apply the continuous boundary model to the real-time corrected frame stream, and superimpose the non-faulty lesion mask to the display channel according to the serial number-pose mapping table.
2. The adaptive segmentation method for lesion regions oriented to seminal vesicle endoscope images according to claim 1, wherein Step S1 includes the following: The acquisition end synchronously obtains video frames and their corresponding transformation matrices through thick-layer cross-sectional sampling. The video frames are cross-sectional images intercepted at different positions when the lens advances along the long axis of the seminal vesicle during seminal vesiculoscopy. The transformation matrix describes the position and orientation of the lens in three-dimensional space; bind the video frames and the transformation matrix through timestamp matching to ensure their time consistency; arrange the video frames in the acquisition order as a frame sequence, and assign a unique serial number to each frame, and construct a serial number-pose mapping table in the form of a key-value pair between the serial number and the transformation matrix; store the frame sequence and the serial number-pose mapping table in the cache.
3. The method for adaptively segmenting a lesion area for seminal vesicle endoscopy images according to claim 2, wherein, Step S2 includes the following: Extract the rotation matrix of each frame according to the transformation matrix in the serial number-pose mapping table, calculate the angle between the lens optical axis direction vector and the global longitudinal axis direction vector to determine the cross-section tilt angle; construct an affine correction operator according to the cross-section tilt angle, correct the cross-sectional direction through the rotation matrix and retain the translation vector to maintain the spatial position; apply the affine correction operator to each frame in the frame sequence for coordinate transformation, and use bilinear interpolation to calculate the pixel values of the corrected image to generate a spatially consistent corrected frame sequence.
4. The method for adaptively segmenting a lesion area for seminal vesicle endoscope images according to claim 3, wherein Step S3 includes the following: The key geometric features include the global layer-wise anisotropic gradient difference and the global curvature continuity deviation. After normalizing the global layer-wise anisotropic gradient difference and the global curvature continuity deviation, they are fused into a comprehensive consistency index; finally, based on the comparison between the comprehensive consistency index and the standard threshold, adaptively select conventional cubic spline resampling or block anisotropic compensation resampling to generate an isotropic volume data stack.
5. The method for adaptively segmenting a lesion area for seminal vesicle endoscope images according to claim 4, wherein Step S3 also includes the following: For adjacent frames in the corrected frame sequence, calculate the layer-wise gradient by dividing the pixel value difference by the physical distance between layers and normalize it. At the same time, calculate the in-plane gradient amplitude for each frame and normalize it. Then calculate the logarithm of the ratio of the layer-wise gradient to the in-plane gradient amplitude as the layer-wise anisotropic gradient difference, and take the average value of all adjacent frame pairs to generate the global layer-wise anisotropic gradient difference.
6. The method for adaptively segmenting a lesion area for seminal vesicle endoscope images according to claim 4, wherein Step S3 also includes the following: Extract the contour points of each frame through edge detection and calculate the local curvature, match the contour point pairs of adjacent frames and calculate the exponential average of the curvature difference as the curvature continuity deviation, and take the average value of all adjacent frame pairs to generate the global curvature continuity deviation.
7. The method for adaptively segmenting a lesion area for seminal vesicle endoscopic images according to claim 6, wherein Step S4 includes the following: Apply a Gaussian smoothing filter to each slice of the isotropic volume data stack along the depth direction, calculate the smoothed regularization loss of the accumulated second-order change rate, generate the three-dimensional volume data after smoothed regularization through gradient descent, input the three-dimensional volume data after smoothed regularization into the pre-trained lesion segmentation network to generate the initial segmentation mask, extract the lesion boundary surface, calculate the normal vector similarity of adjacent point pairs and the squared accumulation of local curvature, define the normal similarity loss and the curvature penalty loss, combine them with the cross-entropy loss through weighted combination, fine-tune the lesion segmentation network through gradient descent to generate the optimized segmentation mask, apply the isosurface extraction algorithm to the optimized segmentation mask to generate a triangular mesh model, and optimize it through Laplacian smoothing and the normal consistency loss of the complementary accumulation of the dot product of adjacent patch normal vectors to generate a continuous boundary model.
8. The method for adaptively segmenting a lesion area for seminal vesicle endoscope images according to claim 7, characterized in that Step S4 includes the following: The second-order change rate is the acceleration rate of spatial change calculated through the difference between adjacent pixel values.
9. The method for adaptively segmenting a lesion area for seminal vesicle endoscope images according to claim 7, wherein Step S5 includes the following: For each frame in the thick cross-sectional frame stream collected in real time, synchronously obtain the pose matrix and calculate the cross-sectional tilt angle, construct a real-time affine correction operator to align the real-time frame to the cross-sectional reference plane, and generate a real-time corrected frame stream; according to the spatial difference between the pose matrix of the real-time corrected frame stream and the pose matrix of the training data recorded in the sequence-number-pose mapping table, match the closest training frame, calculate the relative pose transformation, and apply the relative pose transformation to the vertex set of the continuous boundary model to generate a real-time boundary model; generate a lesion mask by projecting the real-time boundary model onto a two-dimensional plane and filling it, and superimpose the lesion mask on the real-time corrected frame to generate an enhanced display frame and send it to the display channel.
10. A lesion area adaptive segmentation system for seminal vesicle endoscope images, which is used to implement the lesion area adaptive segmentation method for seminal vesicle endoscope images according to any one of claims 1-9, characterized in that, Including: A data acquisition module, a pose correction module, a feature fusion module, a segmentation optimization module, and a real-time superposition module; Data acquisition module: The acquisition end synchronously obtains the thick cross-sectional frames and the pose matrix, and writes the frame sequence together with the sequence-number-pose mapping table into the cache; Pose correction module: Inversely deduce the cross-sectional tilt angle based on the pose matrix, construct an affine correction operator, align the coordinate system of each frame to the cross-sectional reference plane, and output the corrected frame sequence; Feature fusion module: Extract two types of key geometric features reflecting layer-wise proportional imbalance and contour continuity in the corrected frame sequence, fuse the feature results to form a comprehensive consistency index; when the index reaches the standard, perform block anisotropic compensation resampling, otherwise perform cubic spline resampling, and output the isotropic volume data stack; Segmentation optimization module: Apply slice smoothing regularization to the isotropic volume data stack, and fine-tune the lesion segmentation network in combination with the surface normal similarity and curvature penalty strategies to generate a continuous boundary model; Real-time superposition module: Apply the continuous boundary model to the real-time corrected frame stream, and superimpose the non-slice lesion mask onto the display channel according to the sequence-number-pose mapping table.
Citation Information
Patent Citations
Image segmentation method, computer equipment and storage medium
CN113487536A
Lung medical CT (Computed Tomography) image segmentation and classification device and equipment
CN116703901A
Medical equipment optical system calibration method and system based on image processing
CN119887935A
Label-free adaptive CT super-resolution reconstruction method, system and device based on generative network
US20240169610A1
Cited By
Video synchronous acquisition method and device based on optical far image
CN121000964A
Pancreatic cancer and breast cancer early imaging diagnosis method based on multi-modal comparative learning
CN121122651A
Hysteroscope focus segmentation quantification method and system based on deep learning
CN121883515A
A Deep Learning-Based Method and System for Hysteroscopic Lesion Segmentation and Quantification
CN121883515B
