Capsule endoscopy hemorrhagic spot identification and analysis method based on near infrared spectrum

By constructing a zonal map and analyzing event chains using near-infrared spectroscopy, the interference problem in capsule endoscopy bleeding detection was solved, enabling high-precision, dynamic bleeding point identification and diagnostic support, thus improving the accuracy of detection and its clinical application value.

CN121661686APending Publication Date: 2026-03-13CHANGDE FIRST PEOPLES HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-03-13

Smart Images

  • Figure CN121661686A_ABST
    Figure CN121661686A_ABST
Patent Text Reader

Abstract

The invention discloses a capsule endoscopy hemorrhagic spot identification and analysis method based on near infrared spectrum, and relates to the technical field of hemorrhagic spot identification, a video sequence which is shot by a capsule endoscopy and contains near infrared spectrum information is acquired, and a first frame image is selected as a substrate image; generating a partition map based on the base image, and constructing an index between the partition map and the base image; processing a subsequent frame image through multi-stage scanning, and generating and overlapping a scanning layer which protrudes out of the suspected hemorrhage area; an event recording unit is constructed for the suspected bleeding area in each scanning image and used for collecting image feature data of the suspected bleeding area; fusing the image feature data based on an image fusion process to generate an event chain of the suspected bleeding region; generating and visualizing a structured hemorrhage analysis report by analyzing the event chain and the inspection index; according to the invention, through sequential event chain analysis and near infrared spectrum feature fusion, the specificity, reliability and clinical decision support value of hemorrhagic spot recognition are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of bleeding point recognition technology, specifically to a method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy. Background Technology

[0002] In the existing technologies for detecting gastrointestinal bleeding in capsule endoscopy, the mainstream methods mainly rely on computer vision analysis or deep learning recognition of visible light color images. These methods usually identify red-toned areas, specific texture patterns, or directly select suspected bleeding sites by using trained convolutional neural networks. However, these methods have some limitations. First, features based on color and texture are easily affected by changes in intestinal contents such as food residue, bile, and the color of the mucosa itself, leading to a high false positive rate and affecting the efficiency of clinical judgment. Second, most existing methods perform static analysis on single-frame images, which cannot effectively distinguish between active bleeding and old blood clots from the temporal dimension of video sequences. They also cannot filter out transient artifacts caused by rapid camera movement or instantaneous mucosal reflection, reducing the stability and reliability of the detection results. Third, the output of existing technologies is usually a simple bounding box or pixel-level mask mark, which lacks precise correlation with the anatomical structure of the digestive tract and cannot intuitively show the complete dynamic evolution process of the bleeding point from appearance to disappearance, thus limiting its clinical application value in assessing bleeding activity, risk classification, and achieving precise localization. Therefore, it is of great significance to develop a method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy. Summary of the Invention

[0003] The purpose of this invention is to provide a method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy, so as to solve the problems in the background technology.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy, comprising: Acquire video sequences containing near-infrared spectral information captured by capsule endoscopy, and select the first frame image as the base image; Image recognition is performed on the base image to generate various partitions of the inspection area, generating a partition map, and constructing an inspection index between the partition map and the base image; Using the base image as a reference, subsequent frame images are scanned step by step to generate suspected bleeding areas. The completed frame images are used as scan images, and multiple scan layers are processed and superimposed on the base image. An event recording unit is constructed for each suspected bleeding area in each scan image to collect image feature data of the suspected bleeding area; An event chain for generating suspected bleeding areas is generated by fusing image feature data based on the image fusion process; A structured bleeding analysis report is generated by analyzing event chains and inspection indexes, and the structured bleeding analysis report is then visualized.

[0005] In a preferred embodiment, the steps of generating various partitions of the inspection region by performing image recognition on the base image to generate a partition map, and constructing an inspection index of the partition map and the base image are as follows: Superpixel segmentation is performed on the base image to generate multiple uniform initial image patches; Texture features, color features, and near-infrared spectral features of each initial image patch are extracted based on feature extraction algorithms; Based on the texture features, color features, and near-infrared spectral features, a neural network is used to classify the initial image patch into different types of tissue partitions. Initial image patches that are classified as the same type of tissue partition and are spatially adjacent are merged to form various tissue partitions with continuous spatial range; Assign a unique partition identifier to each organizational partition. The partition identifier includes organizational type attributes and spatial boundary information. A partition map is generated based on the partition identifier, and a mapping relationship is established from each tissue partition in the partition map to the corresponding pixel region in the base image as an inspection index.

[0006] In a preferred embodiment, the steps of using the base image as a reference to perform step-by-step scanning of subsequent frame images to generate suspected hemorrhage areas, using the completed frame images as scan images, and registering multiple scan layers with the base image are as follows: Define a preset number of frames and label the preset near-infrared band intensity in each frame image. Combine the frame images with the same preset near-infrared band intensity into a set of images to be scanned. The set of images to be scanned is scanned level by level with a preset number of levels, where the preset number of levels is the same as the preset number of frames. The step-by-step scanning operation includes performing a bleeding feature recognition algorithm on each frame of the image to obtain suspected bleeding areas; Each frame of the image is pixel-level segmented to generate the region to be detected, and the reflection intensity of the region to be detected to the corresponding preset near-infrared band intensity is obtained as the spectral feature. The spectral features are compared with the preset bleeding feature threshold range, and the areas to be detected that fall within the bleeding feature threshold range are marked as suspected bleeding areas. The frame image after the bleeding feature recognition algorithm has been executed is output as a scan image; The generated scan image is processed and then overlaid with the base image.

[0007] In a preferred embodiment, the step of processing the generated scan image and overlaying it with the base image is as follows: Visual degradation processing is performed on the image areas other than suspected bleeding areas in each scan image to generate a degradation layer for the corresponding scan image; Spatial registration is performed between the downgraded layers generated from each level of scanned images and the base image; Following the hierarchical order of scanning, the downgraded layers of each level of scan image are sequentially superimposed on the base image to generate a multi-layered overlay image.

[0008] In a preferred embodiment, the step of constructing an event recording unit for the suspected hemorrhage area in each scan image to collect image feature data of the suspected hemorrhage area is as follows: An event recording unit is constructed for each suspected bleeding area to collect image feature data. A dual-channel transmission interface is deployed on the event recording unit for interaction with other event recording units. For each suspected bleeding area in the scan image, the examination index is queried based on its pixel coordinates to determine one or more tissue partitions in the partition map to which it belongs, and the corresponding partition identifier is recorded. Extract the reflection intensity of the suspected hemorrhage area in the preset near-infrared band of the scan image and mark the scan timestamp; Extract the spatial morphological features of the suspected hemorrhage area in the scan image, including the area, outline shape, and positional coordinates relative to the tissue region; The corresponding partition identifier, reflection intensity, scan timestamp, and spatial morphological features are encapsulated as image feature data and stored in the event recording unit.

[0009] In a preferred embodiment, the step of fusing image feature data based on the image fusion process to generate the event chain of suspected bleeding areas is as follows: Based on the partition identifier recorded in the event log unit, all event log units are grouped according to their respective organizational partitions; For all event record units within the same organizational partition, sort them in ascending order according to their recorded timestamps, and then connect the event record units sequentially based on the sorting to generate an event chain.

[0010] In a preferred embodiment, the step of generating a structured bleeding analysis report for the examined region by analyzing the event chain and examining the index is as follows: The event chain is continuously analyzed to determine whether an event chain consists of consecutive event record units exceeding a preset threshold. If so, the event chain is determined to be continuous, representing a stable bleeding target. For determining the location and region of bleeding points through continuous analysis of event chains; The average of the center point coordinates of the suspected bleeding area recorded by all event recording units in the event chain is taken as the final coordinates of the bleeding point. Take the union of the spatial morphological features of the suspected bleeding areas recorded by all event recording units in the event chain as the comprehensive bleeding area of ​​the bleeding point; Based on the partition where the comprehensive bleeding area is located, the final coordinates of the bleeding points and the comprehensive bleeding area are mapped onto the base image by checking the index to generate a structured bleeding analysis report.

[0011] In a preferred embodiment, the step of visualizing the structured bleeding analysis report is as follows: Assign each bleeding point a visual label containing a unique number, the tissue partition identifier, and the corresponding event chain identifier; Dynamic features of the comprehensive bleeding area are extracted based on event chains obtained through continuous analysis; A timeline was constructed to display the dynamic characteristics of the complex hemorrhage area, including the reconstruction of the spatial morphological changes and near-infrared spectral characteristics of each complex hemorrhage area. The visualization results of the structured bleeding analysis report are displayed by associating the visualization labels with the timeline.

[0012] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. This invention achieves high-precision and reliable identification of bleeding points by constructing a spatial reference system of base image partitioning maps and inspection indexes, combined with the temporal analysis method of event chains. Simultaneously, it utilizes the biochemical specific characteristics of near-infrared spectroscopy for initial screening, effectively distinguishing it from traditional color and texture methods. This fundamentally eliminates the influence of color-similar interfering objects such as food residue. Furthermore, it introduces multi-level scanning and an event chain model to upgrade single-frame static identification to cross-temporal dynamic process analysis. By verifying the spatial persistence and feature stability of suspected targets in consecutive frames, it can filter out transient false alarms caused by instantaneous reflections or noise, ensuring that the finally confirmed bleeding points have a credible basis in the temporal dimension. Based on the anatomical context provided by the partitioning map and calculating the average coordinates of all observation data in the event chain to obtain the comprehensive bleeding area, the output of the bleeding point is a complete description integrating precise anatomical location, spatiotemporal evolution range, and stable spectral characteristics, providing rich structured information for clinical diagnosis. 2. This invention effectively improves the efficiency and accuracy of bleeding point identification through a designed step-by-step scanning and visual degradation processing mechanism. This mechanism simulates the cognitive process of human observation, which progresses from coarse to fine and gradually focuses. After each level of scanning, non-suspected areas are actively grayscaled or blurred, simplifying the image background layer by layer. Suspected bleeding areas, on the other hand, become more prominent as they retain their original colors and details. In the final multi-layered overlay image, the bleeding area contrasts sharply with the dark background, significantly improving doctors' ability to detect small or blurred lesions. Furthermore, the combination of this mechanism with the event chain can dynamically demonstrate the complete process of the bleeding area from its appearance, evolution, to stabilization, condensing key information scattered across multiple video frames into an intuitive evolutionary animation, providing rich visual evidence for clinical diagnosis. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0014] Figure 1 This is a flowchart of the method of the present invention.

[0015] Figure 2 This is a logic block diagram of the present invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0017] Example 1, please refer to Figure 1 and Figure 2 As shown in this embodiment, a method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy includes: S1. Acquire a video sequence containing near-infrared spectral information captured by a capsule endoscope, and select the first frame image as the base image; S2. Perform image recognition on the base image to generate various partitions of the inspection area, generate a partition map, and construct an inspection index between the partition map and the base image; S3. Using the base image as a reference, perform step-by-step scanning of subsequent frame images to generate suspected bleeding areas. Use the completed frame images as scan images, process multiple scan layers, and overlay them with the base image. S4. Construct an event recording unit for the suspected bleeding area in each scan image to collect the image feature data of the suspected bleeding area. S5. Based on the image fusion process, fuse image feature data to generate an event chain for suspected bleeding areas; S6. Generate a structured bleeding analysis report for the inspection area by analyzing the event chain and inspection index, and visualize the structured bleeding analysis report; As described in steps S1-S6 above, in the existing technologies for detecting gastrointestinal bleeding by capsule endoscopy, the mainstream methods mainly rely on computer vision analysis or deep learning recognition of visible light color images. These methods usually identify red-toned areas, specific texture patterns, or directly select suspected bleeding sites by using trained convolutional neural networks. However, these methods have some limitations. First, features based on color and texture are easily affected by changes in intestinal contents such as food residue, bile, and the color of the mucosa itself, leading to a high false positive rate and affecting the efficiency of clinical judgment. Second, most existing methods perform static analysis on single-frame images, which cannot effectively distinguish between active bleeding and old blood clots from the temporal dimension of video sequences. They also cannot filter out transient artifacts caused by rapid camera movement or instantaneous mucosal reflection, reducing the stability and reliability of the detection results. Third, the output of existing technologies is usually a simple bounding box or pixel-level mask mark, which lacks precise correlation with the anatomical structure of the digestive tract and cannot intuitively show the complete dynamic evolution process of the bleeding point from appearance to disappearance, thus limiting its clinical application value in assessing bleeding activity, risk classification, and achieving precise localization. This invention achieves high-precision and reliable identification of bleeding points by constructing a spatial reference system of base image partitioning maps and examination indexes, combined with a temporal analysis method of event chains. Simultaneously, it utilizes the biochemical specific characteristics of near-infrared spectroscopy for initial screening, effectively distinguishing it from traditional color and texture methods. This fundamentally eliminates the influence of color-similar interfering objects such as food residue. Furthermore, it introduces multi-level scanning and an event chain model to upgrade single-frame static identification to cross-temporal dynamic process analysis. By verifying the spatial persistence and feature stability of suspected targets across multiple consecutive frames, it can filter out transient false alarms caused by instantaneous reflections or noise, ensuring that the finally confirmed bleeding points have a credible temporal basis. Based on the anatomical context provided by the partitioning map and calculating the average coordinates of all observation data in the event chain to obtain the comprehensive bleeding area, the output of the bleeding point is a complete description integrating precise anatomical location, spatiotemporal evolution range, and stable spectral characteristics, providing rich structured information for clinical diagnosis. By designing a progressive scanning and visual degradation processing mechanism, the system efficiency and accuracy of bleeding point identification are effectively improved. This mechanism simulates the cognitive process of human observation, which progresses from coarse to fine and gradually focuses. After each level of scanning, non-suspected areas are actively downgraded by graying or blurring, simplifying the image background layer by layer. Suspected bleeding areas, on the other hand, become more prominent because they retain their original colors and details. In the final multi-layered superimposed image, the bleeding area contrasts sharply with the dark background, significantly improving doctors' ability to detect small or blurred lesions. At the same time, the combination of this mechanism and the event chain can dynamically demonstrate the complete process of the bleeding area from its appearance, evolution to stabilization, condensing key information scattered in multiple video frames into an intuitive evolution animation, providing rich visual evidence for clinical diagnosis.

[0018] In one embodiment, step S2, which involves generating various partitions of the inspection region from the base image through image recognition, creating a partition map, and constructing an inspection index between the partition map and the base image, includes: S21. Perform superpixel segmentation on the base image to generate multiple uniform initial image blocks; S22. Extract the texture features, color features, and near-infrared spectral features of each initial image patch based on the feature extraction algorithm; S23. Based on the texture features, color features, and near-infrared spectral features, the initial image patch is classified into different types of tissue partitions using a neural network; S24. Merge the initial image blocks that are classified as the same type of tissue partition and are spatially adjacent to each other to form various tissue partitions with continuous spatial range; S25. Assign a unique partition identifier to each organizational partition. The partition identifier includes organizational type attributes and spatial boundary information. S26. Generate a partition map based on the partition identifier, and establish a mapping relationship from each tissue partition in the partition map to the corresponding pixel region in the base image as an inspection index; As described in steps S21-S26 above, firstly, a simple linear iterative clustering algorithm is used to perform superpixel segmentation on the base image, dividing the image into hundreds of initial image patches of uniform size and with boundaries that fit the texture. Then, three types of features are extracted from each initial image patch: texture features are quantified by calculating local binary mode descriptors to represent its microstructure pattern; color features are characterized by converting to the HSV color space and statistically analyzing its hue and saturation distribution; and near-infrared spectral features are obtained by extracting the average reflectance intensity of the corresponding region in a preset near-infrared band from the registered multi-band image. These features are then combined into a feature vector, which is input into a pre-trained deep convolutional neural network model. This model outputs the probability that each initial image patch belongs to a predefined type of tissue partition, and determines the tissue partition category of the image patch based on the highest probability type. Finally, a region-growing-based merging algorithm is used to aggregate spatially adjacent initial image patches with the same tissue partition category, forming... The system comprises various tissue partitions with continuous spatial extents. These partition types include, but are not limited to, densely vascularized vascular areas, mucosal folds with regularly undulating textures, relatively smooth and flat mucosal areas, and lymphoid follicles that may contain special structures. These partition categories are predefined based on prior medical knowledge and are learned using a large number of labeled samples during the neural network training phase. This enables the network to accurately classify each initial image patch into the corresponding tissue partition type based on the extracted texture, color, and near-infrared spectral features. Each merged tissue partition is assigned a unique partition identifier, which clearly records its tissue type attributes and spatial boundary information obtained through calculation. Finally, all tissue partitions, their identifiers, and boundary information are integrated to generate a structured partition map. Simultaneously, a mapping table is constructed from each tissue partition in the partition map to the corresponding pixel coordinates in the base image, serving as a check index for subsequent rapid retrieval and localization.

[0019] In one embodiment, step S3, which uses the base image as a reference to perform progressive scanning of subsequent frame images to generate suspected hemorrhage areas, uses the completed frame images as scan images, and performs image registration of multiple scan layers and superimposes them with the base image, includes: S31. Define the preset number of frames and mark the preset near-infrared band intensity in each frame image. Combine the frame images with the same preset near-infrared band intensity into a set of images to be scanned. S32. Perform a step-by-step scan of the image set to be scanned at a preset number of levels, wherein the preset number of levels is the same as the preset number of frames; S33. The step-by-step scanning operation includes performing a bleeding feature recognition algorithm on each frame of the image to obtain suspected bleeding areas; S34. Perform pixel-level segmentation on each frame of the image to generate the region to be detected, and obtain the reflection intensity of the region to be detected to the corresponding preset near-infrared band intensity as the spectral feature. S35. Compare the spectral features with the preset bleeding feature threshold range, and mark the areas to be detected that are within the bleeding feature threshold range as suspected bleeding areas. S36. Output the frame image after the bleeding feature recognition algorithm has been executed as a scan image; S37. Perform image processing on the generated scan image and overlay it with the base image; As described in steps S31-S37 above, firstly, based on the near-infrared light of different specific wavelengths emitted sequentially by the capsule endoscopy system, each subsequent frame of image is categorized according to the illumination band corresponding to its imaging, forming several band-based sets of images to be scanned. Each set contains multiple consecutive frames of images acquired from illumination of the same band. During implementation, because the switching interval of near-infrared light is very small, the reflection intensity values ​​of the same image at the same time for different specific wavelengths of near-infrared light can be obtained. Subsequently, an independent scanning level processing is performed on each set of images to be scanned, and the total number of scanning levels is equal to the number of different wavelengths. In each scanning level, the system uses the same core bleed feature recognition algorithm to process each frame of the set. This algorithm first uses a simple linear iterative clustering superpixel segmentation method to divide the image into a large number of uniform detection regions. Then, it calculates the average pixel reflectance intensity of each detection region in the corresponding band of the current frame, directly using this reflectance intensity value as the spectral feature of that region at the current scanning level. Next, the system compares this calculated spectral feature value with the bleed feature threshold range corresponding to a specific band. If the reflectance intensity value falls within the threshold range of that band, the detection region is classified as a bleed feature at the current scanning level of the current frame. The area was marked as a suspected bleeding area. The bleeding characteristic threshold range was obtained based on neural network training, including collecting and constructing a large-scale sample database precisely labeled using clinical gold standards. This database contains a large number of capsule endoscopy multi-band near-infrared image data blocks covering normal mucosa, various bleeding lesions, and common interfering substances such as food residue and bile. Subsequently, for each sample image block in the database, the average reflectance intensity value under each specific band was extracted from both the physician-labeled bleeding area and the normal area, forming a characteristic value distribution set for each band. Then, statistical analysis methods were used to calculate the characteristic value distribution of the bleeding area under each band. The system identifies the concentration range of the hemorrhage distribution and the concentration range of the normal tissue feature value distribution. Using machine learning algorithms such as support vector machines or probability distribution-based models, it seeks the decision boundary that best distinguishes between the two distributions. This decision boundary, combined with pre-defined diagnostic sensitivity and specificity requirements, is transformed into a hemorrhage feature threshold range corresponding to each specific band. This range is typically represented as the upper and lower limits of a reflectance intensity value. After completing all levels of scanning, each frame of the original image is converted into a corresponding scan image. All marked suspected hemorrhage areas in the image retain their original color and brightness, while the remaining non-suspected areas are uniformly converted to grayscale images to achieve visual degradation.Finally, the system employs feature point matching technology based on scale-invariant feature transform algorithm to perform sub-pixel-level spatial geometric registration of all scanned images and the base image. These scanned images are then sequentially superimposed on the base image in a semi-transparent manner according to the scan layer order to synthesize the final multi-layered overlay image. The semi-transparency method utilizes channel blending technology, weighting and fusing each pixel of the upper layer image (the downgraded layer of the scanned image) with the color value of the corresponding pixel in the lower layer image using a certain transparency value. The system assigns a global transparency coefficient between 0 and 1 to each scanned layer. A coefficient of 0 indicates complete transparency and is invisible, while 1 indicates complete opacity and full coverage. A middle value, such as 0.5, results in a semi-transparent layer, allowing the colors and details of the underlying image to show through. This ensures that the anatomical structures of the underlying layer and the suspected hemorrhage areas marked on the upper layer are clearly presented in the final overlay image, achieving effective information overlay and visualization.

[0020] In one embodiment, step S37, which involves image processing of the generated scan image and overlaying it with the base image, includes: S371. Perform visual degradation processing on the image areas other than the suspected bleeding areas in each scan image to generate a degradation layer for the corresponding scan image. S372. Spatial registration is performed between the downgraded layers generated from each level of scanned image and the base image; S373. Following the hierarchical order of the scanning, the downgraded layers of each level of the scanned image are sequentially superimposed on the reference image to generate a multi-layered overlay image. As described in steps S371-S373 above, firstly, visual degradation processing is performed on each scanned image. This processing identifies and separates suspected bleed areas in the image using image segmentation technology. Then, a grayscale conversion and Gaussian blur combination algorithm is applied to all background parts of the image except for these areas. Specifically, the background part is first converted from RGB color space to grayscale image and its overall contrast is reduced. Then, a Gaussian convolution kernel with adjustable standard deviation is applied for blurring to weaken texture details, thereby generating a degradation layer where only the background is weakened while the suspected bleed areas retain their original color and clarity. Next, spatial registration is performed. The system uses a scale-invariant feature transformation algorithm to extract key points and feature descriptors from the base image and each degradation layer. Reliable matching point pairs are selected through nearest neighbor matching and random sampling consistency algorithms, and an accurate homography transformation matrix is ​​calculated accordingly. This matrix is ​​used to perform geometric correction and resampling on each degradation layer to make it perfectly aligned with the base image at the pixel level. Finally, multi-layer overlay is performed. The system follows the scanning layer order from low to high, and... Each registered downgraded layer is then pixel-level composited with the base image based on the alpha channel. During the composite process, the overall transparency of each layer is controlled by preset layer weight coefficients. An opaque mask is applied to the suspected bleed areas in each layer to ensure that their color information is not lost during superposition. The final result is a multi-layered overlay image in which the background information is gradually weakened while the suspected bleed areas are synchronously and clearly highlighted. Furthermore, a planar light source is constructed at the bottom of the multi-layered overlay image to enhance the contrast between the suspected and non-bleed areas. The steps are as follows: First, the multi-layered overlay image is converted into a luminance channel, for example, from the RGB color space to the HSL or Lab color space and the L component is extracted. Then, this luminance channel is inverted and a two-dimensional Gaussian blur kernel with uniform intensity and covering the entire image is applied to generate a simulated backlight diffusion halo layer. Then, the backlight diffusion halo layer is additively blended with the original multi-layered overlay image with a low transparency to achieve the brightening operation of the multi-layered overlay image.

[0021] In one embodiment, step S4, which involves constructing an event recording unit for each suspected hemorrhage area in a scan image to collect image feature data of the suspected hemorrhage area, includes: S41. Construct an event recording unit for each suspected bleeding area to collect image feature data, and deploy a dual-channel transmission interface on the event recording unit for interaction with other event recording units; S42. For each suspected bleeding area in the scan image, query the inspection index based on its pixel coordinates to determine one or more tissue partitions in the partition map to which it belongs, and record the corresponding partition identifier. S43. Extract the reflection intensity of the suspected hemorrhage area in the preset near-infrared band of the scan image and mark the scan timestamp; S44. Extract the spatial morphological features of the suspected hemorrhage area in the scan image, including the area, outline shape, and positional coordinates relative to the tissue region. S45. Encapsulate the corresponding partition identifier, reflection intensity, scan timestamp, and spatial morphological features into image feature data and store it in the event recording unit; As described in steps S41-S45 above, firstly, a structured data object is instantiated in memory as an event recording unit for each marked suspected bleeding area. This unit has two logical data channels: an input channel and an output channel. These channels are accessed through a predefined application programming interface, enabling bidirectional exchange and synchronization of feature data and status information between different event recording units according to a preset protocol. Next, for each suspected bleeding area in the scan image, the previously constructed inspection index is accessed through its pixel coordinate set. This inspection index is a hash table storing a fast mapping relationship from pixel coordinates to tissue partition identifiers. This hash table is used to query and determine the one or more tissue partitions to which the area belongs. The system records the corresponding partition identifier string in the event recording unit. Then, it extracts the average reflection intensity of the specific preset near-infrared band corresponding to the current scanning level from the original near-infrared image data of the region. At the same time, it obtains and records the precise scanning timestamp of the image frame from the metadata of the image acquisition system. The system calculates the total number of connected pixels in the region using an image processing algorithm to obtain the region area, uses a boundary tracking algorithm to obtain its contour shape, and determines the relative position coordinates by calculating the offset between its centroid coordinates and the boundary of the tissue partition to which it belongs. Finally, the system serializes the obtained partition identifier, reflectance ratio, scanning timestamp, and all spatial morphological feature data, encapsulates them into a complete data packet, and stores it in the corresponding event recording unit.

[0022] In one embodiment, step S5, which involves fusing image feature data based on an image fusion process to generate an event chain for a suspected hemorrhage area, includes: S51. Based on the partition identifier recorded in the event log unit, group all event log units according to their respective organizational partitions; S52. For all event record units within the same organizational partition, sort them in ascending order according to their recorded timestamps, and connect the event record units sequentially based on the sorting to generate an event chain. As described in steps S51-S52 above, the system first traverses all created event record units in the multi-layer overlay image, reads the partition identifier string stored in each unit, and uses a hash table data structure to quickly group units according to the identifier. The key of the hash table is the partition identifier, and the value is a set of references to all event record units belonging to that partition, thus efficiently classifying all units according to their respective organizational partitions. For each key-value pair in the hash table corresponding to the set of event record units within the same organizational partition, the system uses a quicksort-based algorithm to sort all units in ascending order according to the scan timestamp values ​​of their internal records, ensuring that the units are strictly organized in chronological order. After completing the chronological sorting, the system iteratively traverses the sorted unit list to construct an event chain for each organizational partition. The event chain is represented in data structure as an ordered linked list or array, where each node corresponds to an event record unit, and the nodes are connected through a set dual-channel transmission interface.

[0023] In one embodiment, step S6, which generates a structured bleeding analysis report for the examined area by analyzing the event chain and the examination index, includes: S61. Perform a continuous analysis on the event chain to determine whether an event chain consists of consecutive event record units exceeding a preset threshold. If so, the event chain is determined to be continuous, representing a stable bleeding target. S62. Determine the location and region of bleeding points for event chains analyzed continuously; S63. Take the average of the center point coordinates of the suspected bleeding area recorded by all event recording units in the event chain as the final coordinates of the bleeding point; S64. Take the union of the spatial morphological features of the suspected bleeding areas recorded by all event recording units in the event chain as the comprehensive bleeding area of ​​the bleeding point. S65. Based on the partition where the comprehensive bleeding area is located, the final coordinates of the bleeding point and the comprehensive bleeding area are mapped onto the base image by checking the index to generate a structured bleeding analysis report. As described in steps S61-S65 above, a persistence analysis is performed on each generated event chain. This analysis is accomplished by calculating the total number of event record units contained in the event chain and comparing it with a preset integer threshold. If the number of units in the chain is greater than the threshold, the event chain is determined to be persistent and represents a stable bleeding target, thus entering the subsequent processing flow. For event chains that pass persistence verification, the precise location and comprehensive area of ​​the bleeding point are determined. In the location determination stage, the system traverses each event record unit in the event chain, reads the center point coordinates of the suspected bleeding area recorded in the spatial morphological features stored in the unit, sums the coordinates of all units according to their horizontal and vertical coordinate components, and divides them by the total number of units to obtain the arithmetic mean. This average value is used as the final coordinates of the bleeding point in the image coordinate system. In the area determination stage, the system similarly traverses all units in the event chain and reads the center point coordinates of each event record unit. The polygonal regions defined by the contour shape features stored in the unit are used to calculate the union of these polygonal regions sequentially using a polygon merging algorithm in computational geometry. Finally, a minimum convex polygon or complex polygon that can completely cover the bleed range of all time points is obtained as the comprehensive bleed region. Finally, based on the tissue partition identifier to which the comprehensive bleed region belongs, the index is queried to obtain the spatial boundary mapping relationship of the partition in the base image. According to this relationship, the final coordinates of the calculated bleed points are mapped to the corresponding pixel positions on the base image through affine transformation. The vertex coordinates of the contour polygon of the comprehensive bleed region are also transformed to the base image coordinate system. Then, these coordinate information, together with the partition identifier, event chain identifier, and text information such as the continuous analysis conclusion, are organized according to the preset report template format to generate a structured bleed analysis report containing bleed point location illustrations and text descriptions.

[0024] In one embodiment, step S6, which visualizes the structured bleeding analysis report, includes: S66. Assign each bleeding point a visual label containing a unique number, the tissue partition identifier, and the corresponding event chain identifier; S67. Extract the dynamic features of the comprehensive bleeding area based on the event chain through continuous analysis; S68. Construct a time axis to display the dynamic characteristics of the comprehensive hemorrhage area, including reconstructing the spatial morphological changes and near-infrared spectral characteristic change trends of each comprehensive hemorrhage area; S69. Link the visualization labels with the timeline to display the visualization results of the generated structured bleeding analysis report; As described in steps S66-S69 above, firstly, a visual label is generated for each confirmed bleeding point listed in the structured report. This label is assigned a unique number using a globally unique identifier generation algorithm and clearly marks its corresponding tissue partition identifier and the event chain identifier used to generate the bleeding point, forming a set of clickable and interactive graphical label elements. Subsequently, based on the dynamic features extracted from the event chain through continuous analysis, the system traverses all event record units in the event chain sorted by time, sequentially reading the scan timestamp, the contour shape included in the spatial morphological features, and the reflectance ratio in the image feature data stored in each unit. This data is then organized into a time series to form the original data sequence describing the evolution of the bleeding area. Next, the system constructs a visual timeline, which linearly represents the time range covered by the event chain. The system encloses and renders the spatial morphological changes of the overall bleed area at corresponding time points. This is achieved by overlaying the outline shape corresponding to each time stamp onto the corresponding position of the base image in a chronological manner with progressively varying color depths or transparency. Simultaneously, a line graph is drawn below the same timeline to show the trend of reflectance ratio changes over time. Finally, the system establishes a two-way association between visual labels and the timeline in the graphical interface. When a user clicks on a visual label for a bleed point, the interface automatically highlights it and jumps to the corresponding paragraph on the timeline displaying the dynamic characteristics of that point. Conversely, when a user browses a specific moment on the timeline, the labels for related bleed points are also activated, thus integrating discrete bleed point information with a continuous dynamic evolution process into a unified interactive visualization view to generate the final visualization analysis report.

[0025] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy, characterized in that, Acquire video sequences containing near-infrared spectral information captured by capsule endoscopy, and select the first frame image as the base image; Image recognition is performed on the base image to generate various partitions of the inspection area, generating a partition map, and constructing an inspection index between the partition map and the base image; Using the base image as a reference, subsequent frame images are scanned step by step to generate suspected bleeding areas. The completed frame images are used as scan images, and multiple scan layers are processed and superimposed with the base image. An event recording unit is constructed for each suspected bleeding area in each scan image to collect image feature data of the suspected bleeding area; An event chain for generating suspected bleeding areas is generated by fusing image feature data based on the image fusion process; A structured bleeding analysis report is generated by analyzing event chains and inspection indexes, and the structured bleeding analysis report is then visualized.

2. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 1, characterized in that, The steps for generating various partitions of the inspection area from the base image through image recognition, generating a partition map, and constructing an inspection index between the partition map and the base image are as follows: Superpixel segmentation is performed on the base image to generate multiple uniform initial image patches; Texture features, color features, and near-infrared spectral features of each initial image patch are extracted based on feature extraction algorithms; Based on the texture features, color features, and near-infrared spectral features, a neural network is used to classify the initial image patch into different types of tissue partitions. Initial image patches that are classified as the same type of tissue partition and are spatially adjacent are merged to form various tissue partitions with continuous spatial range; Assign a unique partition identifier to each organizational partition. The partition identifier includes organizational type attributes and spatial boundary information. A partition map is generated based on the partition identifier, and a mapping relationship is established from each tissue partition in the partition map to the corresponding pixel region in the base image as an inspection index.

3. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 1, characterized in that, The steps of using the base image as a reference, progressively scanning subsequent frame images to generate suspected hemorrhage areas, using the completed frame images as scan images, and registering multiple scan layers with the base image are as follows: Define a preset number of frames and label the preset near-infrared band intensity in each frame image. Combine the frame images with the same preset near-infrared band intensity into a set of images to be scanned. The set of images to be scanned is scanned level by level with a preset number of levels, where the preset number of levels is the same as the preset number of frames. The step-by-step scanning operation includes performing a bleeding feature recognition algorithm on each frame of the image to obtain suspected bleeding areas; Each frame of the image is pixel-level segmented to generate the region to be detected, and the reflection intensity of the region to be detected to the corresponding preset near-infrared band intensity is obtained as the spectral feature. The spectral features are compared with the preset bleeding feature threshold range, and the areas to be detected that fall within the bleeding feature threshold range are marked as suspected bleeding areas. The frame image after the bleeding feature recognition algorithm has been executed is output as a scan image; The generated scan image is processed and then overlaid with the base image.

4. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 3, characterized in that, The step of processing the generated scan image and overlaying it with the base image is as follows: Visual degradation processing is performed on the image areas other than suspected bleeding areas in each scan image to generate a degradation layer for the corresponding scan image; Spatial registration is performed between the downgraded layers generated from each level of scanned images and the base image; Following the hierarchical order of scanning, the downgraded layers of each level of scan image are sequentially superimposed on the base image to generate a multi-layered overlay image.

5. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 1, characterized in that, The step of constructing an event recording unit for each suspected bleeding area in the scan image to collect image feature data of the suspected bleeding area is as follows: An event recording unit is constructed for each suspected bleeding area to collect image feature data. A dual-channel transmission interface is deployed on the event recording unit for interaction with other event recording units. For each suspected bleeding area in the scan image, the examination index is queried based on its pixel coordinates to determine one or more tissue partitions in the partition map to which it belongs, and the corresponding partition identifier is recorded. Extract the reflection intensity of the suspected hemorrhage area in the preset near-infrared band of the scan image and mark the scan timestamp; Extract the spatial morphological features of the suspected hemorrhage area in the scan image, including the area, outline shape, and positional coordinates relative to the tissue region; The corresponding partition identifier, reflection intensity, scan timestamp, and spatial morphological features are encapsulated as image feature data and stored in the event recording unit.

6. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 1, characterized in that, The steps for fusing image feature data to generate a suspected bleeding area based on the image fusion process are as follows: Based on the partition identifier recorded in the event log unit, all event log units are grouped according to their respective organizational partitions; For all event record units within the same organizational partition, sort them in ascending order according to their recorded timestamps, and then connect the event record units sequentially based on the sorting to generate an event chain.

7. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 1, characterized in that, The steps for generating a structured bleeding analysis report for the examined region by analyzing the event chain and examining the index are as follows: The event chain is analyzed for continuity to determine whether an event chain consists of consecutive event record units exceeding a preset threshold. If so, the event chain is determined to be continuous, representing a stable bleeding target. For determining the location and region of bleeding points through continuous analysis of event chains; The average of the center point coordinates of the suspected bleeding area recorded by all event recording units in the event chain is taken as the final coordinates of the bleeding point. Take the union of the spatial morphological features of the suspected bleeding areas recorded by all event recording units in the event chain as the comprehensive bleeding area of ​​the bleeding point; Based on the partition where the comprehensive bleeding area is located, the final coordinates of the bleeding points and the comprehensive bleeding area are mapped onto the base image by checking the index to generate a structured bleeding analysis report.

8. The method for identifying and analyzing bleeding points in capsule endoscopy based on near-infrared spectroscopy according to claim 7, characterized in that, The steps for visualizing the structured bleeding analysis report are as follows: Assign each bleeding point a visual label containing a unique number, the tissue partition identifier, and the corresponding event chain identifier; Dynamic features of the comprehensive bleeding area are extracted based on event chains obtained through continuous analysis; A timeline was constructed to display the dynamic characteristics of the complex hemorrhage area, including the reconstruction of the spatial morphological changes and near-infrared spectral characteristics of each complex hemorrhage area. The visualization results of the structured bleeding analysis report are displayed by associating the visualization labels with the timeline.