Respiratory system lung nodule tumor cell detection method and system based on image feature fusion and storage medium
By constructing a multi-directional difference image set and filtering pixel connectivity, the problems of incomplete boundaries and scattered texture response in existing lung nodule detection are solved, and stable identification and accurate detection of lung nodule regions are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GENERAL HOSPITAL OF THE NORTHERN WAR ZONE OF THE CHINESE PEOPLES LIBERATION ARMY
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-05
AI Technical Summary
Current methods for detecting lung nodules rely on manual image reading and regular segmentation, which are susceptible to imaging noise, resulting in incomplete nodule boundaries, scattered texture response, difficulty in identifying early lesions, and unstable detection results.
By constructing a multi-directional difference image set, combining pixel connectivity and density filtering, grayscale perturbation interference is reduced, internal pixel structure is reorganized, and a complete lung nodule edge contour connection image is generated.
It improves the stability and detection accuracy of lung nodule region recognition and enhances the clarity of nodule contour expression in complex backgrounds.
Smart Images

Figure CN122156155A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image analysis technology, and in particular to a method, system, and storage medium for detecting respiratory system pulmonary nodules and tumor cells based on image feature fusion. Background Technology
[0002] Image analysis technology involves the digital processing and analysis of visual information such as structure, texture, shape, boundary, and region contained in images to achieve functions such as target recognition, image segmentation, target detection, feature extraction, and 3D reconstruction. It is an important component of computer vision and pattern recognition. This technology takes image data as input and combines image processing algorithms and learning models to understand and reason about image content through pixel-level, region-level, or overall image feature modeling. It is widely used in various scenarios such as medical diagnosis, autonomous driving, security monitoring, and industrial inspection. In medical image analysis, image analysis technology is often used to perform quantitative and qualitative processing of medical images such as CT, MRI, and X-rays to assist in tasks such as lesion identification, tissue segmentation, and pathological examination. Among them, the traditional method for detecting lung nodules and tumor cells refers to the method of radiologists manually observing and subjectively judging lung tissue regions in chest CT images. By examining visual information such as density, morphology, and edge features of lung images, it is possible to identify the presence of suspected nodules or tumor lesions. The judgment criteria mainly include parameters such as nodule size, degree of edge blurring, density distribution, and growth location. The method typically involves reviewing images layer by layer using two-dimensional slicing, supplemented by rule-based image segmentation or thresholding methods for target region extraction and analysis. However, it lacks systematic multi-scale feature fusion techniques, making it difficult to identify early lesions with unclear feature boundaries or indistinct texture features.
[0003] Current lung nodule detection methods mainly rely on manual image reading and regular segmentation, which are observed and judged at the two-dimensional slice level. During the processing, insufficient attention is paid to the gray-level changes between pixels and the continuity of edges. It is easily affected by imaging noise and gray-level disturbances, resulting in incomplete or broken nodule boundaries. There is a lack of overall constraints on structural closure and connectivity, which leads to scattered texture response, unstable candidate region selection, high difficulty in distinguishing early nodules from complex background regions, and limited consistency and reliability of detection results. Summary of the Invention
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting lung nodules and tumor cells in the respiratory system based on image feature fusion, comprising the following steps:
[0005] S1: Acquire chest transverse CT image data, construct a two-dimensional pixel grayscale array, locate the grayscale edge between each pixel and surrounding pixels, determine the gradient direction continuity, construct a closed boundary structure, analyze regional connectivity, and extract candidate lung nodule region images.
[0006] S2: Call the gray values of the pixels in the candidate lung nodule region image, establish pixel adjacency relationships in the horizontal, vertical, main diagonal and secondary diagonal, calculate the gray value difference point by point, and generate a set of directional difference images.
[0007] S3: Based on the set of directional difference images, extract continuous gray-level change regions, filter and retain image blocks with complete edges and closed structures according to pixel distribution density, remove gray-level disturbance point fragments, and filter texture response images based on boundary closure and connectivity;
[0008] S4: Based on the texture response image, extract the structural sequence of pixel connected edges, and perform edge pixel connection, contour path extension and boundary completion according to spatial relationship to construct lung nodule edge contour connection image;
[0009] S5: Call the fusion boundary structure in the lung nodule edge contour connection image, perform spatial aggregation based on the consistency of grayscale distribution, reorganize the internal pixel set, and generate a respiratory system lung nodule tumor cell detection image.
[0010] As a further aspect of the present invention, the lung nodule candidate region image includes an edge gray-level closed structure, a region pixel connectivity distribution, and a local gray-level feature pattern; the directional difference image set includes a horizontal gray-level difference image, a vertical gray-level difference image, and a diagonal gray-level difference image; the texture response image includes a continuous texture region, a closed structure patch, and a noise perturbation removal layer; the lung nodule edge contour connection image includes a pixel-level contour fusion structure, a boundary orientation connection sequence, and a closed region boundary layer; and the respiratory system lung nodule tumor cell detection image includes a boundary cohesive region, a structured pixel cluster, and a uniform gray-level distribution map.
[0011] As a further aspect of the present invention, the image block that retains complete edges and has a closed structure refers to a connected image region that has continuous, closed boundaries, no internal breaks, and a stable pixel distribution.
[0012] As a further aspect of the present invention, the specific steps of S1 are as follows:
[0013] S101: Acquire a chest cross-sectional image obtained from a lung CT scan, read pixel gray values to construct a two-dimensional gray array, calculate the gray difference between each pixel and its four neighboring pixels, preset a gray change threshold, mark pixels with excessive differences as edge points, and generate an initial set of edge pixels.
[0014] S102: Based on the spatial position of adjacent edge points in the initial edge pixel set, calculate the gradient direction change value, determine the direction continuity, connect continuous points to form a closed path and fill the interior to generate a closed boundary region image structure.
[0015] S103: Based on the image structure of the closed boundary region, perform connected component analysis according to the preset eight-neighbor rule, identify pixel clustering features and remove invalid regions, retain regions that meet the preset morphological density conditions, and generate lung nodule candidate region images.
[0016] As a further aspect of the present invention, the specific steps of S2 are as follows:
[0017] S201: Call the gray values of all pixels in the candidate lung nodule region image, obtain the coordinate pairs of adjacent pixels in the four directions of horizontal, vertical, main diagonal and secondary diagonal, establish the pixel adjacency relationship between each pixel and the adjacent pixels in the corresponding direction, and generate a directional adjacency relationship mapping table.
[0018] S202: According to the directional adjacency relationship mapping table, perform gray value difference calculation on the pixels in each direction to obtain the gray value difference distribution matrix corresponding to the four directions. Combine the original image pixel coordinates to organize the difference image data corresponding to each direction and generate the directional gray value difference image group.
[0019] S203: Call the image data corresponding to each direction in the directional grayscale difference image group, perform image stitching, structural alignment and label integration according to the directional dimension, combine to form an image with multiple directional label dimensions, and generate a directional difference image set.
[0020] As a further aspect of the present invention, the specific steps of S3 are as follows:
[0021] S301: Call the set of directional difference images, extract continuous gray-scale change regions, determine whether the difference in gray-scale values between adjacent pixels is lower than a preset continuity threshold, limit the minimum connectivity length, exclude non-continuous segments, and generate a set of continuous gray-scale change regions.
[0022] S302: Based on the pixel spatial distribution density of the regions in the continuous gray-scale change region set, count the number of pixels per unit area of each region, preset a density filtering threshold and perform a removal operation on regions below the threshold, and at the same time determine whether the edge is closed and whether the outline is complete, and generate a group of closed edge image regions.
[0023] S303: Based on the boundary structure of each region in the closed edge image region group, analyze the closure and pixel connectivity, call the eight-neighbor connectivity rule to construct the pixel map topology, filter out non-formed segments composed of discrete gray-level perturbation points, retain only regions with determined boundary structures and coherent pixel integration, and generate a texture response image.
[0024] As a further aspect of the present invention, the specific steps of S4 are as follows:
[0025] S401: Call the edge structure sequence of the closed image fragment in the texture response image, extract the start and end positions of the edges according to the mapping relationship between the pixel arrangement direction and the image coordinates, and construct the edge connection order table according to the spatial position matching to generate the edge connection order mapping matrix;
[0026] S402: According to the edge connection order mapping matrix, perform point-by-point connection operation on adjacent edge pixels, detect the discontinuity position in the connection path and fill the missing pixels according to the edge direction, perform closed path extension and boundary closure, and generate an edge path closed image structure.
[0027] S403: Based on the edge path closed image structure, extract the boundary intersection area between closed texture segments, extract the gray-level change curve of the border edge area, perform weighted fusion on the pixel boundary intersection point according to the gradient direction, reconstruct the unified edge connectivity structure, and generate the lung nodule edge contour connection image.
[0028] As a further aspect of the present invention, the specific steps of S5 are as follows:
[0029] S501: Call the boundary image structure of the fusion region in the lung nodule edge contour connection image, obtain the pixel gray value in each closed boundary, establish a spatial position mapping relationship based on image coordinates, calculate the gray mean difference between adjacent regions according to gray fit degree, and aggregate spatial regions with similar gray distribution by preset consistency threshold to generate a set of spatial gray aggregate regions.
[0030] S502: Based on the boundary shape of the regions and the internal pixel arrangement order in the spatial grayscale aggregation region set, establish a pixel position index table for each region, rearrange the pixel coordinate order to make the region structure coherent, remove isolated pixel blocks in the region and fill in the empty regions to generate an internal pixel structure set.
[0031] S503: Based on the pixel position and density features of the concentrated area of the internal pixel structure, extract the regional texture consistency index, shape regularity index and grayscale stability index, and reconstruct the target area image by combining the regional boundary contour morphology, aggregate multi-channel diagnostic views, and generate respiratory system lung nodule tumor cell detection image.
[0032] A respiratory system lung nodule tumor cell detection system based on image feature fusion includes:
[0033] The lung nodule candidate region extraction module is used to achieve S1: acquiring chest transverse CT image data, constructing a two-dimensional pixel grayscale array, locating the grayscale edge between each pixel and surrounding pixels, determining the gradient direction continuity, constructing a closed boundary structure, analyzing regional connectivity, and extracting lung nodule candidate region images.
[0034] The orientation difference image generation module is used to implement S2: call the gray value of the pixel in the lung nodule candidate region image, establish pixel adjacency relationship in the horizontal, vertical, main diagonal and secondary diagonal, calculate the gray value of each point, and generate a set of orientation difference images;
[0035] The texture response image filtering module is used to implement S3: based on the set of directional difference images, extract continuous gray-level change regions, filter and retain image blocks with complete edges and closed structures according to pixel distribution density, remove gray-level disturbance point fragments, and filter texture response images based on boundary closure and connectivity;
[0036] The nodule edge contour construction module is used to implement S4: Based on the texture response image, extract the structural sequence of pixel connected edges, and perform edge pixel connection, contour path extension and boundary completion according to spatial relationship to construct the lung nodule edge contour connection image;
[0037] The tumor detection image generation module is used to implement S5: calling the fusion boundary structure in the lung nodule edge contour connection image, performing spatial aggregation based on the consistency of grayscale distribution, reorganizing the internal pixel set, and generating a respiratory system lung nodule tumor cell detection image.
[0038] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0039] In this invention, by constructing multi-directional differences in the pixel grayscale relationship of chest CT images, and introducing continuity and closure constraints on the basis of edge localization, the candidate region forms a stable closed contour in spatial structure. Then, by combining pixel connectivity and density screening, the interference of isolated disturbance points on texture judgment is weakened. Through boundary fusion and region aggregation processes, the internal pixel structure is reorganized, making the nodule contour expression more complete and clear, enhancing the concentration of texture response, thereby improving the recognition stability and detection accuracy of lung nodule regions in complex backgrounds. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a schematic diagram of the steps of the present invention;
[0042] Figure 2 This is a detailed schematic diagram of S1 of the present invention;
[0043] Figure 3 This is a detailed schematic diagram of S2 of the present invention;
[0044] Figure 4 This is a detailed schematic diagram of S3 of the present invention;
[0045] Figure 5 This is a detailed schematic diagram of S4 of the present invention;
[0046] Figure 6 This is a detailed schematic diagram of S5 of the present invention;
[0047] Figure 7 This is a system module diagram of the present invention. Detailed Implementation
[0048] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0049] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0050] Please see Figure 1 This invention provides a method for detecting pulmonary nodules and tumor cells in the respiratory system based on image feature fusion, comprising the following steps:
[0051] S1: Acquire chest cross-sectional image data using lung CT equipment, construct a two-dimensional pixel grayscale array, perform edge localization based on the grayscale difference between each pixel and surrounding pixels, construct a closed image boundary structure using gradient direction continuity judgment, and perform connectivity analysis within the closed area to extract candidate lung nodule regions.
[0052] S2: Call the gray values of pixels in the candidate lung nodule region image, establish pixel adjacency relationships in the four directions of horizontal, vertical, main diagonal and secondary diagonal, perform point-by-point gray value calculation, form a directional gray value difference image, and combine the directional gray value difference images according to the directional dimension to form a directional difference image set.
[0053] S3: Call the continuous gray-level change region in the directional difference image set, use the pixel distribution density as the filtering criterion, retain image blocks with complete edges and closed structures, remove non-formed image fragments composed of gray-level disturbance points, and obtain the texture response image by filtering through the closure and connectivity features of the boundary structure;
[0054] S4: Call the structure sequence representing the pixel connected edges in the texture response image, and perform edge pixel connection, contour path extension and boundary completion operations in sequence according to the spatial relationship mapping connection order. Perform pixel boundary fusion processing on the lung nodule contour image composed of multiple closed texture fragments to establish the lung nodule edge contour connected image.
[0055] S5: Call the fused boundary image structure in the lung nodule edge contour connection image, perform spatial region aggregation according to the consistency of image grayscale distribution, restructure the pixel set in the aggregated region, and generate a respiratory system lung nodule tumor cell detection image based on the pixel distribution structure.
[0056] The candidate images for lung nodules include edge gray-level closed structures, regional pixel connectivity distribution, and local gray-level feature patterns. The directional difference image set includes horizontal gray-level difference maps, vertical gray-level difference maps, and diagonal gray-level difference maps. The texture response images include continuous texture regions, closed structure patches, and noise perturbation removal layers. The lung nodule edge contour connection images include pixel-level contour fusion structures, boundary orientation connection sequences, and closed region boundary layers. The images for detecting lung nodules and tumor cells in the respiratory system include boundary cohesive regions, structured pixel clusters, and uniform gray-level distribution maps.
[0057] Please see Figure 2 The specific steps of S1 are as follows:
[0058] S101: Acquire a chest cross-sectional image obtained from a lung CT scan, read pixel gray values to construct a two-dimensional gray array, calculate the gray difference between each pixel and its four neighboring pixels, preset a gray change threshold, mark pixels with excessive differences as edge points, and generate an initial set of edge pixels.
[0059] The process is primarily executed by the image processor. First, it receives DICOM format lung computed tomography data acquired from a 64-slice spiral CT scanner via the medical image transmission protocol port. The data bit depth is set to 16 bits, and the resolution is set to 512×512 pixels. The image processor decodes the read DICOM data and maps it into a two-dimensional grayscale matrix, where each element corresponds to a Hausfield unit of a spatial pixel. Then, the image processor calls its internal arithmetic logic unit to traverse every non-boundary pixel in the matrix, selecting its four directly adjacent pixels (top, bottom, left, and right) as its four neighbors. For each reference point in the region, the absolute difference between the gray value of the center pixel and the gray values of its four neighboring pixels is calculated. A comparator is used to select the maximum value among the four absolute differences as the local gradient intensity of the center pixel. The gray-level abrupt change threshold is set to 150 Hausfield units. This threshold is based on the lower quartile of the edge pixel gradient statistics of 500 confirmed pulmonary nodule cases. If the local gradient intensity of a pixel is greater than or equal to 150, the pixel is marked as 1 in the binary mask; otherwise, it is marked as 0. This process extracts all potential points of drastic brightness change. For example, for a pixel with coordinates (256, 256) and a gray value of -400, the gray values of its four neighboring pixels are -380, -240, -410, and -395, respectively. The absolute values of the four differences calculated by the image processor are 20, 160, 10, and 5, respectively, with the maximum value being 160. Since 160 is greater than the preset threshold of 150, this pixel is marked as an edge point by the image processor, and an initial set of edge pixels is formed after traversing the entire image.
[0060] S102: Based on the spatial position of adjacent edge points in the initial edge pixel set, calculate the gradient direction change value, determine the direction continuity, connect continuous points to form a closed path and fill the interior to generate a closed boundary region image structure.
[0061] The image processor uses its parallel computing capabilities to traverse each marker point in the initial edge pixel set, checking if there are other marker points within its 8-neighborhood. If so, the image processor calculates the vector angle from the current point to the neighboring marker point, defining 0 degrees for the horizontal rightward direction and positive for the counterclockwise direction. It calculates the gradient direction angle difference between adjacent edge points, setting a direction continuity threshold of 25 degrees. If the gradient direction difference between two adjacent points is less than 25 degrees, the image processor determines that the two points have direction continuity and establishes a connection index. For paths with a break gap of less than 3 pixels and a gradient direction difference between the two ends within the threshold range, the image processor uses a cubic spline interpolation algorithm to calculate the coordinates of the missing points in the middle and fills them in, so that the discrete edge segments are connected end to end to form a closed loop. Then, the image processor uses a scan line filling algorithm, starting from the upper left corner of the image and scanning horizontally. When the scan line encounters an odd number of intersections with the closed boundary, it starts filling the foreground pixel value 255, and stops filling when it encounters an even number of intersections, thereby transforming the internal region of the closed path into a solid binary region structure. For example, the gradient direction of the end point A of an edge line segment is 45 degrees, and the gradient direction of the starting point B of another line segment, which is 2 pixels away, is 60 degrees. The angle difference between the two points is 15 degrees, which is less than the 25-degree threshold, and the distance meets the completion condition. The image processor automatically calculates the transition pixel points between A and B and connects them. The resulting closed region, after being filled, constitutes the closed boundary region image structure.
[0062] S103: Based on the image structure of the closed boundary region, perform connected component analysis according to the preset eight-neighbor rule, identify pixel clustering features and remove invalid regions, retain regions that meet the preset morphological density conditions, and generate lung nodule candidate region images.
[0063] The image processor performs connected component labeling on the image structure of closed boundary regions. A two-scan method is used to traverse the image. The first scan assigns temporary labels and records equivalent pairs. The second scan parses the equivalent pairs and merges the labels. The image processor counts the total number of pixels within each connected region as an area feature. Simultaneously, it calculates the aspect ratio of the bounding rectangle of the connected region and the density index. The density index is calculated as the ratio of the area of the connected region to the area of its convex hull. The area retention range is set to 30 to 1500 pixels, and the density threshold is set to 0.65. This threshold is obtained through ROC curve analysis of 1000 labeled images containing vascular cross-sections and nodules. The image processor determines that any connected region whose area is outside the specified range or whose density is less than 0.65 is considered invalid background or vascular noise and is removed. The remaining regions that meet the conditions are retained and mapped back to the original image coordinate system. For example, if an image processor detects that a connected region has a total of 800 pixels, and its bounding rectangle has a length and width of 30 and 28 respectively, and its density is calculated to be 0.85, and another region has 20 pixels and a density of 0.9, the image processor will retain the first region as a candidate region for lung nodules, while discarding the second region because its area is too small, and finally output the candidate region image for lung nodules.
[0064] Please see Figure 3 The specific steps of S2 are as follows:
[0065] S201: Call the gray values of all pixels in the lung nodule candidate region image, obtain the coordinate pairs of adjacent pixels in the four directions of horizontal, vertical, main diagonal and secondary diagonal, establish the pixel adjacency relationship between each pixel and the adjacent pixels in the corresponding direction, and generate the directional adjacency relationship mapping table.
[0066] The image processor is instructed to read the original grayscale matrix corresponding to the candidate lung nodule region image. Four scanning direction vectors are defined: horizontal (1, 0), vertical (0, 1), main diagonal (1, 1), and secondary diagonal (1, -1). For any valid pixel with coordinates (x, y) in the image, the image processor locks the coordinates of its corresponding neighboring pixels according to these four direction vectors. For example, (x+1, y+1) is locked as the neighboring point in the main diagonal direction, and (x+1, y-1) is locked as the neighboring point in the secondary diagonal direction. The image processor constructs a pixel adjacency index table with four dimensions in memory. This table records in detail the physical addresses of directly related pixels of each pixel in the four specific geometric directions, ensuring that subsequent difference calculations can accurately index the corresponding grayscale data. The data storage format adopts a structure array, and each cell contains the coordinates of the origin and the coordinate indices of the neighbors in the four directions.
[0067] S202: Based on the directional adjacency mapping table, perform grayscale difference calculation on each pixel in each direction to obtain the grayscale difference distribution matrix corresponding to the four directions. Combine the original image pixel coordinates to organize the difference image data corresponding to each direction and generate the directional grayscale difference image group.
[0068] Based on the directional adjacency mapping table, the image processor extracts the gray value of the center pixel and the gray values of its four adjacent pixels. The image processor performs a subtraction operation to calculate the gray value difference. Specifically, the gray value of the center pixel is subtracted from the gray value of the adjacent pixels in the corresponding direction, resulting in four independent difference values. The image processor reassembles the horizontal differences of all pixels in the entire image into a horizontal difference matrix. Similarly, it generates difference matrices in the vertical, main diagonal, and secondary diagonal directions. The data type of these four matrices is 16-bit signed integer to retain negative difference information. For example, if the grayscale value of the center pixel P is 100, the grayscale value of its horizontal neighbor P_h is 90, the grayscale value of its vertical neighbor P_v is 120, the grayscale value of its main diagonal neighbor P_d1 is 100, and the grayscale value of its secondary diagonal neighbor P_d2 is 80, then the image processor calculates the differences in the four directions as 10, -20, 0, and 20, respectively. Through this process, four grayscale difference distribution maps with the same size as the original image are generated. As shown in Table 1, this table displays the calculation results of the horizontal grayscale difference in a local 3×3 region calculated by the image processor.
[0069] Table 1. Calculation data of horizontal grayscale difference in local area
[0070] row coordinates Column coordinates Center pixel grayscale value Horizontal Neighbor Gray Value Calculated horizontal difference 105 201 100 95 5 105 202 95 92 3 105 203 92 80 12 106 201 105 100 5
[0071] S203: Call the image data corresponding to each direction in the directional grayscale difference image group, perform image stitching, structural alignment and label integration according to the directional dimension, combine them to form an image with multi-directional label dimensions, and generate a set of directional difference images;
[0072] Using the multi-channel data processing module of an image processor, four grayscale difference images (horizontal, vertical, main diagonal, and secondary diagonal) are generated as independent feature channels. Multi-channel stacking technology is employed for data fusion. The image processor constructs a 512×512×4 three-dimensional tensor data structure, strictly aligning spatial coordinates during stacking to ensure that pixels at the same plane position correspond to the difference features in the four directions in the depth dimension. Directional metadata is added to each channel, labeled 0 degrees, 90 degrees, 45 degrees, and 135 degrees, thus forming high-dimensional image data with directional attributes. For example, for a pixel at coordinates (100, 100), its data in the fused image is represented as a vector of length 4 [15, -5, 8, 10], representing the degree of grayscale abrupt change in the four directions. After integration by the image processor, this set fully preserves the anisotropic features of the image texture at various spatial angles.
[0073] Please see Figure 4 The specific steps of S3 are as follows:
[0074] S301: Call the directional difference image set, extract the continuous gray-level change region, determine whether the gray-level difference between adjacent pixels is lower than the preset continuity threshold, limit the minimum connected length, exclude non-continuous segments, and generate a continuous gray-level change region set.
[0075] The image processor's continuity analysis engine is activated, traversing each channel image in the directional difference image set. A continuity threshold of 15 gray levels is set, based on 1.5 times the mean square error of lung parenchyma texture. The image processor scans pixel differences row by row and column by column. If the fluctuation range of the difference between adjacent pixels is less than 15, it is determined to be a continuous gray-level change, and these pixels are grouped into the same connected segment. Simultaneously, the number of pixels contained in each continuous segment is counted as the connected length, with a minimum connected length threshold of 8 pixels. Fragmented regions with a length less than 8 are considered noise and removed. For example, in the lateral difference channel, the image processor detects a region with a length of 12 pixels. The fluctuation range of the difference between adjacent pixels within this region is between 3 and 8, fully satisfying the threshold condition of less than 15. Furthermore, the length of 12 is greater than the minimum threshold of 8. The image processor marks this region as a valid continuous gray-level change region, while another similar region with a length of 4 is removed.
[0076] S302: Based on the pixel spatial distribution density of the regions in the set of continuous gray-scale change regions, count the number of pixels per unit area in each region, preset the density filtering threshold and perform a removal operation on regions below the threshold, while judging whether the edges are closed and whether the outline is complete, and generating a group of closed edge image regions.
[0077] For selected regions with continuous grayscale variations, the image processor calculates their pixel spatial distribution density. The calculation logic involves counting the number of effective pixels within the region and dividing it by the area of the circumscribed convex polygon of that region to obtain a dimensionless density value. A density screening threshold of 0.75 is set. This parameter is derived by analyzing the morphological features of 300 typical solid nodules. If the density of a region is below 0.75, it indicates a loose structure, often consisting of artifacts or vascular branches, and the image processor removes it. Simultaneously, morphological closing operations are applied to check for edge closure, ensuring the region's outline is unblemished. For example, if a region contains 200 effective pixels and its circumscribed convex polygon has an area of 250 pixels, the image processor calculates a density of 0.8, which is greater than 0.75. Since the boundary is closed as detected by the closing operation, the region is retained. Conversely, if the density calculation result is 0.5, the region is removed from the set by the image processor, ultimately outputting a group of image regions with closed edges.
[0078] S303: Based on the boundary structure of each region in the closed edge image region group, analyze the closure and pixel connectivity, call the eight-neighborhood connectivity rule to construct the pixel map topology, filter out non-formed segments composed of discrete gray-level perturbation points, retain only regions with defined boundary structures and coherent pixel integration, and generate texture response images.
[0079] Using the graph theory computation unit of the image processor, a graph topology structure is constructed for each candidate region in the group of closed-edge image regions. Each pixel is treated as a node, and if pixels are physically adjacent in an 8-neighborhood and their gray-level differences are within the tolerance range, an edge connection is established. The image processor calculates the algebraic connectivity of the graph structure, i.e., the second smallest eigenvalue of the Laplacian matrix. A connectivity threshold of 0.2 is set, and discrete perturbation point sets with connectivity below this threshold are eliminated, retaining only the strongly connected components with compact structures. The pixel gray-level values in the retained regions are mapped to texture response intensity, which is proportional to the average gradient magnitude within the region. For example, for a nodular region with clear boundaries, the algebraic connectivity calculation result of its constructed topological graph is 0.45, which is greater than 0.2. The image processor determines that it is a stable texture structure and retains it. In the generated texture response image, the pixel values of this region are assigned the average gradient value of the region, 45, thereby highlighting the texture region with a defined structure.
[0080] Please see Figure 5 The specific steps of S4 are as follows:
[0081] S401: Call the edge structure sequence of the closed image fragment in the texture response image, extract the start and end positions of the edges according to the mapping relationship between the pixel arrangement direction and the image coordinates, and construct the edge connection order table according to the spatial position matching to generate the edge connection order mapping matrix;
[0082] The image processor is instructed to scan the edge pixels of each closed image segment in the texture response image, tracing the edge coordinate sequence in a clockwise direction, and establishing a mapping relationship between image coordinates (x, y) and edge sequence index (k). For each edge segment, the image processor identifies its geometric endpoints as start and end positions, calculates the Euclidean distance between each pair of endpoints, and constructs an edge connection adjacency matrix based on the spatial proximity of the endpoint coordinates. The matrix element A(i, j) represents the distance between the end point of the i-th edge segment and the start point of the j-th edge segment. If the distance is less than a preset search radius of 5 pixels, the connection relationship is marked in the sequence list. For example, if the image processor detects that the end point coordinates of edge segment 1 are (150, 150) and the start point coordinates of edge segment 2 are (152, 153), and the distance between the two points is approximately 3.6 pixels, which is less than 5 pixels, the image processor will record the existence of a successor connection relationship between segment 1 and segment 2 in the connection sequence mapping matrix.
[0083] S402: Based on the edge connection order mapping matrix, perform point-by-point connection operation on adjacent edge pixels, detect the discontinuity position in the connection path and fill the missing pixels according to the edge direction, perform closed path extension and boundary closure, and generate an edge path closed image structure.
[0084] The image processor parses the edge connectivity order mapping matrix, locates all adjacent edge endpoint pairs marked as needing connection, calculates the tangent direction of the line connecting the two breakpoints, and performs linear interpolation between the two points based on this direction to generate the coordinates of the filling pixels. The image processor calculates the grayscale value of the filling pixels, using a weighted average of the grayscale values of the two endpoints, with the weight inversely proportional to the distance. This process is repeated to fill the gaps one by one until the entire path is closed. The closed path is then smoothed. For example, if endpoint P1 has a grayscale value of 80 and endpoint P2 has a grayscale value of 100, and three points need to be interpolated in between, the image processor sequentially generates three pixels with grayscale values of approximately 85, 90, and 95 to fill the gaps, creating a continuous closed loop on both the visual and data levels, thus generating a closed edge path image structure.
[0085] S403: Based on the closed image structure of edge path, extract the boundary intersection area between closed texture segments, extract the gray-level change curve of the bordering edge area, perform weighted fusion on the pixel boundary intersection point according to the gradient direction, reconstruct a unified edge connectivity structure, and generate a lung nodule edge contour connection image.
[0086] Using an image processor's feature fusion algorithm, overlapping or contact areas between different closed texture segments in an image structure with closed edge paths are identified. Edge pixels at the junctions are extracted, and gray-level gradient direction vectors on both sides of the intersection are obtained. The image processor calculates a weighted composite vector of the two direction vectors, with the weight determined by the area of each region: 0.7 for large areas and 0.3 for small areas. The edge curve at the intersection is reconstructed based on the composite vector direction, eliminating intersection artifacts and fusing to form a unified external contour. For example, regions A and B intersect at a certain point. Region A has an area of 500, and region B has an area of 200. At the intersection point, the gradient direction of A is 30 degrees, and that of B is 60 degrees. The image processor calculates the weighted composite direction, smoothly fusing the edges of the two regions into a single boundary at this point, generating a connected image of the lung nodule edge contour.
[0087] Please see Figure 6 The specific steps of S5 are as follows:
[0088] S501: Call the boundary image structure of the fusion region in the lung nodule edge contour connection image, obtain the pixel gray value in each closed boundary, establish a spatial position mapping relationship based on image coordinates, calculate the gray mean difference between adjacent regions according to gray fit degree, and aggregate spatial regions with similar gray distribution by preset consistency threshold to generate a set of spatial gray aggregate regions.
[0089] For each fusion region in the image connecting the contours of lung nodules, the image processor extracts the gray values of all pixels within the boundary, calculates the mean and variance of gray values within the region, and for two adjacent spatial regions, calculates the absolute value of the difference between their gray value means. A consistency threshold of 20 Hausfield units is set. If the difference in gray value means between two adjacent regions is less than 20, they are considered homogeneous regions and an aggregation operation is performed, merging the two regions into a single statistical unit and updating the spatial location mapping relationship after merging. For example, if the average gray value of region R1 is -500 and the average gray value of the adjacent region R2 is -485, the difference is 15, which is less than the threshold of 20. The image processor treats R1 and R2 as part of the same anatomical structure and merges them. Conversely, if the difference is 50, they remain independent, ultimately generating a set of spatial gray value aggregation regions.
[0090] S502: Based on the boundary shape of the regions and the internal pixel arrangement order in the spatial grayscale aggregation region set, establish a pixel position index table for each region, rearrange the pixel coordinate order to make the region structure coherent, remove isolated pixel blocks in the region and fill in the empty regions to generate an internal pixel structure set.
[0091] The image processor obtains a binary mask for each region in the spatial grayscale aggregation region set. It then re-establishes the pixel index using a raster scan sequence. The processor checks for isolated background holes smaller than 5 pixels within each region. If such holes exist, the image processor sets the pixel value within the hole to the average value of the region's boundary pixels. Simultaneously, it removes protruding single-pixel burrs from the region's edges, ensuring the region is solid and the edges are smooth. For example, when scanning an aggregation region, if the image processor detects a closed hole composed of 3 black pixels, it reads the average grayscale value of 120 from the pixels surrounding the hole and replaces the values of these 3 black pixels with 120, thus filling in the hole and generating the internal pixel structure set.
[0092] S503: Based on the pixel position and density features of the concentrated area of the internal pixel structure, extract the regional texture consistency index, shape regularity index and grayscale stability index, and combine the regional boundary contour morphology to reconstruct the target area image, aggregate multi-channel diagnostic views, and generate respiratory system lung nodule tumor cell detection images.
[0093] For each target region within the internal pixel structure set, the image processor's feature extraction module extracts multi-dimensional feature indicators to construct a feature vector. First, a texture consistency indicator is extracted, calculated as the inverse difference moment of the gray-level co-occurrence matrix within the region. Second, a shape regularity indicator is extracted, calculated as (4 multiplied by pi 3.14159 multiplied by the region area) divided by (the square of the region's perimeter). Finally, a gray-level stability indicator is extracted, calculated as 1 minus (the region's gray-level standard deviation divided by the region's gray-level mean). The image processor normalizes these three indicators and inputs them into its internally integrated or connected pre-trained support vector machine classifier. The classifier determines whether a region is a nodule based on the feature vector and generates a visualized detection image by combining it with the original image. For example, if a region has a texture consistency score of 0.8, a shape regularity score of 0.9, and a gray-level stability score of 0.85 (as shown in Table 2), the image processor determines that the region is a high-risk lung nodule based on these high scores and highlights it with a red outline in the final image, generating a respiratory system lung nodule tumor cell detection image.
[0094] Table 2 Example Data Table for Extraction and Judgment of Regional Feature Indicators
[0095] Feature Dimension Calculation parameter source A Calculation parameter source B Calculated index values Determination benchmark value Regularity of shape Area = 314 Circumference = 63 0.99 >0.75 Texture consistency Inverse difference moment numerator = 0.8 Normalization factor = 1 0.80 >0.60 Grayscale stability Standard deviation = 15 Mean = 150 0.90 >0.80
[0096] Please see Figure 7 A respiratory system lung nodule tumor cell detection system based on image feature fusion, including:
[0097] The lung nodule candidate region extraction module is used to achieve S1: acquiring chest transverse CT image data, constructing a two-dimensional pixel grayscale array, locating the grayscale edge between each pixel and surrounding pixels, determining the gradient direction continuity, constructing a closed boundary structure, analyzing regional connectivity, and extracting lung nodule candidate region images.
[0098] The orientation difference image generation module is used to implement S2: call the gray values of pixels in the lung nodule candidate region image, establish pixel adjacency relationships in the horizontal, vertical, main diagonal and secondary diagonal, calculate the gray value difference point by point, and generate a set of orientation difference images.
[0099] The texture response image filtering module is used to implement S3: based on the set of images with directional differences, extract regions with continuous gray-level changes, filter and retain image blocks with complete edges and closed structures according to pixel distribution density, remove gray-level perturbation point fragments, and filter texture response images based on boundary closure and connectivity;
[0100] The nodule edge contour construction module is used to implement S4: Based on the texture response image, extract the structural sequence of pixel connected edges, perform edge pixel connection, contour path extension and boundary completion according to spatial relationship, and construct lung nodule edge contour connection image;
[0101] The tumor detection image generation module is used to implement S5: call the lung nodule edge contour to connect the fused boundary structure in the image, perform spatial aggregation based on the consistency of gray-level distribution, reorganize the internal pixel set, and generate a respiratory system lung nodule tumor cell detection image.
[0102] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the technical solution.
Claims
1. A method for detecting pulmonary tumor cells in respiratory system nodules based on image feature fusion, characterized in that, Includes the following steps: S1: Acquire chest transverse CT image data, construct a two-dimensional pixel grayscale array, locate the grayscale edge between each pixel and surrounding pixels, determine the gradient direction continuity, construct a closed boundary structure, analyze regional connectivity, and extract candidate lung nodule region images. S2: Call the gray values of the pixels in the candidate lung nodule region image, establish pixel adjacency relationships in the horizontal, vertical, main diagonal and secondary diagonal, calculate the gray value difference point by point, and generate a set of directional difference images. S3: Based on the set of directional difference images, extract continuous gray-level change regions, filter and retain image blocks with complete edges and closed structures according to pixel distribution density, remove gray-level disturbance point fragments, and filter texture response images based on boundary closure and connectivity; S4: Based on the texture response image, extract the structural sequence of pixel connected edges, and perform edge pixel connection, contour path extension and boundary completion according to spatial relationship to construct lung nodule edge contour connection image; S5: Call the fusion boundary structure in the lung nodule edge contour connection image, perform spatial aggregation based on the consistency of grayscale distribution, reorganize the internal pixel set, and generate a respiratory system lung nodule tumor cell detection image.
2. The method for detecting respiratory system pulmonary nodules and tumor cells based on image feature fusion according to claim 1, characterized in that, The candidate lung nodule image includes edge gray-level closed structure, regional pixel connectivity distribution, and local gray-level feature pattern. The directional difference image set includes horizontal gray-level difference image, vertical gray-level difference image, and diagonal gray-level difference image. The texture response image includes continuous texture region, closed structure patch, and noise perturbation removal layer. The lung nodule edge contour connection image includes pixel-level contour fusion structure, boundary direction connection sequence, and closed region boundary layer. The respiratory system lung nodule tumor cell detection image includes boundary cohesive region, structured pixel cluster, and uniform gray-level distribution map.
3. The method for detecting respiratory system pulmonary nodules and tumor cells based on image feature fusion according to claim 1, characterized in that, The image block that retains intact edges and has a closed structure refers to a connected image region that has continuous, closed boundaries, no internal breaks, and a stable pixel distribution.
4. The method for detecting respiratory system pulmonary nodules and tumor cells based on image feature fusion according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Acquire a chest cross-sectional image obtained from a lung CT scan, read pixel gray values to construct a two-dimensional gray array, calculate the gray difference between each pixel and its four neighboring pixels, preset a gray change threshold, mark pixels with excessive differences as edge points, and generate an initial set of edge pixels. S102: Based on the spatial position of adjacent edge points in the initial edge pixel set, calculate the gradient direction change value, determine the direction continuity, connect continuous points to form a closed path and fill the interior to generate a closed boundary region image structure. S103: Based on the image structure of the closed boundary region, perform connected component analysis according to the preset eight-neighbor rule, identify pixel clustering features and remove invalid regions, retain regions that meet the preset morphological density conditions, and generate lung nodule candidate region images.
5. The method for detecting pulmonary nodules and tumor cells in the respiratory system based on image feature fusion according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Call the gray values of all pixels in the candidate lung nodule region image, obtain the coordinate pairs of adjacent pixels in the four directions of horizontal, vertical, main diagonal and secondary diagonal, establish the pixel adjacency relationship between each pixel and the adjacent pixels in the corresponding direction, and generate a directional adjacency relationship mapping table. S202: According to the directional adjacency relationship mapping table, perform gray value difference calculation on the pixels in each direction to obtain the gray value difference distribution matrix corresponding to the four directions. Combine the original image pixel coordinates to organize the difference image data corresponding to each direction and generate the directional gray value difference image group. S203: Call the image data corresponding to each direction in the directional grayscale difference image group, perform image stitching, structural alignment and label integration according to the directional dimension, combine to form an image with multiple directional label dimensions, and generate a directional difference image set.
6. The method for detecting pulmonary nodules and tumor cells in the respiratory system based on image feature fusion according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Call the set of directional difference images, extract continuous gray-scale change regions, determine whether the difference in gray-scale values between adjacent pixels is lower than a preset continuity threshold, limit the minimum connectivity length, exclude non-continuous segments, and generate a set of continuous gray-scale change regions. S302: Based on the pixel spatial distribution density of the regions in the continuous gray-scale change region set, count the number of pixels per unit area of each region, preset a density filtering threshold and perform a removal operation on regions below the threshold, and at the same time determine whether the edge is closed and whether the outline is complete, and generate a group of closed edge image regions. S303: Based on the boundary structure of each region in the closed edge image region group, analyze the closure and pixel connectivity, call the eight-neighbor connectivity rule to construct the pixel map topology, filter out non-formed segments composed of discrete gray-level perturbation points, retain only regions with determined boundary structures and coherent pixel integration, and generate a texture response image.
7. The method for detecting respiratory system pulmonary nodules and tumor cells based on image feature fusion according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Call the edge structure sequence of the closed image fragment in the texture response image, extract the start and end positions of the edges according to the mapping relationship between the pixel arrangement direction and the image coordinates, and construct the edge connection order table according to the spatial position matching to generate the edge connection order mapping matrix; S402: According to the edge connection order mapping matrix, perform point-by-point connection operation on adjacent edge pixels, detect the discontinuity position in the connection path and fill the missing pixels according to the edge direction, perform closed path extension and boundary closure, and generate an edge path closed image structure. S403: Based on the edge path closed image structure, extract the boundary intersection area between closed texture segments, extract the gray-level change curve of the border edge area, perform weighted fusion on the pixel boundary intersection point according to the gradient direction, reconstruct the unified edge connectivity structure, and generate the lung nodule edge contour connection image.
8. The method for detecting pulmonary nodules and tumor cells in the respiratory system based on image feature fusion according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Call the boundary image structure of the fusion region in the lung nodule edge contour connection image, obtain the pixel gray value in each closed boundary, establish a spatial position mapping relationship based on image coordinates, calculate the gray mean difference between adjacent regions according to gray fit degree, and aggregate spatial regions with similar gray distribution by preset consistency threshold to generate a set of spatial gray aggregate regions. S502: Based on the boundary shape of the regions and the internal pixel arrangement order in the spatial grayscale aggregation region set, establish a pixel position index table for each region, rearrange the pixel coordinate order to make the region structure coherent, remove isolated pixel blocks in the region and fill in the empty regions to generate an internal pixel structure set. S503: Based on the pixel position and density features of the concentrated area of the internal pixel structure, extract the regional texture consistency index, shape regularity index and grayscale stability index, and reconstruct the target area image by combining the regional boundary contour morphology, aggregate multi-channel diagnostic views, and generate respiratory system lung nodule tumor cell detection image.
9. A respiratory system pulmonary nodule tumor cell detection system based on image feature fusion, characterized in that, The system is used to implement the respiratory system pulmonary nodule tumor cell detection method based on image feature fusion according to any one of claims 1-8, the system comprising: The lung nodule candidate region extraction module is used to achieve S1: acquiring chest transverse CT image data, constructing a two-dimensional pixel grayscale array, locating the grayscale edge between each pixel and surrounding pixels, determining the gradient direction continuity, constructing a closed boundary structure, analyzing regional connectivity, and extracting lung nodule candidate region images. The orientation difference image generation module is used to implement S2: call the gray value of the pixel in the lung nodule candidate region image, establish pixel adjacency relationship in the horizontal, vertical, main diagonal and secondary diagonal, calculate the gray value of each point, and generate a set of orientation difference images; The texture response image filtering module is used to implement S3: based on the set of directional difference images, extract continuous gray-level change regions, filter and retain image blocks with complete edges and closed structures according to pixel distribution density, remove gray-level disturbance point fragments, and filter texture response images based on boundary closure and connectivity; The nodule edge contour construction module is used to implement S4: Based on the texture response image, extract the structural sequence of pixel connected edges, and perform edge pixel connection, contour path extension and boundary completion according to spatial relationship to construct the lung nodule edge contour connection image; The tumor detection image generation module is used to implement S5: calling the fusion boundary structure in the lung nodule edge contour connection image, performing spatial aggregation based on the consistency of grayscale distribution, reorganizing the internal pixel set, and generating a respiratory system lung nodule tumor cell detection image.
10. A storage medium for detecting respiratory system pulmonary nodules and tumor cells based on image feature fusion, wherein a computer program is stored, characterized in that, When the computer program is executed by the processor, it implements the steps of the respiratory system pulmonary nodule tumor cell detection method based on image feature fusion as described in any one of claims 1 to 8.