Gynecological endoscope video real-time processing and abnormality detection method
Patent Information
- Application Number
- CN202611040411.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明的目的在于提供妇科内窥镜视频实时处理与异常检测方法,以解决全帧处理计算难以满足实时性以及无法区分视频帧中的临时干扰和真实病变的问题
本发明通过逐帧提取视频帧的局部色彩分布与边缘轮廓形态特征,并与正常组织基准特征比对筛选候选帧,初步排除大量时序冗余帧,以降低图像处理计算量,保证妇科内窥镜视频的实时处理需求;通过色彩与轮廓双特征分割异常特征区块,并结合显著性得分筛选病变帧,准确锁定承载关键病变信息的帧数据,利用区块色彩均匀度和边界突变强度的初步判定,结合轮廓残缺度、纹理连续度的补偿判定,可有效区分器械遮挡干扰与真实病变,解决单帧无校验导致的误检、漏检问题,在保证检测实时性的同时,提高了妇科内窥镜异常检测的精准度与可靠性,满足临床诊疗的智能辅助需求。
Smart Images

Figure CN122928754A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image detection technology, and in particular to a method for real-time processing and abnormality detection of gynecological endoscopic videos. Background Technology
[0002] With the widespread application of endoscopic imaging equipment in the medical field, intelligent analysis based on video streams is crucial for processing continuous video streams acquired by endoscopes to achieve basic identification of target lesions, providing technical support for doctors or testing personnel. In existing technologies, gynecological endoscopic videos contain a large number of temporally redundant frames. This means that the endoscope lens is mostly in a state of slight shaking and slow gliding, and most continuous images are identical. However, key lesion information may only appear in a few video frames. If a frame is selected every few frames, key lesion frames will be lost. The computational load for full-frame processing is high, making it difficult to meet real-time requirements. Furthermore, abnormal color blocks and incomplete contours formed by surgical instruments are almost identical to the single-frame imaging effect of real lesions, while the number of video frames that can reflect lesion information is small. Therefore, when performing anomaly detection, there is no inter-frame position and morphological change as a verification basis, making it impossible to distinguish between temporary interference in video frames and real lesions, greatly increasing the probability of false positives and false negatives.
[0003] Therefore, it is necessary to propose a method for real-time processing and abnormality detection of gynecological endoscopic videos to solve the above problems. Summary of the Invention
[0004] The purpose of this invention is to provide a method for real-time processing and anomaly detection of gynecological endoscopic videos, so as to solve the problems that full-frame processing calculations are difficult to meet real-time requirements and cannot distinguish between temporary interference and real lesions in video frames.
[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for real-time processing and abnormality detection of gynecological endoscopic videos includes the following steps: The video frames are determined, and the single-frame features within each video frame are extracted. The single-frame features are then compared with the preset normal organization benchmark features to obtain candidate frames. For each candidate frame, region segmentation is performed to delineate all abnormal feature blocks that deviate from normal tissue within the candidate frame. Abnormal discrimination features of the abnormal feature blocks are extracted to calculate the salience score of the candidate frame. The salience scores are used to sort and filter the candidate frames to obtain the lesion frames. Based on abnormal feature blocks in the lesion frame, distinguishing features are extracted to differentiate between instrument occlusion and real lesions; Based on the laws of endoscopic imaging and physiological morphology, a judgment logic is established, and the judgment logic is used to determine the distinguishing features of abnormal feature blocks in order to locate the real lesion area. Integrate all real lesion regions within the lesion frame for anomaly detection.
[0006] Preferably, the single-frame features include local color distribution features and edge contour morphology features, and the reference features include color distribution reference features and edge contour morphology reference features of normal tissue standard.
[0007] Preferably, the step of obtaining candidate frames by comparing single-frame features with reference features includes: Acquire video frames captured in real time by gynecological endoscopy, extract single-frame features from the video frames, and call the baseline features of normal tissue; Calculate the Euclidean distance between the vector of local color distribution features and the vector of color distribution reference in the current video frame to obtain the color deviation. Calculate the similarity between the edge contour feature vector and the edge contour reference vector in the current video frame to obtain the contour deviation. Based on color deviation and contour deviation, feature deviation is generated; Candidate frames are obtained by comparing the feature deviation with a preset deviation threshold.
[0008] Preferably, the step of comparing candidate frames based on feature deviation with a preset deviation threshold includes: If the feature deviation is greater than or equal to the deviation threshold, it is determined that there is an abnormal feature deviation in the corresponding video frame, and the video frame is marked as a candidate frame. If the feature deviation is less than the deviation threshold, the corresponding video frame is determined to be a normally organized frame and is directly discarded.
[0009] Preferably, the step of performing region segmentation on each candidate frame to delineate all abnormal feature blocks deviating from normal tissue within the candidate frame includes: After standardizing the candidate frames, the candidate frames are segmented based on the local color distribution features and the color distribution baseline features of normal tissues, the initial suspicious regions are marked, and the initial suspicious mask is generated. The initial suspicious region is further segmented based on the edge contour morphology features to optimize the initial suspicious mask; Connectivity extraction and boundary regularization are performed on the optimized initial suspicious mask to delineate abnormal feature blocks within the output candidate frames.
[0010] Preferably, the step of extracting distinguishing features based on abnormal feature blocks in the lesion frame to differentiate between instrument occlusion and real lesions includes: For each abnormal feature block within the lesion frame, the block color uniformity and boundary abrupt change intensity are extracted as distinguishing features. The block color uniformity is calculated based on the local color distribution features of the abnormal feature block, and the boundary abrupt change intensity is calculated based on the edge contour morphology features of the abnormal feature block.
[0011] Preferably, the step of using judgment logic to determine the distinguishing features of abnormal feature blocks in order to locate the actual lesion area includes: Based on the intensity of boundary mutations and the uniformity of block color, a preliminary judgment is made on abnormal feature blocks to generate lesion areas and blocks to be judged. The contour incompleteness and texture continuity of the block to be judged are calculated, wherein the contour incompleteness is calculated based on the edge contour morphology features, and the texture continuity is calculated based on the local color distribution features; Based on the contour incompleteness and texture continuity of the area to be judged, compensation judgment is made, and combined with the lesion area, the true lesion area is located.
[0012] Preferably, the step of performing a preliminary judgment on abnormal feature blocks to generate lesion areas and blocks to be judged includes: If the boundary mutation intensity is low and the color uniformity of the block is high, it is directly identified as a lesion area; If the boundary mutation intensity is high and the color uniformity of the block is low, the corresponding abnormal feature block will be marked as a block to be judged and enter the compensation judgment process.
[0013] Preferably, the calculation of the contour incompleteness and texture continuity includes: The contour incompleteness is calculated by statistically analyzing the number of open breakpoints and the proportion of non-closed contours at the edge of the block to be judged. The texture continuity is calculated by calculating the pixel gradient smoothness within the block to be judged.
[0014] Preferably, the compensation determination step includes: If the outline of the area to be judged has a high degree of incompleteness and the internal texture has a high degree of continuity, it is judged as a lesion area with incompleteness. If the outline of the area to be judged has low incompleteness and low internal texture continuity, it is judged as an interference area blocked by the instrument.
[0015] The technical effects and advantages of the present invention in the above technical solution are as follows: This invention extracts the local color distribution and edge contour features of video frames frame by frame and compares them with the baseline features of normal tissue to screen candidate frames, initially eliminating a large number of temporally redundant frames to reduce the computational load of image processing and ensure the real-time processing requirements of gynecological endoscopy videos. By segmenting abnormal feature blocks using color and contour dual features and combining them with saliency scores to screen lesion frames, it accurately locates frame data carrying key lesion information. By using the preliminary judgment of block color uniformity and boundary abrupt change intensity, combined with the compensation judgment of contour incompleteness and texture continuity, it can effectively distinguish between instrument occlusion interference and real lesions, solving the problem of false detection and missed detection caused by single frame without verification. While ensuring the real-time nature of detection, it improves the accuracy and reliability of gynecological endoscopy abnormality detection and meets the intelligent assistance needs of clinical diagnosis and treatment. Attached Figure Description
[0016] Figure 1 This is a flowchart of the gynecological endoscopy video real-time processing and abnormality detection method of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] like Figure 1 As shown, this embodiment provides a method for real-time processing and anomaly detection of gynecological endoscopic videos, including the following steps: Step S1: Determine the video frame and extract the single-frame features within the video frame frame by frame. Compare the single-frame features with the preset normal organization benchmark features to obtain candidate frames. Single-frame features include local color distribution features and edge contour morphology features, and the reference features include color distribution reference features and edge contour morphology reference features of normal tissue standard; In one embodiment of the present invention, candidate frames with feature anomalies are screened out by quantitatively comparing single-frame features with the baseline features of normal tissue, thereby reducing the computational load of video image processing and ensuring real-time performance. Specifically, video frames acquired in real time by a gynecological endoscope are obtained, single-frame features of the video frames are extracted, and the baseline features of normal tissue are called; the Euclidean distance between the vector of local color distribution features and the vector of the color distribution baseline in the current video frame is calculated to obtain the color deviation; the similarity between the feature vector of edge contour morphology and the baseline vector of edge contour morphology in the current video frame is calculated to obtain the contour deviation; based on the color deviation and contour deviation, a feature deviation is generated; based on the feature deviation, it is compared with a preset deviation threshold to obtain candidate frames.
[0019] In this embodiment of the invention, color deviation and contour deviation are used to distinguish between normal and abnormal frames, thereby avoiding meaningless full-frame processing and consuming a large amount of computing resources. The calculation of color deviation is specifically implemented through the following method: Let the local color distribution feature vector corresponding to the current video frame be denoted as... The pre-set baseline vector for normal tissue color distribution is denoted as... In this context, both sets of vectors are feature vectors of the same dimension, normalized to the interval [0,1]. The difference between corresponding elements of the two sets of vectors is calculated dimension by dimension. ,Right now Then calculate the difference. The square of the value is summed over the squares of all dimensions to obtain the sum of squares. The square root of the sum of squares is then taken to calculate the original Euclidean distance. The original Euclidean distance is then normalized to the [0,1] interval to finally obtain the color deviation. The calculation of the profile deviation is achieved through the following method: Let the edge contour morphology feature vector of the current video frame be... The reference vector for the edge contour morphology of normal tissue is Similarly, both sets of vectors are eigenvectors of the same dimension, normalized to the interval [0,1]. Multiplying corresponding elements of the two vectors element by element along each dimension and summing all products yields the vector dot product, calculated using the following formula: ; Calculate the magnitudes of the two eigenvectors respectively, i.e. , Based on the vector dot product, the dot product is divided by the product of the magnitudes of the two vectors to obtain the cosine similarity of the edge contour shape. Its value range is [0,1]. The closer the value is to 1, the more similar the current frame contour is to the normal tissue contour. The closer the value is to 0, the greater the contour difference. In this invention, since the contour deviation is used to represent the degree of abnormality, the contour deviation = 1 - cosine similarity, and the result is normalized to the [0,1] interval. Based on the above calculation results of contour deviation, the greater the contour deviation, the more significant the difference between the edge contour of the current video frame and the normal tissue contour, and the higher the probability of anomaly; the smaller the contour deviation, the closer the contour is to normal tissue, and it belongs to an invalid normal frame.
[0020] Based on the calculated color deviation and contour deviation of the video frames, a feature deviation that comprehensively represents the degree of image anomaly is generated by weighted fusion of the two. This is achieved through the following method: First, pre-set the weighting coefficients for color deviation and outline deviation, and denot them as color weights. Contour weight Both coefficients are constants between 0 and 1, and the sum of the coefficients is 1. The coefficients are set mainly based on the significance of clinical lesion color and contour abnormalities. The color deviation and contour deviation are weighted and summed according to their respective weights. That is, the color deviation and contour deviation are multiplied by their respective weighting coefficients and then summed to obtain the feature deviation. Since the color deviation, contour deviation and weights have been normalized to the [0,1] interval, the calculated value of the feature deviation is also automatically kept between [0,1]. The larger the feature deviation, the more significant the overall difference between the current video frame and the normal organization in both color and contour dimensions, and the higher the probability of it being an abnormal frame. The smaller the feature deviation, the closer the picture is to the normal organization, and it is a redundant frame without abnormalities, which is directly discarded to avoid wasting computing resources.
[0021] In one embodiment of the present invention, the step of comparing the candidate frame based on the feature deviation degree with a preset deviation threshold includes: If the feature deviation is greater than or equal to the deviation threshold, it is determined that there is an abnormal feature deviation in the corresponding video frame, and the video frame is marked as a candidate frame. If the feature deviation is less than the deviation threshold, the corresponding video frame is determined to be a normally organized frame and is directly discarded.
[0022] After calculating the feature deviation of the video frame, the value is compared with a preset deviation threshold to classify and filter normal frames and abnormal candidate frames to obtain candidate frames. This is achieved through the following method: Call the preset deviation threshold, which is a fixed threshold used to distinguish normal organized frames from frames with abnormal features; The feature deviation of the current video frame is compared frame by frame with the deviation threshold to perform classification. If the feature deviation is greater than or equal to the deviation threshold, the video frame is determined to have significant organizational feature anomalies, is marked as a candidate frame, and is included in the subsequent processing set; If the feature deviation is less than the deviation threshold, the video frame is determined to be a normal organized frame without abnormalities and is directly removed, no longer participating in subsequent region segmentation and feature calculation. Iterate through all the original video frames, complete the filtering and judgment of all frames, and obtain a set of candidate frames; In this invention, the deviation threshold is set by collecting a large number of healthy gynecological endoscopy video frames without lesions, instrument obstruction, bleeding, or mucus interference. Following the above method, the feature deviation of all normal samples is calculated frame by frame to form a deviation dataset of normal samples. The dataset is then subjected to normal distribution statistical analysis, and the upper limit of the feature deviation of normal samples at a 95% confidence level is selected as the initial deviation threshold. The threshold was tested using multiple sets of clinical gynecological endoscopic surgery videos, and the threshold size was continuously adjusted to ensure that the threshold could eliminate redundant normal frames to the greatest extent possible without missing any potential lesion frames, and finally obtain the deviation threshold.
[0023] In one embodiment of the present invention, by performing region segmentation, abnormal feature extraction and saliency scoring on candidate frames, redundant frames in the candidate frames are further eliminated, thereby obtaining the fewest number of lesion frames that carry complete key lesion information, further reducing the computational load of subsequent image processing to ensure real-time performance. Specifically, in step S2, each candidate frame is segmented to delineate all abnormal feature blocks that deviate from normal tissue within the candidate frame, and abnormal discrimination features of the abnormal feature blocks are extracted to calculate the saliency score of the candidate frame. The saliency scores are then used to sort and filter the candidate frames to obtain lesion frames. The step of performing region segmentation on each candidate frame to delineate all aberrant feature blocks deviating from normal tissue within the candidate frame includes: After standardizing the candidate frames, the candidate frames are segmented based on the local color distribution features and the color distribution baseline features of normal tissues, the initial suspicious regions are marked, and the initial suspicious mask is generated. The initial suspicious region is further segmented based on the edge contour morphology features to optimize the initial suspicious mask; Connectivity extraction and boundary regularization are performed on the optimized initial suspicious mask to delineate abnormal feature blocks within the output candidate frames.
[0024] In this embodiment of the invention, the standardization process for candidate frames specifically includes normalizing the brightness of the candidate frames to eliminate illumination differences, removing imaging noise using Gaussian filtering, and then uniformly converting them to the HSV color space to ensure the stability and accuracy of region segmentation and feature extraction. Candidate frames are segmented based on the color distribution features of video frames and normal structures, specifically through the following method: Based on the standardized candidate frames, the regions are uniformly divided into several non-overlapping local sub-regions of a fixed size. This division rule is consistent with the block-based method used in extracting local color distribution features from a single frame. For each local sub-region, the mean features of hue, saturation, and brightness are extracted to form a local color feature vector. This vector is then combined with the baseline vector of normal color distribution to calculate the Euclidean distance, obtaining the color deviation degree of each sub-region. A preset sub-region color deviation threshold is then applied to determine the appropriate local sub-region. If the color deviation of a sub-region is greater than or equal to the color deviation threshold of the sub-region, the region is determined to be a color abnormal region and marked as an initial suspicious sub-region; If the color deviation of a sub-region is less than the color deviation threshold of the sub-region, the region is determined to be a normal tissue region and is not marked. The initial suspicious sub-regions marked in the candidate frame are mapped at the pixel level to construct a binary image matrix. Specifically, the position corresponding to the initial suspicious sub-region is assigned a value of 1, and the position corresponding to the normal tissue region is assigned a value of 0. Finally, the initial suspicious mask is obtained, and the initial segmentation based on color features is completed. For setting the color deviation threshold for sub-regions, based on healthy gynecological endoscopy samples, the color deviation of normal sub-regions is calculated according to the same block division rules. The upper limit of the deviation at 95% confidence level is used as the initial threshold, and then adjusted through clinical video testing to obtain the critical value that can distinguish between normal and color abnormal sub-regions. The initial suspicious region is further segmented based on the edge contour morphology features, specifically implemented through the following method: Based on the initial suspicious region, an edge detection algorithm is used to extract the edge contour lines of the region and obtain the morphological features of the contour. Specifically, according to the initial suspicious mask, an image block containing only the initial suspicious region is cropped from the candidate frame and grayscaled. For the cropped image, Canny edge detection is performed, and low and high thresholds adapted to endoscopic tissues are set to retain only strong edge pixels to generate a binary edge image. A contour discovery algorithm is used on the edge image to traverse the edge pixels and connect continuous edge pixels into closed and open contour lines to complete the extraction of the edge contour lines. For the extracted contour lines, their morphological parameters are calculated. The parameters include contour smoothness, which reflects the curvature difference between adjacent contour points; edge continuity, which reflects the contour breakpoints and the number of truncations; and contour abruptness, which reflects the proportion of straight line segments and the frequency of curvature abruptness. The resulting edge contour morphological features are used for mask optimization. The extracted contour morphological features are compared with the baseline features of normal tissue edge contour morphology. Morphological parameters such as contour closure, smoothness, and curvature continuity are calculated. Only areas with abnormal contour morphology such as truncation, abrupt change, and discontinuity are retained. Pixel-level boundary correction is performed on abnormal contour areas to regularize the area boundaries and obtain the optimized initial suspicious mask. Based on the optimized initial suspicious mask, it is converted into a pure binary image. The foreground abnormal region is white (255), and the background normal region is black (0). The binary mask image is traversed using octal connectivity analysis. Abnormal regions that are adjacent in position and connected to pixels are marked as independent connected regions. The outer contour of each valid connected region is extracted, and after smoothing, a closed boundary is obtained. The closed contour is then mapped back to the original candidate frame. Each independent, smoothed valid connected region is an abnormal feature block. After traversing all valid regions, all the delineated abnormal feature blocks in the candidate frame are output. The smoothed regions are then mapped back to the original candidate frame to delineate the abnormal feature blocks in the candidate frame.
[0025] By using anomaly feature scoring and sorting to identify key lesion frames, the following methods are employed: Based on the abnormal feature blocks that have been defined above, their feature deviation and boundary mutation intensity are extracted. The feature deviation can be obtained through the process of obtaining candidate frames in the above method, and the boundary mutation intensity is calculated through the edge contour morphology features of the abnormal feature blocks. The weighted sum of feature deviation and boundary mutation intensity is used to generate a block significance score for a single anomalous feature block. The anomalous feature blocks in all current candidate frames are traversed, and the significance scores of all blocks are summed to obtain the significance score of the candidate frame. All candidate frames are sorted in descending order of significance score from high to low, and candidate frames with high scores are retained first. The preset threshold for block overlap is used to determine whether inter-frame lesion information is repeated. It is achieved by extracting abnormal feature blocks in consecutive candidate frames in the sample and calculating the ratio of the overlapping area to the merged area of abnormal feature blocks in adjacent candidate frames. Compare the abnormal feature blocks of adjacent candidate frames sequentially after sorting: If the position and contour overlap of two frames of abnormal feature blocks are greater than or equal to the overlap threshold, they are judged as redundant frames and the frame with the lower score is excluded. If the overlap is less than the overlap threshold, it is determined to be an independent valid frame and is retained. After the traversal is completed, the remaining candidate frames with high total significance scores and no information redundancy are used as the final lesion frames.
[0026] In one embodiment of the present invention, to address the problem of false positives and false negatives caused by the inability to distinguish between instrument occlusion and real lesions due to their similar characteristics in a single frame, in step S3, distinguishing features for differentiating between instrument occlusion and real lesions are extracted based on abnormal feature blocks in the lesion frame; wherein, for each abnormal feature block in the lesion frame, the color uniformity and boundary abrupt change intensity of the block are extracted as distinguishing features, wherein the color uniformity of the block is calculated based on the local color distribution features of the abnormal feature block, and the boundary abrupt change intensity is calculated based on the edge contour morphology features of the abnormal feature block; The calculation of color uniformity in blocks is achieved through the following method: Extract the local color distribution features of abnormal feature blocks, specifically including the hue (H) and saturation (S) component values of effective pixels, to form a color feature set. , , where n is the number of valid pixels in the abnormal feature block; Calculate the mean values of hue (H) and saturation (S) to represent the overall color of the area. The calculation formula is as follows: ; ; Based on the mean, to reflect the dispersion of color distribution, its variance is calculated. The larger the variance, the more uneven the color distribution. The calculation formula is as follows: ; ; Based on the characteristics of gynecological endoscopic images, fixed weights are assigned to hue and saturation. , After fusion, the variance is obtained. The calculation formula is as follows: ; After normalizing the variance to the interval [0,1], the color uniformity is obtained through inverse mapping, i.e., the color uniformity of the block = 1 - .
[0027] The intensity of boundary abrupt changes is calculated based on edge contour morphological features, specifically through the following method: Based on anomalous feature blocks, edge contours of the blocks are extracted using Canny edge detection and contour edge algorithms to obtain an ordered set of contour points. Where m is the number of contour points, Let be the x-coordinate of the m-th contour point on the edge of the abnormal feature block in the two-dimensional image of the video frame. Let y be the ordinate of the contour point in the two-dimensional image of the video frame; The local curvature of the contour is calculated point by point. The larger the absolute value of the curvature, the more severe the bending or abrupt change at that point. A curvature close to 0 indicates that the segment is a straight line. The local curvature is calculated using the following method: When calculating the curvature of the i-th contour point, the previous point, the current point, and the next point are taken into the calculation. ; in, , These are the x and y coordinates of the previous point on the contour. , These are the x and y coordinates of the current point, respectively. , These are the x and y coordinates of the next point on the contour. The local curvature at the current point; By calculating the curvature difference between adjacent contour points, points with a difference greater than the curvature threshold are recorded as abrupt change points, and the curvature abrupt change ratio is calculated. By identifying continuous straight line segments with curvature close to 0 in the contour, the straight line segment ratio is calculated. By counting the number of open breaks and discontinuous points in the contour, the contour breakpoint ratio is calculated. After assigning weights to the curvature abrupt change ratio, straight line segment ratio, and contour breakpoint ratio, the boundary abrupt change intensity is calculated by weighted summation. A boundary abrupt change intensity close to 1 indicates a high intensity, which can be preliminarily inferred as instrument obstruction; if it is close to 0, it indicates a low intensity, which can be inferred as a real tissue lesion.
[0028] In one embodiment of the present invention, to distinguish between instrument obstruction and actual lesions, locate the actual lesion area, and solve the problem of false detection and missed detection caused by single-frame lack of verification, in step S4, a judgment logic is established based on endoscopic imaging rules and physiological morphology rules. The judgment logic is used to determine the distinguishing features of abnormal feature blocks to locate the actual lesion area. The step of using the judgment logic to determine the distinguishing features of abnormal feature blocks to locate the actual lesion area includes: performing a preliminary judgment on abnormal feature blocks based on boundary abrupt change intensity and block color uniformity to generate a lesion area and a block to be judged; calculating the contour incompleteness and texture continuity of the block to be judged, wherein the contour incompleteness is calculated based on edge contour morphology features, and the texture continuity is calculated based on local color distribution features; and performing a compensation judgment based on the contour incompleteness and texture continuity of the block to be judged, combined with the lesion area, to locate the actual lesion area. A preliminary judgment is made on the abnormal feature blocks to generate lesion areas and blocks to be judged. Specifically, if the boundary mutation intensity is low and the block color uniformity is high, it is directly judged as a lesion area; if the boundary mutation intensity is high and the block color uniformity is low, the corresponding abnormal feature block is marked as a block to be judged and enters the compensation judgment process. In the above method, the low intensity of boundary mutation and high uniformity of block color can be used to directly identify the lesion area. This is because real lesions (such as mucosal lesions, polyps, inflammatory areas, epithelial lesions, etc.) are pathological changes in the soft tissue of the human body. The lesions are formed by the slow proliferation or mutation of tissue cells. The edges are naturally smooth without discontinuities. The contour curvature is uniform and there are no straight lines or abrupt corners. Therefore, the boundary mutation intensity of the lesion area is low. In contrast, surgical instruments are mostly made of hard metal and other artificial materials. The edges are straight, angular, and abruptly truncated, resulting in high boundary mutation intensity. As for the uniformity of block color, under the standardized HSV color space, the hue and saturation distribution of the lesion tissue is smooth and consistent, with gradual color transition and no strong contrast. Therefore, the uniformity of block color in the lesion area is high. In contrast, the instrument obstruction will cause metallic reflection, abrupt color changes and light and dark discontinuities, and the color uniformity is extremely low. Therefore, this invention can locate the lesion area by boundary mutation intensity and block color uniformity. When the intensity of boundary abrupt changes is high and the color uniformity of the area is low, this situation can occur due to both instrument occlusion and certain special real lesions. For example, erosive lesions with broken edges may exhibit abrupt boundary changes and chaotic color distribution due to tissue defects and viewing angle compression, which is consistent with the characteristics of instrument occlusion. Therefore, it cannot be directly judged and must be marked as pending judgment and enter the compensation judgment. For the pending judgment area, the compensation judgment is performed by calculating the contour incompleteness and texture continuity of the pending judgment area. The contour incompleteness is calculated by statistically analyzing the number of open breakpoints and the proportion of non-closed contours at the edge of the pending judgment area. The higher the value, the more severe the contour incompleteness. The texture continuity is calculated by calculating the pixel gradient smoothness inside the pending judgment area. The higher the value, the more consistent it is with the physiological texture of the tissue. The compensation determination includes: if the contour of the area to be determined has a high degree of incompleteness and the internal texture continuity is high, the compensation determination is a defective lesion area; if the contour of the area to be determined has a low degree of incompleteness and the internal texture continuity is low, the compensation determination is an interference area obstructed by the instrument. The calculation of contour incompleteness is achieved through the following method: Based on the ordered contour point set used to calculate the boundary abrupt change intensity in the above method, the Euclidean distance between the start and end points of the contour is calculated to obtain the tail open breakpoint. By traversing adjacent contour points, the intermediate open breakpoint is obtained. All breakpoints are accumulated to obtain the total number of open breakpoints N. Calculate the total outline length L of the current block to be judged. Specifically, this is done by accumulating the Euclidean distances between adjacent outline points. The total length of the non-closed contour segment is obtained by summing the lengths of the discontinuous contour segments between all breakpoints. Thus, the proportion R of the non-closed contour is calculated, and the calculation formula is: ; Fixed weights are assigned to the number of open breakpoints N and the proportion of non-closed contours R, based on gynecological endoscopy sample data. weighting The higher the contour incompleteness 'a', the more incomplete the contour. Its calculation formula is: ; in, The maximum number of open breakpoints is preset; The calculation of texture continuity is implemented using the following method: Extract the image region of the abnormal feature block to be judged, convert it into a single-channel grayscale image, and obtain the grayscale pixel matrix. The Sobel gradient operator is used to calculate the horizontal gradient. and vertical gradient And synthesize the gradient magnitude of each pixel. ,Right now ; The average gradient magnitude of all pixels within a block is calculated using the following formula: ; The variance of the gradient magnitude is calculated based on the mean, using the following formula: ; Where i is the i-th pixel, and n is the total number of pixels in the block to be judged; The gradient variance is normalized to the [0,1] interval, and the final texture continuity is obtained through reverse mapping.
[0029] In one embodiment of the present invention, anomaly detection is performed based on all real lesion regions within the lesion frame. In step S5, all real lesion regions within the lesion frame are integrated for anomaly detection. It integrates all real lesion regions within a lesion frame, that is, it back-maps the real lesion regions of each frame to the original video and records the features. After validity verification, it summarizes all valid lesion information, completes the comprehensive judgment of video-level anomalies according to clinical rules, and outputs visual annotations and detection conclusions, realizing the whole process from single-frame lesion identification to overall anomaly detection.
[0030] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A method for real-time processing and abnormality detection of gynecological endoscopic video, characterized in that, Includes the following steps: The video frames are determined, and the single-frame features within each video frame are extracted. The single-frame features are then compared with the preset normal organization benchmark features to obtain candidate frames. For each candidate frame, region segmentation is performed to delineate all abnormal feature blocks that deviate from normal tissue within the candidate frame. Abnormal discrimination features of the abnormal feature blocks are extracted to calculate the salience score of the candidate frame. The salience scores are used to sort and filter the candidate frames to obtain the lesion frames. Based on abnormal feature blocks in the lesion frame, distinguishing features are extracted to differentiate between instrument occlusion and real lesions; Based on the laws of endoscopic imaging and physiological morphology, a judgment logic is established, and the judgment logic is used to determine the distinguishing features of abnormal feature blocks in order to locate the real lesion area. Integrate all real lesion regions within the lesion frame for anomaly detection.
2. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 1, characterized in that: The single-frame features include local color distribution features and edge contour morphology features, and the reference features include color distribution reference features and edge contour morphology reference features of normal tissue standard.
3. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 1, characterized in that, The steps for obtaining candidate frames by comparing single-frame features with baseline features include: Acquire video frames captured in real time by gynecological endoscopy, extract single-frame features from the video frames, and call the baseline features of normal tissue; Calculate the Euclidean distance between the vector of local color distribution features and the vector of color distribution reference in the current video frame to obtain the color deviation. Calculate the similarity between the edge contour feature vector and the edge contour reference vector in the current video frame to obtain the contour deviation. Based on color deviation and contour deviation, feature deviation is generated; Candidate frames are obtained by comparing the feature deviation with a preset deviation threshold.
4. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 3, characterized in that, The step of comparing candidate frames based on feature deviation with a preset deviation threshold includes: If the feature deviation is greater than or equal to the deviation threshold, it is determined that there is an abnormal feature deviation in the corresponding video frame, and the video frame is marked as a candidate frame. If the feature deviation is less than the deviation threshold, the corresponding video frame is determined to be a normally organized frame and is directly discarded.
5. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 1, characterized in that, The step of performing region segmentation on each candidate frame to delineate all abnormal feature blocks deviating from normal tissue within the candidate frame includes: After standardizing the candidate frames, the candidate frames are segmented based on the local color distribution features and the color distribution baseline features of normal tissues, the initial suspicious regions are marked, and the initial suspicious mask is generated. The initial suspicious region is further segmented based on the edge contour morphology features to optimize the initial suspicious mask; Connectivity extraction and boundary regularization are performed on the optimized initial suspicious mask to delineate abnormal feature blocks within the output candidate frames.
6. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 1, characterized in that, The step of extracting distinguishing features based on abnormal feature blocks in the lesion frame to differentiate between instrument occlusion and real lesions includes: For each abnormal feature block within the lesion frame, the block color uniformity and boundary abrupt change intensity are extracted as distinguishing features. The block color uniformity is calculated based on the local color distribution features of the abnormal feature block, and the boundary abrupt change intensity is calculated based on the edge contour morphology features of the abnormal feature block.
7. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 1, characterized in that, The step of using judgment logic to determine the distinguishing features of abnormal feature blocks in order to locate the actual lesion area includes: Based on the intensity of boundary mutations and the uniformity of block color, a preliminary judgment is made on abnormal feature blocks to generate lesion areas and blocks to be judged. The contour incompleteness and texture continuity of the block to be judged are calculated, wherein the contour incompleteness is calculated based on the edge contour morphology features, and the texture continuity is calculated based on the local color distribution features; Based on the contour incompleteness and texture continuity of the area to be judged, compensation judgment is made, and combined with the lesion area, the true lesion area is located.
8. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 7, characterized in that, The step of performing a preliminary judgment on abnormal feature blocks to generate lesion areas and blocks to be judged includes: If the boundary mutation intensity is low and the color uniformity of the block is high, it is directly identified as a lesion area; If the boundary mutation intensity is high and the color uniformity of the block is low, the corresponding abnormal feature block will be marked as a block to be judged and enter the compensation judgment process.
9. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 7, characterized in that, The calculation of the contour incompleteness and texture continuity includes: The contour incompleteness is calculated by statistically analyzing the number of open breakpoints and the proportion of non-closed contours at the edge of the block to be judged. The texture continuity is calculated by calculating the pixel gradient smoothness within the block to be judged.
10. The method for real-time processing and abnormality detection of gynecological endoscopic video according to claim 7, characterized in that, The compensation determination steps include: If the outline of the area to be judged has a high degree of incompleteness and the internal texture has a high degree of continuity, it is judged as a lesion area with incompleteness. If the outline of the area to be judged has low incompleteness and low internal texture continuity, it is judged as an interference area blocked by the instrument.