A method for screening urinary system tumors based on frame segment stabilization and gray scale enhancement features
Patent Information
- Application Number
- CN202610847639.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-08-28
AI Technical Summary
[0003]现有技术在实际筛查中依赖人工阅片方式对医学影像进行逐帧观察,受限于医师主观经验与视觉判读能力,在病灶边界模糊或图像质量波动较大时容易出现可疑区域漏判或误标的情况,尤其在影像序列中帧间差异显著或存在灰度突变时难以稳定获取解剖结构的统一参照,导致定位精度下降,图像间缺乏一致性基础也使得时间序列中病灶变化趋势难以准确识别,最终影响筛查结果的系统性与准确度,在面对大批量多帧影像数据时更易出现效率低下与结果偏差的问题
[0014]与现有技术相比,本发明的优点和积极效果在于:
Smart Images

Figure CN122657094A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image recognition technology, and in particular to a method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features. Background Technology
[0002] The field of medical image recognition technology mainly involves the acquisition, preprocessing, feature extraction, and discrimination output of medical image data such as ultrasound, CT, and MRI images. Its core aspects include standardized image data processing, lesion region localization, tissue structure differentiation, and classification based on image features. Typically, grayscale normalization, noise reduction and enhancement, edge and texture feature extraction, morphological feature calculation, and pattern recognition discrimination methods based on training samples are used to identify and label target lesions. Traditional precise screening methods for urinary tract tumors target organs such as the kidneys, ureters, bladder, and prostate. The need for tumor screening in the urinary system relies on urinary tract-related medical imaging to identify suspected lesions and assess risks. Traditional methods for identifying suspicious lesions related to urinary tract tumors from medical images and forming screening results typically involve a combination of imaging examination results and manual image review. This includes physicians observing and comparing urinary tract ultrasound, CT, or MRI images layer by layer, marking suspicious lesions based on imaging interpretation criteria such as changes in mass density, signal intensity differences, boundary morphology, enhancement patterns, and mass effect, and forming screening conclusions by combining key points of image staging and risk grading.
[0003] Current technologies rely on manual image reading to examine medical images frame by frame in actual screening. This is limited by the subjective experience and visual interpretation ability of physicians. When the boundaries of lesions are blurred or the image quality fluctuates greatly, suspicious areas are easily missed or mislabeled. In particular, when there are significant differences between frames or gray-scale abrupt changes in the image sequence, it is difficult to obtain a consistent reference for anatomical structures, which leads to a decrease in positioning accuracy. The lack of consistency between images also makes it difficult to accurately identify the trend of lesion changes in the time series, ultimately affecting the systematicness and accuracy of the screening results. When faced with a large amount of multi-frame image data, it is more likely to cause problems of low efficiency and result deviation. Summary of the Invention
[0004] To address the technical problems existing in the prior art, embodiments of the present invention provide a method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features, comprising the following steps: S1: Calculate the grayscale difference between adjacent frames in the kidney region of the enhanced urinary system image sequence. Based on the number of jump pixels, mark the image frames whose grayscale difference exceeds the set standard as abnormal. Record the continuous image frame segments within the stable range and generate a set of stable frame segment marking results. S2: Extract the kidney edge gradient from the stable frame segment labeling result set, sort and identify the frame with the lowest gradient, label the kidney structure boundary coordinates and gray level distribution, and generate a kidney anatomy reference frame image template. S3: Based on the reference frame image template of the kidney anatomy, locate the contralateral cortex of the kidney in the enhanced urinary system image sequence, extract the average gray value of the contralateral cortex of the kidney to establish a gray value change set, and generate a cortical gray value change control sequence dataset. S4: Based on the kidney anatomical structure reference frame image template, extract the gray value sequence from the enhanced urinary system image sequence, and combine it with the cortical gray value change comparison sequence dataset to identify the gray value enhancement direction, amplitude and duration, and generate an enhanced response image region identification result group; S5: Based on the frame number, spatial coordinates, and enhancement features of the enhanced response image region recognition result group, locate the screening region in the urinary system enhanced image sequence, depict its shape, and mark its boundaries to generate a tumor screening image region set.
[0005] As a further aspect of the present invention, the stable frame segment labeling result set includes stable continuous image frames, abnormal labeled image frames, and a jump pixel count index; the kidney anatomical structure reference frame image template includes the image frame with the lowest edge gradient level, kidney structure boundary coordinates, and gray-level distribution region annotation; the cortical gray-level change control sequence dataset includes the contralateral kidney cortical localization region, the region's average gray-level value sequence, and the time-series gray-level change set; the enhanced response image region identification result set includes the gray-level enhancement behavior direction, gray-level enhancement amplitude, and duration segment; and the tumor screening image region set includes screening region localization information, shape depiction data, and boundary labeling results.
[0006] As a further aspect of the present invention, the jump pixel quantity index is formed based on the comparison results of pixel grayscale differences in adjacent image frames of the kidney region. When the grayscale difference of the corresponding pixel meets the preset jump judgment condition, the pixel is marked as a jump pixel, and the jump pixels are counted to form a jump pixel quantity index. The image frame with the lowest edge gradient ranking refers to the image frame with the smallest overall pixel grayscale change amplitude in the kidney structure boundary region within a stable frame segment, and the smallest difference in edge gradient change between adjacent frames. The image frame satisfies the preset inter-frame grayscale change stability judgment condition and is used as a reference frame for kidney anatomical structure to improve the stability of subsequent spatial mapping and region localization.
[0007] As a further aspect of the present invention, the setting standard for anomaly marking of image frames based on the number of jump pixels includes: determining a stable statistical range for the number of jump pixels in advance based on the statistical results of the number of jump pixels in adjacent image frames of the kidney region; and marking the image frame as an abnormal frame when the number of jump pixels in the image frame exceeds the stable statistical range.
[0008] As a further aspect of the present invention, the continuous image frame segment within the stable range refers to the feature vectorization processing of the number of jump pixels, grayscale difference distribution characteristics, and inter-frame change trend characteristics formed in adjacent image frames of the kidney region, and the input of the feature vectors into a trained image frame stability recognition model for inference, and the output of the stability determination result corresponding to the image frame by the model. Among them, image frames that are determined to be in a stable state and whose frame sequence numbers are consecutive constitute the continuous image frame segment within the stable range.
[0009] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Based on the kidney region image frames in the urinary tract enhanced image sequence, retrieve the corresponding pixel gray values in adjacent frames, mark the pixels that meet the jump conditions according to the relationship between the gray value difference and the set gray value change threshold, count the total number of jump pixels in each frame, and generate an image frame jump pixel number sequence. S102: Call the sequence of number of jump pixels in the image frame, determine whether the number of jumps corresponding to the frame is within the set stable range, filter the image frame numbers that meet the stability requirements, divide the image frame segments according to the continuity of the frame numbers, and generate a set of stable frame segment numbers. S103: Based on the stable frame segment number set, extract the frame number and index information of the corresponding frame segment from the original image sequence, group and organize them by frame segment, establish a tagging structure, and generate a stable frame segment tagging result set.
[0010] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Based on the stable frame segment labeling result set, monitor the edge region of the kidney region in each image frame, extract the gray level change amplitude of the pixels in the region, and aggregate and calculate all edge gray level change amplitudes in image frame units to obtain the average edge gradient value and generate an image frame edge gradient value set. S202: Call the image frame edge gradient value set, sort the image frames according to their average edge gradient values, identify the image frame with the lowest average edge gradient value in the sort, record the position index of the image frame in the original image sequence, and generate the lowest edge gradient sorted frame index value. S203: Based on the lowest frame index value sorted by the edge gradient, extract the corresponding image frame data from the original image sequence, mark the coordinate position of the kidney structure boundary in the image frame and the gray-scale distribution range of the corresponding area, and combine the image data and the marking information in a structured way to generate a kidney anatomical structure reference frame image template.
[0011] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the spatial coordinates of the kidney marked in the reference frame image template of the kidney anatomy structure, perform affine mapping on the relative positional relationship, retrieve the coordinate positions of the cortical regions symmetrically distributed with the kidney region in the image frames of the enhanced image sequence, record the positioning region index corresponding to the frame, and generate a set of contralateral cortical region indexes. S302: Call the contralateral cortical region index set, set a rectangular mask range in the image frame according to the positioning index, perform aggregation operation on all pixel gray values within the mask, obtain the average gray value of the region, and collect the average gray values corresponding to all image frames according to the frame sequence number to generate a frame sequence average gray value sequence. S303: Based on the frame sequence average gray value sequence, using the frame sequence number as the time index, rearrange the corresponding gray values on the time axis to construct a time point gray value change trend sequence, and organize it into a structured dataset in a unified format to generate a cortical gray value change comparison sequence dataset.
[0012] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the spatial coordinates of the marked area in the reference frame image template of the kidney anatomy structure, index all image frames in the enhanced image sequence, extract the grayscale pixel values corresponding to the marked area positions, and sort and integrate them according to the image frame order to generate a grayscale value sequence matrix of the marked area. S402: Call the gray value sequence matrix of the labeled area and compare it frame by frame with the same frame sequence in the cortical gray value change comparison sequence dataset. Based on the difference direction, amplitude change rate and the number of frames with continuous increase in gray value of the two sets of gray value change trends, extract the frame segment index that meets the anisotropic enhancement condition and generate an enhanced behavior recognition index set. S403: Based on the frame index and spatial coordinates recorded in the enhanced behavior recognition index set, the corresponding image frames in the enhanced image sequence are extracted and marked, and the position, time and grayscale change information of the recognized area are normalized and organized to generate an enhanced response image area recognition result group.
[0013] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the image frame sequence number recorded in the enhanced response image region identification result group, index the corresponding frame in the enhanced image sequence, extract the image matrix data of the specified frame, and establish a mapping relationship table based on the frame number and sequence position to generate a screening frame index mapping set; S502: Call the frame sequence number and spatial coordinate range indicated in the screening frame index mapping set, construct a closed boundary contour structure according to the recognition area coordinates in each frame, adjust the contour shape according to the gray-scale enhancement feature information, complete the structural boundary calibration of the corresponding area on the image, and generate a gray-scale feature contour mark group. S503: Based on the contour boundaries and spatial positions recorded in the grayscale feature contour marker group, the boundary regions in the image frames are uniformly collected, and the regions are combined and encoded according to the frame number. The regions in all frames that have completed boundary drawing are integrated into an image index set to generate a tumor screening image region set.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by identifying grayscale jumps in image sequences, interference from abnormal frames on image processing is avoided. The frame with the lowest structural boundary clarity is extracted by combining edge gradient changes as a reference image of the anatomical structure. Spatial location mapping is used to achieve dynamic analysis of grayscale changes in the cortical region, making the identification of the direction, amplitude, and duration of the enhanced response more accurate. This enables automatic screening and boundary delineation of suspicious areas, ensuring the continuity of screening and localization results in time and consistency in space, improving the accuracy of lesion identification and the objectivity of the results, and realizing the generation of image sets of suspected urinary tract tumor areas. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Please see Figure 1 This invention provides a method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features, comprising the following steps: S1: In the enhanced imaging sequence of the urinary system, the degree of gray-level difference of the kidney region in adjacent image frames is calculated. Based on the number of jump pixels, image frames with gray-level differences exceeding the set standard are marked as abnormal. Continuous image frame segments with the number of jump pixels within a stable range are recorded, and a set of stable frame segment marking results is generated. S2: In the stable frame segment labeling result set, the edge gradient of the kidney region in each image frame is extracted, sorted according to the average edge gradient value, the image frame with the lowest edge gradient level is identified, and the image annotation of the kidney structure boundary coordinates and gray-scale distribution area is completed to generate a kidney anatomical structure reference frame image template. S3: Based on the spatial relationship recorded in the reference frame image template of the kidney anatomy, locate the contralateral cortical region of the kidney in the enhanced image sequence, extract the average gray value of the region in each image frame using a rectangular mask, establish a set of gray value changes in the corresponding time sequence, and generate a cortical gray value change control sequence dataset. S4: Based on the spatial coordinates of the marked areas in the reference frame image template of the kidney anatomy, extract the gray value sequence of the corresponding image position in the enhanced image sequence, combine it with the cortical gray value change comparison sequence dataset, identify the direction, amplitude and duration of the gray value enhancement behavior, and generate a group of enhanced response image region recognition results. S5: Based on the image frame sequence number, spatial coordinate range and grayscale enhancement features recorded in the enhanced response image region recognition result group, the screening region is located, its shape is depicted and its boundary is marked in the enhanced image sequence, and a set of tumor screening image regions is generated.
[0020] The stable frame segment labeling result set includes stable continuous image frames, abnormal labeled image frames, and the number of jump pixels. The kidney anatomy benchmark frame image template includes the image frame with the lowest edge gradient level, kidney structure boundary coordinates, and gray-level distribution region annotations. The cortical gray-level change control sequence dataset includes the location region of the contralateral kidney cortex, the average gray-level value sequence of the region, and the time-series gray-level change set. The enhanced response image region recognition result set includes the direction of gray-level enhancement behavior, gray-level enhancement amplitude, and duration. The tumor screening image region set includes screening region location information, shape depiction data, and boundary labeling results.
[0021] In this embodiment, the image frame stability recognition model is a machine learning model trained on medical image samples. The model uses jump pixel features, grayscale change features and inter-frame change trend features as input features. It obtains model parameters by performing feature learning on training samples and outputs the stability judgment result of the image frame in the inference stage. Please see Figure 2 The specific steps of S1 are as follows: S101: Based on the kidney region image frames in the urinary tract enhanced image sequence, retrieve the corresponding pixel gray values in adjacent frames, mark the pixels that meet the jump conditions according to the relationship between the gray value difference and the set gray value change threshold, count the total number of jump pixels in each frame, and generate an image frame jump pixel number sequence. Using the kidney region in each frame of the enhanced image sequence as input, the frame sequence number is first checked for consistency according to the acquisition timestamp, and frames with missing timestamps and duplicate frame numbers are deleted. Then, the kidney region image frame is obtained by cropping according to the outer rectangle of the kidney, with a cropping size of 256 pixels by 256 pixels. Subsequently, for each pixel in the current frame, a search is performed on the same coordinates of adjacent frames. The gray values of the same coordinates in the previous frame, current frame, and next frame are read, and the gray value difference between the current gray value and the previous and next frames is calculated. The larger of the two values is taken as the jump amplitude of the pixel. The gray value change threshold is obtained by statistical analysis of the non-enhanced frame segments of the same subject. 20 frames are extracted, and 4000 pixels are extracted from each frame. The distribution of the difference amplitude between adjacent frames is summarized. The noise difference is mainly distributed in the range of 0 to 12 Huntsfield units. Based on this, the threshold of 15 Huntsfield units is taken. For each frame, the pixel jump amplitude is judged point by point. Pixels with a jump amplitude greater than or equal to 15 are marked as jump pixels, and the total number of jump pixels in the frame is counted. The total number of pixels in the kidney region of frame 35 is 65536. 842 pixels were identified as jump pixels, so the total number of jump pixels in this frame is recorded as 842. All frame counts are compiled into an image frame jump pixel count sequence by frame number, and the median and upper quartile of the difference amplitude for each frame are recorded simultaneously as fields for stability determination.
[0022] Table 1. Examples of image frame jump pixel statistics Frame sequence number Total number of pixels in the kidney region Number of pixels to jump Jump pixel ratio Median of grayscale difference (HU) Judgment Result 31 65536 412 0.63% 8 Stablize 32 65536 438 0.67% 9 Stablize 33 65536 920 1.40% 14 Stablize 34 65536 1356 2.07% 17 abnormal 35 65536 842 1.28% 13 Stablize For example, as shown in Table 1, by statistically analyzing the number of transition pixels and grayscale difference characteristics in each image frame, image frames with abnormal grayscale changes can be identified, thereby eliminating abnormal frames and forming a stable set of frame segments.
[0023] S102: Call the sequence of pixel jumps in the image frame, determine whether the number of jumps corresponding to the frame is within the set stable range, filter the image frame numbers that meet the stability requirements, divide the image frame segments according to the continuity of the frame numbers, and generate a set of stable frame segment numbers. After retrieving the sequence of pixel jumps in the image frames, a stable range is first determined, and stable frames are then filtered. The stable range is determined using a sliding window statistical method, with a window length of 9 frames. For each window, the difference between the maximum and minimum total number of pixel jumps is calculated, and the average total number of pixel jumps within the window is also calculated. Windows with a difference of no more than 120 points and an average value between 400 and 1200 points are marked as stable candidate windows. This range is determined based on the pixel size of the kidney region and the statistical results of unenhanced noise. Subsequently, a classification judgment is performed on each frame. If a frame falls into at least one stable candidate window, it enters the stable frame candidate set. The stable frame candidate set is sorted in ascending order by frame number and divided into consecutive frame segments. If the difference between the frame numbers of two adjacent frames is 1, they are assigned to the same frame segment; otherwise, a new frame segment is created. The filtering results in 14 consecutive frames with frame numbers 31 to 44 and 8 consecutive frames with frame numbers 60 to 67, forming two candidate frame segments. A minimum frame segment length constraint is further introduced: frame segments with a length of no more than 5 frames are not included in the stable frame segment number set. This constraint is determined based on the length distribution of brief static segments in multiple historical sequences. Finally, the stable frame segment number set is output, and the average value of the transition pixels within each recorded segment and the difference value within the segment are used as boundary input fields for subsequent frame segment traversal.
[0024] S103: Based on the stable frame segment number set, extract the frame number and index information of the corresponding frame segment from the original image sequence, group and organize them by frame segment, establish a tagging structure, and generate a stable frame segment tagging result set; First, a consistency check is performed on the frame number and instance sequence number to verify if their incrementing relationship is consistent. Then, stable frame segments are extracted segment by segment, and an array of frame numbers and an array of indices within each segment are created. These are written in ascending order of frame numbers, maintaining a one-to-one correspondence. For frame segments 31 to 44, the array of frame numbers within the segment is 31 to 44, and the array of indices within the segment is 1201 to 1214. Gap detection is performed on the array of indices within the segment. If a breakpoint is found, the original frame segment is split at the breakpoint location and renumbered. Simultaneously, the average and difference values of the jump pixels within the segment are recalculated. After completing the segment organization, a tag structure is established, with the fields in a fixed order: frame segment number, segment start frame number, segment end frame number, number of frames within the segment, array of frame numbers within the segment, array of indices within the segment, average value of jump pixels within the segment, and difference value of jump pixels within the segment. The frame segment tagging structures are grouped according to the frame segment number to generate a stable frame segment tagging result set, and a segment-level summary list is generated. The summary list contains the number of frames in each segment and the start and end range of the index, so that the original frame data can be directly located by frame segment in the future.
[0025] Please see Figure 3 The specific steps of S2 are as follows: S201: Based on the stable frame segment labeling result set, monitor the edge region of the kidney region in each image frame, extract the gray level change amplitude of the pixels in the region, and aggregate and calculate the gray level change amplitude of all edges in image frame units to obtain the average edge gradient value and generate the image frame edge gradient value set. For each frame, denoising is first performed using a 3-pixel multiplied by 3-pixel median filter while maintaining the same grayscale quantization scale. Then, an edge region is constructed, consisting of an inner ring band that contracts inward by 5 pixels from the outer contour of the kidney and an outer ring band that expands outward by 3 pixels. The outer contour is obtained by manually defining the circumscribed rectangle and refining the boundary. For each pixel within the edge region, the grayscale values of its upper, lower, left, and right adjacent pixels are read, and the grayscale difference amplitude is calculated for each. The maximum amplitude is taken as the edge grayscale change amplitude for that pixel. The arithmetic mean of all edge grayscale change amplitudes is calculated frame by frame to obtain the average edge gradient value for that frame. A frame has 9800 edge pixels, and the aggregated average edge gradient value is 23 Huntsfield units. To ensure comparability between frames, a consistency constraint on the number of edge pixels is introduced; frames with an edge pixel count deviating from the median of that frame segment by more than 12 percent are not included in the value set. Repeat the above process for all qualified frames within the segment to generate a set of image frame edge gradient values, and record the frame sequence number, average edge gradient value, number of edge pixels, and the number of the stable frame segment to which it belongs.
[0026] Table 2. Examples of image frame edge gradient statistics Frame sequence number Number of edge pixels Average marginal gradient (HU) Gradient Standard Deviation Frame segment to which it belongs 36 9785 24 6.2 First stable frame segment 37 9810 21 5.9 First stable frame segment 38 9802 18 4.8 First stable frame segment 39 9796 18 4.5 First stable frame segment Frame sequence number Number of edge pixels Average marginal gradient (HU) Gradient Standard Deviation Frame segment to which it belongs For example, by comparing the average edge gradient values of each frame, the image frame with the lowest edge gradient can be identified as the reference frame for the kidney anatomy.
[0027] S202: Call the image frame edge gradient value set, sort the image frames according to their average edge gradient values, identify the image frame with the lowest average edge gradient value in the sort, record the position index of the image frame in the original image sequence, and generate the lowest edge gradient sorted frame index value. First, the numerical set is deduplicated by frame number and missing frames are checked. When a missing frame is located within a stable frame segment, the average edge gradient values of its preceding and following frames are read, and the smaller value is used as a surrogate value and written into the missing frame record, marked as the imputation source. Then, the average edge gradient values are used as the sorting criterion to sort from largest to smallest, with the last frame corresponding to the frame with the smallest average edge gradient value. If there are ties for the minimum value, the upper quartiles of the edge grayscale change amplitudes of the tying frames are compared; the frame with the smaller upper quartile is determined as the lowest frame. If they are still tying, the frame with the later frame number is selected as the lowest frame. For frames 38 and 39, both with an average edge gradient value of 18, their upper quartiles are 27 and 25 respectively, and frame 39 is ultimately selected as the lowest frame. Based on the mapping relationship between frame number and storage index in the stable frame segment marking result set, the position index 1209 of this frame in the original sequence is read. The index value of the lowest frame sorted by edge gradient, 1209, is output, along with the frame number, the frame segment number, the average edge gradient value, and the number of edge pixels.
[0028] S203: Based on the lowest frame index value sorted by edge gradient, extract the corresponding image frame data from the original image sequence, mark the coordinate position of the kidney structure boundary in the image frame and the gray-level distribution range of the corresponding region, and combine the image data and the annotation information in a structured way to generate a kidney anatomy reference frame image template. While extracting the image matrix data of this frame, spatial information such as pixel spacing and slice thickness is read and saved. Then, kidney structure boundary coordinate annotation is performed. Using the circumscribed rectangle of the kidney as the initial range, a pixel-by-pixel scan is performed within the rectangle in four directions: top, bottom, left, and right. The scan line moves from the outside in, continuously calculating the gray-level difference between adjacent pixels. When the gray-level difference exceeds 20 Huntsfield units and is consecutively satisfied by 3 pixels, it is recorded as a candidate boundary point. After obtaining the four-directional candidate boundary point sets, they are connected in row and column order to form a boundary polyline. The polyline point sequence is then smoothed using a moving average of 5 adjacent points. The gray-level distribution range is obtained through bilateral sampling inside and outside the boundary. Three pixels are sampled inward and three pixels outward along the boundary normal direction, and the median gray-level values are calculated for the inner and outer sides, resulting in a gray-level range of 56 to 132 Huntsfield units. The frame index, image matrix, kidney boundary coordinate sequence, gray-level distribution range, and spatial information are combined in a fixed field order to generate a baseline image template for the kidney anatomy structure.
[0029] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the spatial coordinates of the kidney marked in the reference frame image template of the kidney anatomy, perform affine mapping on the relative positional relationship, retrieve the coordinate positions of the cortical regions symmetrically distributed with the kidney region in the image frames of the enhanced image sequence, record the location region index corresponding to the frame, and generate a set of contralateral cortical region indexes. First, a symmetrical baseline is established along the vertical midline of the image center. A mirror mapping is then performed on the kidney boundary coordinate sequence in the template. The column coordinates of each boundary point undergo a symmetrical transformation around the baseline, while the row coordinates remain unchanged, yielding the coordinates of the contralateral candidate region. Next, translation correction is performed. The amount of translation correction is determined by the offset between the centroid of the high-density structure of the spine in the template frame and the image center. The centroid is obtained by searching for connected regions in the template frame with a gray level greater than 300 Huntsfield units and a connected area greater than 500 pixels. The centroid of the connected region is taken as the spine center. When the spine center is offset by 12 pixels relative to the image center in the column direction, the contralateral candidate region is translated 12 pixels in the opposite direction to complete the alignment. Contralateral coordinate mapping is applied frame-by-frame to the enhancement sequence. To compensate for slight inter-frame displacement, an 80-pixel by 80-pixel window is cropped near the image center of each frame. The gray-level matrix of this window is read and cross-correlation is performed with the corresponding gray-level matrix of the template window. The displacement corresponding to the position of maximum cross-correlation is taken as the displacement correction amount for that frame. For each frame, record the frame sequence number, the coordinates of the four corners of the contralateral cortical rectangle, the displacement correction amount, and the matching confidence. Collect these records according to the frame sequence number to form a contralateral cortical region index set.
[0030] S302: Call the contralateral cortical region index set, set a rectangular mask range in the image frame according to the positioning index, perform aggregation operation on all pixel gray values within the mask, obtain the average gray value of the region, and collect the average gray values corresponding to all image frames according to the frame sequence number to generate a frame sequence average gray value sequence. The mask range is a scaled-in version of the opposite cortical rectangle, with a 4-pixel margin. Gray values are read point-by-point within the mask, and outlier pixels are removed. The removal criteria are gray values below -100 hnsfield units or above 400 hnsfield units; pixels meeting these criteria are not included in the aggregation. After removal, the arithmetic mean of the remaining pixel gray values is calculated to obtain the average gray value for the frame region. In a frame with 6400 pixels in the mask, 6215 pixels remain after outlier removal, resulting in an average gray value of 118 hnsfield units. All frame average gray values are aggregated according to frame number to form a frame-order average gray value sequence. The sequence field includes the frame number, average gray value, number of participating pixels, and number of outliers removed. A smoothing field is generated synchronously. A 5-frame moving average is applied to the original sequence, and the smoothed value is written. The original and smoothed values are saved side-by-side, and the frame-order average gray value sequence is output, recording the start and end frame numbers.
[0031] Table 3 Examples of contralateral cortical grayscale changes Frame sequence number Average gray value of the region (HU) Smoothed grayscale values (HU) grayscale change direction Continuous increase in frame rate 38 112 114 rise 1 39 118 116 rise 2 40 126 120 rise 3 41 129 123 rise 4 42 131 127 rise 5 As shown in Table 3, by constructing time-series grayscale change data, we can analyze the grayscale change trend of the cortical region in the enhanced image sequence, providing a reference for subsequent enhanced behavior recognition.
[0032] S303: Based on the frame sequence average gray value sequence, using the frame sequence number as the time index, rearrange the corresponding gray values on the time axis to construct a time point gray value change trend sequence, and organize it into a structured dataset in a unified format to generate a cortical gray value change comparison sequence dataset. First, verify the incrementality of the frame sequence numbers. If a reverse order occurs, reorder the frames according to the acquisition timestamp and reconstruct the frame sequence numbers. Then, using the frame sequence number as a time index, generate a trend field point by point. For each time point, read the average gray value of the current area and the average gray value of the area at the previous time point, calculate the difference magnitude, and determine whether the direction is upward or downward. If the direction is upward, increment the consecutive increase count by 1 based on the previous value; if the direction is downward or unchanged, reset the consecutive increase count to 0. The average gray value of the area at time point 40 is 126 Huntsfield units, an increase of 7 Huntsfield units relative to time point 39, with a consecutive increase count of 3. Record the direction as upward, the magnitude as 7, and the consecutive increase as 3. Organize each time point field into structured data in a unified order, with the fields sequentially written as frame sequence number, average gray value of the area, difference direction, difference magnitude, consecutive increase count, and number of participating pixels. When the sequence length exceeds 200 frames, a segmented summary is generated. The summary is compiled every 20 frames, and the maximum gray value, minimum gray value and number of rising segments of the segment are written. Finally, the cortical gray value change comparison sequence dataset is output and it is kept to correspond one-to-one with the frame sequence number.
[0033] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the spatial coordinates of the marked area in the reference frame image template of the kidney anatomy, index all image frames in the enhanced image sequence, extract the grayscale pixel values corresponding to the marked area positions, and sort and integrate them according to the image frame order to generate a grayscale value sequence matrix of the marked area. First, the coordinate mapping displacement is calculated for each frame. This displacement is obtained through cross-correlation matching of the renal hilum vessel region window, with a window size of 80 pixels by 120 pixels. The grayscale matrix of this window is read and compared with the grayscale matrix of the corresponding window in the template frame. The displacement corresponding to the position of maximum cross-correlation is used as the mapping correction for that frame. All coordinate points in the template annotation area are translated to the current frame coordinate system according to the displacement, and the grayscale value is read point by point. After reading, a one-dimensional grayscale sequence for that frame is formed according to a fixed unfolding order, using row-first, column-later unfolding order while maintaining consistent coordinate point indices. All one-dimensional grayscale sequences of all frames are stacked in frame order to form a grayscale value sequence matrix, with matrix rows corresponding to frame sequence numbers and matrix columns corresponding to coordinate point indices. When the number of coordinate points in the annotation area is 900, the maximum grayscale value of a row in a certain frame is 168 Huntsfield units, and the minimum is 92 Huntsfield units. Missing data is cleaned up on the matrix. If any coordinate point cannot be read, the entire row of that frame is marked as missing and removed, and simultaneously removed from the frame sequence number list. Output the grayscale value sequence matrix of the labeled area and the list of frame numbers, and retain the mapping list from the coordinate point number to the row and column coordinates for verification.
[0034] S402: Call the gray value sequence matrix of the labeled area and compare the same frame sequence in the cortical gray value change comparison sequence dataset frame by frame. Based on the difference direction, amplitude change rate and the number of frames with continuous increase in gray value of the two sets of gray value change trends, extract the frame segment index that meets the anisotropic enhancement conditions and generate an enhanced behavior recognition index set. First, the intersection of the frame sequence numbers of the two sets is taken as the comparison frame set. For each frame, the gray values of all coordinate points in the matrix are read and the arithmetic mean is performed to obtain the average gray value of the labeled area. At the same time, the average gray value of the cortical area in the same frame of the control sequence is read. The difference direction is determined. If the average gray value of the labeled area is higher than the average gray value of the cortical area, it is recorded as higher than the cortical area; otherwise, it is recorded as lower than the cortical area. The amplitude change rate is determined. The difference amplitude of the current frame and the difference amplitude of the previous frame are read, the difference between the two is calculated and converted into a relative change ratio, and recorded as an increase or decrease and the ratio value. The number of continuously rising frames is counted. The average gray value sequence of the labeled area is compared frame by frame with adjacent frames. The count is accumulated when it is continuously rising, and the count is reset to zero when it is decreasing or unchanged. The anisotropic enhancement condition adopts a clear interval constraint: the difference direction of 4 consecutive frames is higher than the cortical area, and there are at least 2 records of increasing relative change ratio of not less than 0.25 within these 4 frames, and the number of continuously rising frames of the average gray value of the labeled area is not less than 4. The set of consecutive frames that meet the conditions is merged into a frame segment index according to the continuity of the frame number and written into the enhanced behavior recognition index set. When the frame segments 72 to 75 meet the conditions, they are written into the frame segment index 72 to 75 and the continuously rising frame number 5 is recorded.
[0035] S403: Based on the frame index and spatial coordinates recorded in the enhanced behavior recognition index set, the corresponding image frames in the enhanced image sequence are extracted and labeled, and the location, time and grayscale change information of the recognized area are normalized and organized to generate a group of enhanced response image region recognition results. First, the frame set is located by frame segment index. For each frame, the coordinate mapping list is called to restore the coordinate points of the template annotation area to the pixel coordinate set of the current frame. Region extraction is performed, taking the image sub-matrix covered by the bounding rectangle of the annotation area, and generating a binary marker map. The marker map generation action sets the pixel where the coordinate point is located to 1 and the other pixels to 0. The position, time, and grayscale change information are organized and normalized. The position field writes the pixel coordinates of the four corners of the bounding rectangle and divides them by the image width and height to obtain a decimal in the range of 0 to 1. The time field writes the frame sequence number and the offset relative to the starting frame of the segment. The grayscale field writes the average grayscale value of the annotation area, the grayscale difference magnitude relative to the previous frame, and the direction of the difference with the average grayscale value of the cortex. The normalized position of frame sequence number 73 is 0.4125 and 0.3652 at the top left corner, and 0.5234 and 0.4727 at the bottom right corner. The difference direction is recorded as higher than the cortex. The image submatrix, binary labeled image, and normalized field are structurally combined into a single frame record and aggregated in frame order to output an enhanced response image region recognition result group.
[0036] Please see Figure 6 The specific steps of S5 are as follows: S501: Based on the image frame sequence number recorded in the enhanced response image region identification result group, index the corresponding frame in the enhanced image sequence, extract the image matrix data of the specified frame, and establish a mapping relationship table based on the frame number and sequence position to generate a screening frame index mapping set; Read all frame sequence numbers within the result group and remove duplicates, forming a screening frame list in ascending order. For each screening frame, read the storage location index from the original sequence index table and extract the corresponding image matrix data. Simultaneously, verify whether the pixel spacing and matrix size of this frame are consistent with the baseline frame template. If inconsistent, perform resampling. Resampling uses bilinear interpolation, and the output size is fixed to the baseline frame template size. Write the resampling flag into the mapping field. Establish a mapping relationship record with the following field order: screening frame sequence number, original sequence location index, acquisition timestamp, resampling flag, corresponding frame segment number, and corresponding normalized coordinate range. Screening frame sequence number 73 corresponds to location index 1453, resampling flag is not present, and corresponding frame segment numbers 72 to 75. Perform an integrity check on the mapping set. If the number of records in the result group is inconsistent with the number of screening frame records, fill in the missing frames within the corresponding frame segment range according to the adjacent existing screening frames and write the mapping record. Finally, output the screening frame index mapping set.
[0037] S502: Call the frame sequence number and spatial coordinate range indicated in the screening frame index mapping set, construct a closed boundary contour structure according to the recognition area coordinates in each frame, adjust the contour shape according to the gray-scale enhancement feature information, complete the structural boundary calibration of the corresponding area on the image, and generate a gray-scale feature contour label group. First, the normalized coordinates are inversely calculated into a bounding rectangle of pixel coordinates. An initial contour point set is generated and closed by sampling at 2-pixel intervals along the boundary of the bounding rectangle. Then, contour adjustment is performed based on grayscale enhancement features. For each contour point, 8 pixels are searched inwards and outwards along the normal direction. The grayscale values of candidate pixels on the search line are read, and the difference between the grayscale value and the current contour point's grayscale value is calculated. The contour point with the largest difference is updated. After one round of updates, smoothing is performed, updating the coordinates by a moving average of 7 adjacent points, and this process is repeated for two rounds. A threshold constraint for the difference in grayscale values between the inner and outer contours is added. The average grayscale value of the region within the contour and the average grayscale value of the adjacent ring region outside the contour are calculated separately. The difference is calculated and compared with the threshold, which is obtained statistically from the non-recognizable regions of the same sequence. The difference in non-recognizable regions is mainly within the range of 0 to 18 Huntsfield units; therefore, a threshold of 20 Huntsfield units is selected. When the difference is less than 20, the process reverts to the previous contour and shortens the search length to 5 pixels before updating again. The initial difference of 17 triggers the revert, resulting in a difference of 28. Write the frame sequence number, contour point coordinate sequence, average gray value inside and outside the contour, difference between inside and outside, number of smoothing rounds and search length into the gray feature contour tag group.
[0038] S503: Based on the contour boundaries and spatial positions recorded in the grayscale feature contour marker group, the boundary regions in the image frame are uniformly collected, and the regions are combined and encoded according to the frame number. The regions in all frames that have completed boundary drawing are integrated into an image index set to generate a tumor screening image region set. First, contour markers are grouped according to frame sequence number. When multiple contours exist in the same frame, they are sorted by area from largest to smallest, and all records are retained. A region combination code is generated for each contour. The code is formed by concatenating the frame sequence number, contour number, and the coordinates of the top-left and bottom-right corners of the contour's circumscribed rectangle in a fixed order, separated by underscores to form a pure numeric code string. An example code is 73 underscore 01 underscore 102 underscore 88 underscore 166 underscore 149. All coded records are collected into an image index set. The set fields include the code, frame sequence number, original sequence position index, contour point coordinate sequence storage offset, grayscale statistics inside and outside the contour, and the corresponding frame segment index. A consistency check is performed on the set. The check verifies whether contour points fall within the image boundary and whether contours self-intersect. For self-intersection determination, cross-checking is performed on contour segments. If self-intersection is found, the contour point sequence is rearranged and smoothed again. If self-intersection still occurs, the contour is deleted, and a deletion code is written. When six contour records were generated in frames 72 to 75, one was deleted due to a failed self-verification check, leaving five records. The tumor screening image region set is output, maintaining consistency between the encoding and the mapping of frame number and location index.
[0039] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for urinary system tumor screening based on frame segment stabilization and gray scale enhancement features, characterized in that, Includes the following steps: S1: Calculate the grayscale difference between adjacent frames in the kidney region of the enhanced urinary system image sequence. Based on the number of jump pixels, mark the image frames whose grayscale difference exceeds the set standard as abnormal. Record the continuous image frame segments within the stable range and generate a set of stable frame segment marking results. S2: Extract the kidney edge gradient from the stable frame segment labeling result set, sort and identify the frame with the lowest gradient, label the kidney structure boundary coordinates and gray level distribution, and generate a kidney anatomy reference frame image template. S3: Based on the reference frame image template of the kidney anatomy, locate the contralateral cortex of the kidney in the enhanced urinary system image sequence, extract the average gray value of the contralateral cortex of the kidney to establish a gray value change set, and generate a cortical gray value change control sequence dataset. S4: Based on the kidney anatomical structure reference frame image template, extract the gray value sequence from the enhanced urinary system image sequence, and combine it with the cortical gray value change comparison sequence dataset to identify the gray value enhancement direction, amplitude and duration, and generate an enhanced response image region identification result group; S5: Based on the frame number, spatial coordinates, and enhancement features of the enhanced response image region recognition result group, locate the screening region in the urinary system enhanced image sequence, depict its shape, and mark its boundaries to generate a tumor screening image region set.
2. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that: The stable frame segment labeling result set includes stable continuous image frames, abnormal labeled image frames, and abrupt pixel count indicators. The kidney anatomy reference frame image template includes the image frame with the lowest edge gradient level, kidney structure boundary coordinates, and gray-level distribution region annotations. The cortical gray-level change control sequence dataset includes the contralateral kidney cortical localization region, the region's average gray-level value sequence, and the time-series gray-level change set. The enhanced response image region identification result set includes the gray-level enhancement behavior direction, gray-level enhancement amplitude, and duration. The tumor screening image region set includes screening region localization information, shape depiction data, and boundary labeling results.
3. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that: The jump pixel count index is formed based on the comparison results of pixel grayscale differences in adjacent image frames of the kidney region. When the grayscale difference of the corresponding pixel meets the preset jump judgment condition, the pixel is marked as a jump pixel, and the jump pixels are counted to form the jump pixel count index. The image frame with the lowest edge gradient ranking refers to the image frame with the smallest overall pixel grayscale change amplitude in the kidney structure boundary region within a stable frame segment, and the smallest difference in edge gradient change between adjacent frames. The image frame satisfies the preset inter-frame grayscale change stability judgment condition and is used as a reference frame for kidney anatomical structure to improve the stability of subsequent spatial mapping and region localization.
4. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that: The standard for marking image frames as abnormal based on the number of jump pixels includes: determining a stable statistical range for the number of jump pixels in advance based on the statistical results of the number of jump pixels in adjacent image frames of the kidney region; and marking the image frame as an abnormal frame when the number of jump pixels in the image frame exceeds the stable statistical range.
5. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that: The stable range of continuous image frames refers to the feature vectorization of the number of jump pixels, gray-level difference distribution characteristics, and inter-frame change trend characteristics formed in adjacent image frames of the kidney region. The feature vectors are then input into a trained image frame stability recognition model for inference. The model outputs the stability determination result corresponding to the image frame. Among them, multiple consecutive image frames that are determined to be in a stable state and whose frame sequence numbers are consecutive constitute the stable range of continuous image frames.
6. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Based on the kidney region image frames in the urinary tract enhanced image sequence, retrieve the corresponding pixel gray values in adjacent frames, mark the pixels that meet the jump conditions according to the relationship between the gray value difference and the set gray value change threshold, count the total number of jump pixels in each frame, and generate an image frame jump pixel number sequence. S102: Call the sequence of number of jump pixels in the image frame, determine whether the number of jumps corresponding to the frame is within the set stable range, filter the image frame numbers that meet the stability requirements, divide the image frame segments according to the continuity of the frame numbers, and generate a set of stable frame segment numbers. S103: Based on the stable frame segment number set, extract the frame number and index information of the corresponding frame segment from the original image sequence, group and organize them by frame segment, establish a tagging structure, and generate a stable frame segment tagging result set.
7. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Based on the stable frame segment labeling result set, monitor the edge region of the kidney region in each image frame, extract the gray level change amplitude of the pixels in the region, and aggregate and calculate all edge gray level change amplitudes in image frame units to obtain the average edge gradient value and generate an image frame edge gradient value set. S202: Call the image frame edge gradient value set, sort the image frames according to their average edge gradient values, identify the image frame with the lowest average edge gradient value in the sort, record the position index of the image frame in the original image sequence, and generate the lowest edge gradient sorted frame index value. S203: Based on the lowest frame index value sorted by the edge gradient, extract the corresponding image frame data from the original image sequence, mark the coordinate position of the kidney structure boundary in the image frame and the gray-scale distribution range of the corresponding area, and combine the image data and the marking information in a structured way to generate a kidney anatomical structure reference frame image template.
8. The method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, wherein the specific steps of S3 are as follows: S301: Based on the spatial coordinates of the kidney marked in the reference frame image template of the kidney anatomy structure, perform affine mapping on the relative positional relationship, retrieve the coordinate positions of the cortical regions symmetrically distributed with the kidney region in the image frames of the enhanced image sequence, record the positioning region index corresponding to the frame, and generate a set of contralateral cortical region indexes. S302: Call the contralateral cortical region index set, set a rectangular mask range in the image frame according to the positioning index, perform aggregation operation on all pixel gray values within the mask, obtain the average gray value of the region, and collect the average gray values corresponding to all image frames according to the frame sequence number to generate a frame sequence average gray value sequence. S303: Based on the frame sequence average gray value sequence, using the frame sequence number as the time index, rearrange the corresponding gray values on the time axis to construct a time point gray value change trend sequence, and organize it into a structured dataset in a unified format to generate a cortical gray value change comparison sequence dataset.
9. A method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the spatial coordinates of the marked area in the reference frame image template of the kidney anatomy structure, index all image frames in the enhanced image sequence, extract the grayscale pixel values corresponding to the marked area positions, and sort and integrate them according to the image frame order to generate a grayscale value sequence matrix of the marked area. S402: Call the gray value sequence matrix of the labeled area and compare it frame by frame with the same frame sequence in the cortical gray value change comparison sequence dataset. Based on the difference direction, amplitude change rate and the number of frames with continuous increase in gray value of the two sets of gray value change trends, extract the frame segment index that meets the anisotropic enhancement condition and generate an enhanced behavior recognition index set. S403: Based on the frame index and spatial coordinates recorded in the enhanced behavior recognition index set, the corresponding image frames in the enhanced image sequence are extracted and marked, and the position, time and grayscale change information of the recognized area are normalized and organized to generate an enhanced response image area recognition result group.
10. A method for screening urinary tract tumors based on frame stabilization and grayscale enhancement features according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Based on the image frame sequence number recorded in the enhanced response image region identification result group, index the corresponding frame in the enhanced image sequence, extract the image matrix data of the specified frame, and establish a mapping relationship table based on the frame number and sequence position to generate a screening frame index mapping set; S502: Call the frame sequence number and spatial coordinate range indicated in the screening frame index mapping set, construct a closed boundary contour structure according to the recognition area coordinates in each frame, adjust the contour shape according to the gray-scale enhancement feature information, complete the structural boundary calibration of the corresponding area on the image, and generate a gray-scale feature contour mark group. S503: Based on the contour boundaries and spatial positions recorded in the grayscale feature contour marker group, the boundary regions in the image frames are uniformly collected, and the regions are combined and encoded according to the frame number. The regions in all frames that have completed boundary drawing are integrated into an image index set to generate a tumor screening image region set.
