A structure-first image compression method
Through topological feature extraction and adaptive coding technology, the problem of insufficient preservation of key structures in medical image compression in existing technologies is solved, intelligent identification and protection of key structures are achieved, and the topological change capture capability and computing resource utilization efficiency of image compression are improved.
Patent Information
- Application Number
- CN202510935174.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-07-08
AI Technical Summary
Existing image compression technologies lack the ability to mathematically model the deep geometric structural features of medical images, resulting in insufficient retention of key anatomical features, especially errors in vascular bifurcation point identification and dynamic imaging, and an inability to effectively maintain the integrity of the topological structure.
Through topological feature extraction, structural key point detection and adaptive encoding, a topological importance heat map is generated to guide the encoder to use high-fidelity encoding in key structure areas and high compression rate encoding in non-key areas, generating compressed image data that maintains the integrity of key structures.
It achieves intelligent recognition and protection of key structures in medical images, improves the ability to capture topological changes, and maintains the computing resources and structural integrity of the image.
Smart Images

Figure CN120496756B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image compression, in particular to a structure-priority image compression method. Background Art
[0002] Medical imaging diagnosis places stringent demands on the structural fidelity of image compression technology, and traditional methods have significant shortcomings in preserving key anatomical features. Cases of telemedicine misdiagnosis are related to feature loss caused by compression distortion, with a high error rate in identifying vascular bifurcation points. Current mainstream compression standards, such as JPEG2000, use wavelet transforms to improve compression efficiency, but their rate-distortion optimization models only consider frequency-domain energy distribution and are unable to identify the three-dimensional topology of the bronchial tree in lung CT images. This problem is even more prominent in dynamic cardiac ultrasound images, where traditional algorithms ignore the homotopic characteristics of ventricular wall motion, leading to errors in ejection fraction calculations. These deficiencies stem from the fact that existing technologies lack the ability to mathematically model the deep geometric features of images.
[0003] Existing compression technology systems suffer from systematic methodological limitations in preserving structure. Transform coding-based methods (such as HEVC Intra) use discrete cosine transforms to separate high- and low-frequency components, but they cannot distinguish regions with the same frequency domain energy but different topological significance. While deep learning methods can learn feature representations, their black-box nature prevents precise control of the quantization accuracy of specific structures. Existing AI compression models have high error rates in preserving the connectivity of microcalcification clusters in mammograms. Even DICOM WS, a compression standard specifically designed for medical imaging, relies on manual annotation for its ROI encoding mechanism, making it difficult to process dynamic image data in real time. Traditional edge detection algorithms have fundamental flaws in assessing structural importance. Operators such as Sobel and Canny can only capture local gradient changes and cannot quantify the topological stability of structures. For example, in liver CT images, the circular structure of portal vein branches (a one-dimensional homology class) has completely different clinical value from temporal gradient changes in tissue texture, yet existing algorithms cannot distinguish between them. Existing methods ignore topological changes in the temporal dimension, resulting in a high failure rate in tracking metabolic hotspots in dynamic PET images.
[0004] The core technical problem facing current image compression technology is that traditional methods are unable to maintain geometric structure features. Summary of the Invention
[0005] The purpose of the invention is to provide a structure-priority image compression method, in order to solve at least one technical problem existing in the prior art.
[0006] Technical solution: a structure-priority image compression method, comprising:
[0007] Get the image to be compressed, and:
[0008] Perform topological feature extraction to obtain topological feature data that characterizes image connectivity and hole structure;
[0009] Perform structural key point detection to identify the set of structural key points that affect the topological stability of the image;
[0010] Generate a topological importance heat map based on topological feature data and a set of structural key points;
[0011] The image to be compressed is adaptively encoded based on the topological importance heat map to generate compressed image data that maintains the integrity of key structures.
[0012] Beneficial effects: The present invention can guide the encoder to skip the fine quantization of non-critical areas and realize the intelligent redistribution of computing resources; it can capture the topological changes in time evolution and improve the ability to identify and protect critical medical structures. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A flowchart of the steps of a structure-priority image compression method provided in an embodiment of the present application.
[0014] Figure 2 A flowchart of the steps for obtaining topological feature data provided in an embodiment of the present application.
[0015] Figure 3 A flowchart of the steps for converting topological feature data into coding control parameters provided in an embodiment of the present application.
[0016] Figure 4 A flowchart of the steps for identifying a set of structural key points provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or are inherent to these processes, methods, products or apparatus.
[0019] The study found that existing technologies evenly distribute bit rates during the compression process and are unable to distinguish the importance differences between anatomical structures and non-critical areas, resulting in the destruction of important edges and topological features during the quantization process. Although deep learning compression methods can learn feature representations, their black box nature makes it difficult to guarantee the accurate retention of specific structures and requires a large amount of labeled data for training. In the field of medical imaging, this structural distortion may cause misjudgment of vascular connectivity or distortion of lesion morphology, directly affecting clinical diagnosis. Existing technologies lack the ability to mathematically model the underlying topological features of images and are unable to actively protect key geometric structures during the compression process. This is a fundamental technical bottleneck restricting the development of high-fidelity compression.
[0020] like Figure 1 As shown, a structure-priority image compression method is proposed, which includes the following steps:
[0021] Get the image to be compressed;
[0022] In the embodiment of the present application, the image to be compressed is a thin-slice lung CT image in DICOM format, with a resolution of 512×512, a slice thickness of 0.625mm, and a pixel value range of -1000HU to 3000HU. Furthermore, the HU values are linearly mapped to a grayscale range of 0-255 using the following mapping formula: Gray = (HU + 1000) × 255 / 4000. The preprocessed image data is then input into the subsequent processing module as the image to be compressed. Where HU represents the pixel value in the CT image, and Gray represents the grayscale value of the image after the linear mapping.
[0023] Based on the image to be compressed, topological feature extraction is performed to obtain topological feature data that represents the connectivity and hole structure of the image;
[0024] Specifically, the connectivity between image pixels is extracted, such as whether there are closed areas, channels, holes, and other geometric structures in the image. The obtained topological feature data can describe which areas in the image are connected and whether there are hole-like structures, such as a ring of 0s surrounding a piece of 1.
[0025] Based on the image to be compressed, structural key point detection is performed to identify the set of structural key points that affect the topological stability of the image;
[0026] Specifically, not all pixels in an image to be compressed are equally important. Some pixels, such as edges, corners, or feature intersections, play a skeletal role in maintaining the image's shape, outline, or structure. Detecting these key points is the process of identifying these skeletons. This ensures that the overall structure of the image remains intact after compression. For example, the outline of a face or the shape of a traffic sign should remain as consistent as possible even after compression. Therefore, it is important to identify those points whose loss or blurring would disrupt the image structure and prioritize their preservation.
[0027] Generate a topological importance heat map based on topological feature data and a set of structural key points; the topological importance heat map quantifies the structural importance of each region of the image;
[0028] Specifically, based on topological feature data and a set of structural keypoints, each image region is evaluated to determine its criticality within the overall structure. The results are then visualized as a heat map. For example, the hotter the color (e.g., red), the more important the region is within the structure. This clearly identifies which image regions should not be discarded during compression or reconstruction, providing structural guidance for subsequent compression, encoding, or modeling.
[0029] Based on the topological importance heat map, the compressed image is adaptively encoded. High-fidelity encoding parameters are used for structurally important areas, and high-compression ratio encoding parameters are used for non-critical areas, generating compressed image data that maintains the integrity of key structures.
[0030] Specifically, different compression strategies are employed for different regions: important areas are compressed less, retaining more detail; less important areas are compressed more aggressively to save space. Although the resulting image is compressed, key topological features, such as connectivity structures, holes, and boundaries, are fully preserved, ensuring that the image's structure is not lost due to compression.
[0031] like Figure 2 As shown, according to one aspect of the present application, obtaining topological feature data includes:
[0032] Construct a topological space representation of the image to be compressed, calculate the evolution of the homology groups in each dimension (for example, using a continuous homology algorithm), and generate a set of birth-death intervals containing characteristic birth and death thresholds;
[0033] For each birth-death interval, the persistence lifespan is calculated. The persistence lifespan is the difference between the death threshold and the birth threshold, which quantifies the stability of the corresponding topological feature.
[0034] The birth-death interval set is filtered according to the preset persistence threshold, and the features with a persistence lifespan greater than the persistence threshold are retained to generate topological feature data representing the stable topological structure.
[0035] According to one aspect of the present application, the evolution process of the homology groups of each dimension is calculated by a continuous homology algorithm, including:
[0036] Construct a multi-resolution pyramid for the compressed image and generate a sequence of images with decreasing resolution {I k}, where k represents the pyramid level;
[0037] Perform a complete persistent homology calculation at the lowest resolution layer to obtain an initial set of topological features;
[0038] For higher resolution layers, incremental calculations are performed only in the local area where topological features are detected in the previous layer, and the correspondence between different levels is established through cross-resolution feature matching;
[0039] Bilinear interpolation is used to propagate the persistence lifetime value of the low-resolution layer to the corresponding features of the high-resolution layer, local persistence analysis is performed on the newly emerged features, and the results of each layer are merged to generate the approximate topological feature data of the complete image. The computational complexity is reduced from O(n 3 ) is reduced to O(n 2 log n).
[0040] In an optional solution, topological feature data may be obtained by:
[0041] Convert the image to be compressed into a grayscale scalar field and construct a sub-level set filtering sequence based on pixel values;
[0042] Compute 0-dimensional and 1-dimensional persistent homology groups for the filtered sequence, and track the generation and extinction of connected components and ring structures;
[0043] Record the birth-death interval of each topological feature, where the birth value represents the grayscale threshold at which the feature appears, and the death value represents the grayscale threshold at which the feature disappears;
[0044] Calculate the persistence lifetime τ = |death - birth|, and select features with τ greater than the preset persistence threshold as significant topological features;
[0045] The spatial location and persistence life of significant topological features are combined into topological feature data.
[0046] In a specific embodiment, a Vietoris-Rips complex is constructed for the preprocessed image, and the 0- and 1-dimensional homology groups are calculated using the GUDHI library. Specifically, the filter parameter is set to increment from 0 to 255 with a step size of 1. A birth-death interval set is obtained, in which 89 0-dimensional features and 35 1-dimensional features are detected. For example, the birth-death interval of the main bronchial bifurcation ring is (75, 255), and the persistence lifetime τ1 = 255 - 75 = 180, corresponding to the main bronchial bifurcation.
[0047] According to one aspect of the present application, the preset persistence threshold is adaptively determined in the following manner:
[0048] Calculate the persistence lifetime of all topological features from the birth-death interval set to form a persistence lifetime distribution;
[0049] Perform statistical analysis on the persistence life distribution and calculate the mean and standard deviation of the distribution;
[0050] The adaptive persistence threshold is determined according to the formula ε = μ + α·σ, where μ is the mean, σ is the standard deviation, and α is the preset control parameter. The control parameter is adjusted according to the target compression rate to achieve a balance between the number of features retained and the compression efficiency.
[0051] In one embodiment of the present application, the persistence lifetimes of all 124 features were calculated, yielding a mean μ = 42.3 and a standard deviation σ = 28.7. A control parameter α was set to 1.2, and an adaptive persistence threshold ε was set to 42.3 + 1.2 × 28.7 = 76.74. Features with a persistence lifetime greater than 76.74 were screened, and 12 stable topological features were retained. These included seven 0-dimensional features (connected branches) and five 1-dimensional features (ring structures).
[0052] like Figure 3 As shown, according to one aspect of the present application, the topology feature data is further converted into coding control parameters:
[0053] Extracting the persistence life of each retained feature from the topological feature data;
[0054] Establish a mapping function from persistence lifetime to encoding weight, normalize the persistence lifetime to a weight value between 0 and 1, where features with longer persistence lifetime receive higher fidelity weights;
[0055] The weight value is expanded into a spatial weight distribution according to the spatial position of the corresponding topological feature, which is the encoding control parameter, used to guide the parameter configuration of subsequent compression encoding.
[0056] In one embodiment of the present application, a mapping function is established for the 12 retained features. Specifically, the persistence lifetime is normalized: encoding weight = τ i / max(τ all ) = τ i / 180. For example, the encoding weight of the secondary bronchial ring (τ = 120) is 120 / 180 = 0.67. The weight value is expanded to a spatial distribution, and the corresponding weight is assigned within a range of 20 pixels around the feature location. i Indicates the persistence life corresponding to the i-th feature, max(τ all ) represents the largest τ value among all 12 retained features.
[0057] like Figure 4 As shown, according to one aspect of the present application, identifying a set of structural key points includes:
[0058] The image to be compressed is regarded as a scalar function defined on a two-dimensional manifold, the gradient field of the scalar function is calculated, and the candidate set of critical points with zero gradient is identified;
[0059] Calculate the eigenvalue of the Hessian matrix for each critical point in the critical point candidate set, and classify the critical point into a maximum point, a minimum point, or a saddle point according to the sign of the eigenvalue to obtain the classified critical point set;
[0060] Based on the classified critical point set, the connectivity of each critical point is calculated (e.g., based on discrete Morse theory) to quantify the number of gradient streamlines between the point and adjacent critical points;
[0061] The connectivity is used as the structural importance weight to form a set of structural key points containing position and weight information.
[0062] In an embodiment of the present application, a 3×3 Sobel operator is used to calculate the gradient field and identify 267 critical point candidates with zero gradient. The discrete Hessian matrix is calculated for each candidate point using the central difference format: H = [f_xx, f_xy; f_xy, f_yy]; where f_xx = (f(x+1, y) - 2f(x, y) + f(x-1, y)), and f_yy and f_xy are calculated similarly. A stability threshold δ = 0.5 is set, 43 unstable points are eliminated, and 224 critical points are retained. Classification results: 82 maximum points (corresponding to lung nodule candidates), 95 minimum points (corresponding to cavity areas), and 47 saddle points (corresponding to vascular bifurcations). Among them, 43 critical points were eliminated because their eigenvalues were less than the threshold. Based on the discrete Morse theory, the connectivity of each critical point is calculated. For example, the vascular bifurcation saddle point at (312, 185) is connected by 6 gradient streamlines, and the connection weight w 47 = 6.0. Where f(x, y) is the grayscale value of the image at the pixel position (x, y); f_xx is the second-order derivative in the x direction; f_yy is the second-order derivative in the y direction; and f_xy is the mixed partial derivative, which represents the curve when x and y change jointly.
[0063] According to one aspect of the present application, obtaining a classified critical point set includes:
[0064] The second-order partial derivatives are calculated at each critical point using the central difference scheme to form a discrete Hessian matrix (a 2×2 symmetric matrix).
[0065] Solve the eigenvalues λ1 and λ2 of the discrete Hessian matrix to reflect the local curvature characteristics of the function at that point;
[0066] When the eigenvalues λ1 and λ2 are both negative, they are determined to be maximum points; when they are both positive, they are determined to be minimum points; when they are of different signs, they are determined to be saddle points, and the classified critical point set is obtained;
[0067] For the case where the eigenvalue is close to zero, a stability threshold δ is introduced, and classification is performed only when |λ1|>δ and |λ2|>δ to avoid numerical instability caused by discretization.
[0068] According to one aspect of the present application, it further includes imposing a second-order derivative constraint on the saddle point neighborhood:
[0069] For each identified saddle point, the influence neighborhood (e.g., the influence neighborhood with radius r) is adaptively determined according to its connectivity.
[0070] Calculate the variation range of the second-order derivative affecting the image to be compressed in the neighborhood, and record the maximum and minimum curvature values;
[0071] According to the formula Q max = β × (|Ψ 2 f / Ψx 2 | max + |Ψ 2 f / Ψy 2 | max ) Calculate the maximum allowed quantization step size Q of the affected neighborhood max ; Where β is the preset scale factor, Ψ is the partial derivative, f is the scalar function representation of the image to be compressed, x and y are the horizontal and vertical coordinates of the image; the maximum allowable quantization step size is used as the upper limit of the compression coding parameter in this neighborhood.
[0072] In one embodiment of the present application, for 47 saddle points, the radius of the neighborhood of influence is determined based on the connectivity. Specifically, r = 2 × connectivity. For the saddle point at (312, 185), r = 2 × 6 = 12 pixels. The second-order derivative is calculated within this neighborhood to obtain |Ψ 2 f / Ψx 2 | max = 3.2, |Ψ 2 f / Ψy 2 | max = 2.8. Setting β = 0.8, calculate: Q max_local = 0.8 × (3.2 +2.8) = 4.8.
[0073] Optionally, a quantization step size that is no more than β times the original second-order derivative range can be used as the maximum allowable quantization step size Q of the neighborhood. max , where β is the preset proportional coefficient, and the maximum allowed quantization step size is used as the upper limit of the compression coding parameter in the neighborhood.
[0074] Optionally, the second-order derivative constraint imposed on the saddle point neighborhood can also be:
[0075] For each identified saddle point, define an influence neighborhood with a radius of r, where r is adaptively determined according to the connectivity of the saddle point;
[0076] Calculate the variation range of the second-order derivative of the original image in the affected neighborhood and record the maximum and minimum curvature values;
[0077] A neighborhood compression constraint mapping is generated to limit the quantization step size in the neighborhood to no more than a preset proportion β of the original second-order derivative range, so that the compressed image maintains curvature characteristics similar to the original image in the saddle point neighborhood, preventing the change of topological connection relationship due to excessive compression.
[0078] According to one aspect of the present application, generating a topology importance heat map includes:
[0079] Extract the spatial position coordinates and persistence lifetime τ of each feature from the topological feature data i , extract the position coordinates and connectivity weight w of each key point from the set of structural key points j ;
[0080] Calculate the Euclidean distance d of each pixel in the image to each topological feature and structural key point i and d j , apply Gaussian kernel function to convert distance into influence weight;
[0081] By the formula I(x, y) = Σ(τ i ·exp(-d i 2 / 2σ 2 )) + Σ(w j ·exp(-d j 2 / 2σ 2 )) Calculate the importance value I(x, y) of each pixel, where σ is the bandwidth parameter that controls the range of influence; τ i is the persistence lifetime of the i-th topological feature, w j is the connectivity weight of the jth structural key point, d i and d j are the distances from the pixel to the corresponding feature point;
[0082] The importance values are normalized to the interval [0, 1] to generate a topological importance heat map.
[0083] In one embodiment of the present application, the Gaussian kernel bandwidth σ is set to 8 pixels. The importance value is calculated for each pixel (x, y): I(x, y) = Σ(τ i •exp(-d i 2 / 2σ2 )) + Σ(w j •exp(-d j 2 / 2σ 2 )); the first term is the contribution of 12 topological features, and the second term is the contribution of 224 structural key points. For example, at coordinate (256, 278), the main bronchial bifurcation ring, the importance contribution within the surrounding 50 pixels is: main bronchial ring contribution: 180×exp(-16 2 / 128) =43.2; Contribution of adjacent maximum points: 3.5×exp(-25 2 / 128) = 0.42; after accumulating all contributions and normalizing, we get I(256, 278) = 0.92.
[0084] According to one aspect of the present application, generating compressed image data includes:
[0085] Read the importance value I(x, y) of each pixel position (x, y) in the topological importance heat map;
[0086] By the formula Q(x, y) = Q min + (Q max -Q min )·(1 - I(x,y)) γ Calculate the quantization step size, where Q min and Q max are the preset minimum and maximum quantization step sizes, respectively, and γ is a nonlinear parameter that controls the quantization step size change curve;
[0087] For pixels in the neighborhood of the saddle point, the quantization step size is compared with the maximum allowed quantization step size, and the smaller value of the two is taken as the final quantization step size;
[0088] Based on the image to be compressed, the final quantization step size is applied to the image encoder to achieve adaptive compression with topology preservation and generate compressed image data.
[0089] In one embodiment of the present application, Q is set min = 2, Q max = 16, γ = 1.5. Calculate the quantization step size for each pixel: Q(x, y) = 2 + (16-2) × (1-I(x, y)) 1.5 At (256, 278): Q(256, 278) = 2 + 14 × (1-0.92) 1.5 = 2.28; For pixels in the saddle point neighborhood, the calculated result is compared with the maximum allowed quantization step size Q max_localFor the detected vascular bifurcation saddle point (312, 185), its influence neighborhood radius r = 12 pixels, the maximum second-order derivative in the neighborhood |Ψ 2 f / Ψx 2 | max = 3.2, set β = 0.8, and calculate the upper limit of the quantization step size of this neighborhood: Q max_local = 0.8×(3.2 + 2.8) = 4.8.
[0090] According to one aspect of the present application, adaptive coding further includes dynamic code block allocation:
[0091] The local gradient of each position is calculated based on the importance value I(x, y) of the topological importance heat map. The local gradient reflects the spatial change rate of the importance value. The encoding code block size and code block size distribution are determined based on the importance value and local gradient:
[0092] When I(x, y) is greater than the high threshold θ h Or the local gradient is greater than the gradient threshold θ g When , 4×4 code blocks are allocated;
[0093] When I(x, y) is between the low threshold θ l and high threshold θ h and the local gradient does not exceed θ g When , 8×8 code blocks are allocated;
[0094] When I(x, y) is less than or equal to the low threshold θ l When , 16×16 code blocks are allocated;
[0095] The code block size distribution and the final quantization step size are jointly input into the image encoder. Fine code blocks and small quantization steps are used in topologically important areas, and coarse code blocks and large quantization steps are used in unimportant areas, achieving adaptive compression with topological structure preservation.
[0096] In one embodiment of the present application, the local gradient ▽I is calculated. A high threshold θ is set. h = 0.7, low threshold θ l =0.3, gradient threshold θ g= 0.15. Block allocation rule: When I(x, y) > 0.7 or |▽I| > 0.15, allocate 4×4 blocks; when 0.3 < I(x, y) ≤ 0.7 and |▽I| ≤ 0.15, allocate 8×8 blocks; when I(x, y) ≤ 0.3, allocate 16×16 blocks. Allocation results: 1247 4×4 blocks (12% of the area), 892 8×8 blocks (23% of the area), 624 16×16 blocks (65% of the area). Input the quantization step distribution Q(x, y) and the block size distribution into the EBCOT module of the JPEG2000 encoder to generate the compressed bitstream. Specifically, use fine quantization with Q values of 2 - 3 in the 4×4 block area and rough quantization with Q values of 12 - 16 in the 16×16 block area. The size of the compressed file is reduced from 512KB to 17KB, and the compression ratio is 30.1:1.
[0097] According to one aspect of the present application, it also includes performing a topological fidelity assessment on the compressed image data:
[0098] Perform persistent homology analysis on the original image and the compressed image respectively to generate the corresponding persistence diagrams PD o and PD c .
[0099] Specifically, extract the stable topological features that are not affected by minor perturbations from the original image and the compressed image for quantitative comparison. Persistent Homology Analysis is a technique applied to topological data analysis to study and quantify the topological features of a data set at different scales. In this embodiment, it is used to identify connected components (0 - dimensional features) and circular / hole structures (1 - dimensional features) in the image, etc., and evaluate the significance or persistence of these features. The Persistence Diagram (PD) is the output result of persistent homology analysis, usually a two - dimensional scatter plot. Each point (b, d) in the diagram represents a topological feature, where the abscissa b (birth threshold) represents the scale (such as gray value) at which the feature appears, and the ordinate d (death threshold) represents the scale at which it disappears. PD o refers to the persistence diagram obtained from the analysis of the original image (original), and PD c refers to the persistence diagram obtained from the analysis of the compressed image (compressed). The specific implementation method is: the original image I to be evaluated o and the image I after compressed reconstruction cAs input, both images are grayscale images, for example, single-channel images with a grayscale range of [0, 255]. A cubic complex (Cubical Complex) is constructed for each image. This is particularly well-suited for topological spatial representations of grid data (such as pixel arrays), where each pixel is considered a 0-dimensional element (vertex), pairs of adjacent pixels form 1-dimensional elements (edges), and 2x2 blocks of four pixels form 2-dimensional elements (faces). The Cubical Complex is filtered based on the grayscale values of the pixels. For example, starting with a grayscale value of 0, a threshold is gradually increased, adding all pixels with grayscale values less than or equal to the current threshold to the complex. During this process, new connected components or loops are created, while existing structures may die due to filling up. A persistent homology algorithm (e.g., implemented in computational topology libraries such as GUDHI or Dionysus) is used to track the changes in the 0-dimensional and 1-dimensional homology groups during the filtering process. The birth threshold b and death threshold d for each topological feature are recorded. These (b, d) pairs are used as point sets to generate persistence graphs (PDs). o and PD c Existing techniques such as PSNR and SSIM focus primarily on pixel-level differences or local structural similarities, but are unable to detect global topological structure disruptions, such as the disconnection of intact vascular rings after compression. This embodiment extracts a topological fingerprint (persistence map) that is insensitive to noise and minor deformations, providing a mathematical foundation for the subsequent fundamental quantification of this structural distortion.
[0100] Compute the Wasserstein distance W(PD) between two persistence graphs o , PD c ), Wasserstein distance quantifies the matching cost of topological features by solving the optimal transmission problem.
[0101] Specifically, the Wasserstein distance measures the minimum cost required to transform a point set in one persistence graph into a point set in another persistence graph. It is defined as the sum of distances between all point pairs, where matching can be between points or between points and diagonals (representing noise or insignificant features). The specific implementation method is: input two persistence graphs PD o and PD c The goal of calculating the Wasserstein distance is to find o Point to PD c The optimal matching φ (a bijection) of the points minimizes the total matching cost. Its mathematical form can be expressed as: W p (PD o , PD c ) =[inf φ Σ x∈PDo||x - φ(x)|| ∞ p ] 1 / p . Optionally, the second-order Wasserstein distance with p=2 is used. The calculation process is a typical assignment problem, and the optimal matching can be solved by methods such as the Hungarian algorithm or the auction algorithm. Points on the diagonal are also taken into account for matching. A point in a persistence graph can be matched to the diagonal of another graph at the cost of the distance from the point to its projection on the diagonal. The reason for choosing Wasserstein distance instead of other metrics (such as Hausdorff distance) is its stability. A small movement of a point in the persistence graph will only result in a small change in the Wasserstein distance, which ensures the robustness of the evaluation results. The calculated W(PD o , PD c ) value, the larger the compression process is, the more serious the damage to the topological structure of the image (such as connectivity and holes) is.
[0102] Normalize the Wasserstein distance to the interval [0, 1] to obtain the topological distance D topo , and simultaneously calculate the traditional structural similarity index SSIM of the original image and the compressed image.
[0103] Specifically, in order to eliminate the influence of the complexity of the image itself on the absolute value of the Wasserstein distance, normalization is required. A preferred normalization method is D topo = W(PD o , PD c ) / W(PD o , Φ), where W(PD o , Φ) is the original persistence graph PD o The Wasserstein distance between the empty graph (representing complete destruction) and the empty graph. In practice, W(PD o , Φ) is equal to PD o The p-norm of the distances from all points to the diagonal. Thus, D topo The value of is effectively constrained to the interval [0, 1], where 0 indicates that the topology is completely consistent and 1 indicates that the topology is completely lost. In parallel, the original image I is calculated using standard methods o and compressed image I cThe Structural Similarity Index (SSIM) between the two images is calculated. This calculation slides a window (e.g., 11x11) across the two images and compares the brightness, contrast, and structure components of each window. The result is a global SSIM value between -1 and 1. The closer the value is to 1, the more visually similar the two images are. This embodiment achieves two goals: first, it converts topological differences into an intuitive, bounded topological distance score; second, it introduces a mature traditional metric for measuring perceptual quality. This allows the final evaluation system to take into account two different but complementary dimensions: macroscopic structural integrity and microscopic pixel-level fidelity.
[0104] By formula TD-SSIM = α·SSIM + (1-α)·(1-D topo ) calculates the topology-aware structural similarity index, where α is a balance parameter and TD-SSIM reflects both local structural similarity and global topological fidelity.
[0105] In one embodiment of the present application, persistence homology analysis is performed on the original image and the compressed image respectively. The Wasserstein distance W(PD) between the two persistence graphs is calculated. o , PD c ) = 3.2, normalized to get D topo = 0.08. Calculating the traditional SSIM = 0.89, setting the balancing parameter α = 0.7 yields: TD-SSIM = 0.7 × 0.89 + 0.3 × (1-0.08) = 0.899. Through the above steps, at a compression ratio of 30:1, the 0-dimensional Betty number of the pulmonary bronchi remains unchanged (β0 error is 0), and the 1-dimensional Betty number error is less than 5%, effectively preserving the topological features of key anatomical structures. At a compression ratio of 30:1, the position error of the pulmonary bronchial bifurcation points is less than 0.5 pixels, improving the connectivity preservation rate of small bronchi of grades 7-9 (diameter 0.8-1.2 mm). This embodiment addresses the technical issue of the one-sidedness of single-metric evaluation. By balancing the parameter α, users can adjust the emphasis on topological fidelity based on the needs of specific application scenarios. For example, in medical diagnostic images, maintaining the connectivity of vascular networks is crucial. In this case, a smaller α value (such as 0.5-0.7) can be set to increase the penalty for topological errors. In common scenes, a larger α value (such as 0.8-0.9) can be set to focus on visual experience. In some embodiments, the balance parameter α may not be a fixed value, but may be adaptively determined based on the image content. For example, for images with more complex topological structures (such as PD oThe value of α can be automatically reduced if the image contains more points far from the diagonal. For example, in the scenario of compression evaluation of a 512x512 pixel lung CT image, the original image is compressed by the method of the present invention with a compression ratio of 30:1. Persistent homology analysis is performed on the original image and the compressed image to generate PD o and PD c . Calculate the Wasserstein distance W(PD o , PD c ), the test value is 3.2. Normalization is performed to obtain D topo = 0.08; at the same time, the SSIM value between the two images is calculated to be 0.89. Set the balance parameter α=0.7, and calculate TD-SSIM = 0.7 × 0.89 +(1-0.7) × (1-0.08) = 0.623 + 0.3 × 0.92 = 0.899. Through the above steps, not only the evaluation of the compressed image is achieved, but more importantly, an evaluation method that can quantify the degree of preservation of key structures is provided. The test shows that the TD-SSIM index obtained by using this embodiment is 0.899. In comparison, if traditional JPEG2000 is used for compression at the same compression ratio, a similar SSIM value (such as 0.88) may appear. However, since it destroys the connectivity of some small bronchi, its D topo The value may be as high as 0.3, resulting in a significant decrease in its TD-SSIM value. This proves that this embodiment can effectively distinguish compression technologies that perform better in preserving topological structures, solving the technical problem that traditional evaluation indicators cannot effectively measure the fidelity of key structures.
[0106] According to another aspect of the present application, a structure-priority image compression method includes: after the system receives an input image, converting the pixel array into a topological space through cubic complex modeling, using a fast persistent homology algorithm to calculate a 0-1 persistence diagram (Persistence Diagram), and generating a two-dimensional point set describing the hole life cycle (birth-death); applying Morse theory to construct an image height field, detecting critical points through a gradient operator with a convolution kernel of [-1, 0, 1]Θ[1, 2, 1], and classifying maximum / minimum values in combination with Hessian matrix eigenvalues, where Θ is a tensor product; fusing topological features (persistence life) and geometric features (critical point density) into a heat map, and normalizing them to importance weights in the [0, 1] interval using a sigmoid function; inputting the weight matrix into an improved JPEG2000 encoder, wherein the embedded block coding and optimal truncation algorithm (EBCOT) code block size is dynamically adjusted according to the heat map value (8×8 is used in high-weight areas and 32×32 is used in low-weight areas), and the quantization step size δ is calculated according to δ=δ base×(1+β(1-w)) adjustment, β is the compression strength coefficient, δ base is the base quantization step size, and w is the normalized regional importance weight. The entire process is GPU-accelerated via OpenCL, with a particular optimization for the parallel construction of the Vietoris-Rips complex.
[0107] Specifically, taking liver CT image compression as an example, the specific implementation process is as follows: 1) DICOM preprocessing stage, the 16-bit grayscale value is linearly mapped to [0, 255] and a 3×3×3 voxel cube complex is constructed; 2) Topological analysis stage, persistent homology is calculated to discover the 1-dimensional ring structure formed by the portal vein branches (persistence lifetime >120HU), and Morse detection is used to locate 132 saddle points at the edges of the liver lobes; 3) Heat map generation stage, Gaussian diffusion (σ=5px) is applied to the topological features and weighted fusion is performed with the Sobel edge detection results; 4) Compression execution stage, fine quantization with a quantization step size Δ=2 is used for the portal vein area (thermal map value >0.7), while coarse quantization with a quantization step size of Δ=15 is used for the liver parenchyma area (thermal map value <0.3); 5) Post-processing stage, the integrity of key structures is verified through topologically constrained CSF (Compressed Sensing Framework) reconstruction to ensure that the connectivity of the hepatic veins is not damaged. Actual measurements of this process on the Philips iCT256 device showed that compressed scan data with a 2mm layer thickness can still meet the accuracy requirements of the RECIST1.1 standard for lesion measurement.
[0108] This embodiment constructs a three-layer processing architecture based on algebraic topology theory: First, a continuous homology algorithm is used to establish a topological feature space model of the image. Its mathematical model can be expressed as the boundary operator matrix Ψ of the cube complex C. k Null space calculation (ie H k (C)=kerΨ k / imΨ k+1 ), by calculating the Betti number β of each dimension k =dimH k (C) Quantify the number of connected branches (β0) and holes (β1). Next, a gradient vector field detection module based on Morse theory is constructed, constructing the critical point mapping function f: image → R f(x, y) = I*(x, y) + λ|| ▽ I*(x, y)||, where the weight factor λ controls the edge response strength. The maximum / minimum points are determined by the eigenvalues of the Hessian matrix as structural anchor points. Finally, a rate allocation optimization model is established: min∑( Q(i, j) - I(i, j)) 2 +α∑| ▽Q|·M topo , where Q is the quantized image, M topois the topology importance heat map, and α controls the structural fidelity weight. Key technical parameters include the filtering threshold ε*∈[0, 255] in continuous coherence, λ∈[0.1, 0.5] in the Morse function, and α∈[1.0, 3.0] in the bit rate distribution. These parameters were optimized and determined in the PACS system image library through preliminary experiments. k (C) is the homology group of the cube complex C in the kth dimension; I*(x, y) is the grayscale value or intensity value of the input image at the pixel point (x, y); ▽ is the gradient operator.
[0109] This embodiment maps persistent coherent birth-death intervals into rate allocation weights, establishing a mathematical relationship between topological features and compression parameters. A critical point protection mechanism based on the Morse-Smale complex is proposed, maintaining the topological structure by constraining the second-order derivative of the quantization error function in the saddle point neighborhood (|H(f)|>0.1). A layered code block control method is constructed to dynamically couple the code block partitioning of the EBCOT encoder with the topological importance heat map. A mixed-precision quantization strategy is developed, using an 8-bit lossless mode for regions with high persistence features (lifetime / maximum lifetime>0.8) and a 4-bit lossy mode for other regions. Finally, a topological distortion assessment metric, TD-SSIM (Topological Distance-SSIM), is constructed, incorporating the Betti number change rate into traditional structural similarity calculations. This resolves the technical contradiction of existing standards, which cannot achieve both high compression ratio and structural fidelity. Specifically, the continuous coherence module accurately identifies areas to be protected (such as holes with β1 > 2), Morse detection achieves sub-pixel edge localization accuracy (0.3 pixel error), and adaptive quantization preserves ≥95% of the critical point topology while maintaining a 30:1 compression ratio. A heat map guides the encoder to skip fine quantization in non-critical areas, enabling intelligent reallocation of computing resources.
[0110] In a specific embodiment in the medical field, the method includes the following steps:
[0111] Step 1: Medical image input and normalization preprocessing This system uses 12-bit grayscale CT images in DICOM format as input and eliminates the influence of device differences through the grayscale normalization module. Let the original image be I∈R (M×N) , where R is the real number domain, M and N are the vertical and horizontal dimensions of the image, and the pixel value range is [0, 4095]. Extract the region of interest I mask :I mask (x, y) = 1, if I(x, y)>μ+2σ; 0, otherwise. Where μ=E[I] is the global mean, σ=Std[I] is the standard deviation. The normalization formula is: I norm (x, y) = (I(x, y) - μ ROI) / (3σ ROI ), the mean grayscale value of pixels in the region of interest μ ROI =E[I○I mask ], the standard deviation of pixel grayscale in the region of interest σ ROI =Std[I○I mask ]; the normalized image is constrained to the interval [-4, 4], and any excess is truncated. Processing a 512×512 image takes 8 ms on a Philips iCT256 device. Where I(x, y) is the grayscale value of the original image at pixel position (x, y), and ○ is the element-wise product.
[0112] Step 2: Cube complex construction and persistent homology calculation Convert the normalized image into a cube complex C. Each pixel corresponds to a 0-simplex, adjacent pixels form a 1-simplex (edge connection), and closed areas form a 2-simplex (face filling). Use a fast persistent homology algorithm to calculate the homology group of each dimension: H k (C)=kerΨ k / imΨ k+1 , k∈{0,1}; where Ψ k is the k-dimensional boundary operator matrix. Output persistence graph PH k ={(b i , d i )}, where b i is the characteristic birth threshold, d i is the death threshold, and the persistence τ i =d i -b i ≥0.15 features. Computation time is optimized to 35ms (NVIDIA A100 GPU).
[0113] Step 3: Morse critical point detection and classification Based on Morse theory, the image height field f(x, y) = I is constructed. norm (x, y) + 0.3 | ▽ I norm |, use the Sobel operator to calculate the gradient field: ▽I=[(-1, 0, 1; -2, 0, 2; -1, 0, 1)]I, detect the critical point set CP={(x, y)|▽f=0}, and determine the type by the Hessian matrix eigenvalue: Hessian matrix H(f)=[f_xx, f_xy; f_xy, f_yy], λ 1,2 =(tr(H)±sqrt(tr(H) 2 -4det(H))) / 2; when det(H)>0 and f_xx<0, it is a maximum point, det(H)>0 and f_xx>0 is a minimum point, and det(H<0 is a saddle point. 512×512 images detect an average of 132 critical points, taking 22ms. 1,2are the two eigenvalues of the Hessian matrix; det(H) is the determinant of the Hessian matrix.
[0114] Step 4: Topological importance heat map generation Fusion of continuous homology and critical point features to generate heat map: H(x, y) = 0.6∑ ci∈CP e^(-(|(x,y)-c i | 2 ) / (2×3 2 )) +0.4∑ (b,d)∈PH1 (τ i / (max( τ)))·A i (x, y); where ^ represents a superscript; τ i =d i -b i For the continuous life, A i is the area affected by the hole (morphologically expanded by 5 pixels). The heat map is normalized to [0, 1] using the sigmoid function, and the threshold H th =0.7 to distinguish key areas. Processing time is 18ms and memory usage is optimized to 12MB.
[0115] Step 5: Adaptive Quantization and Encoding. The quantization parameter Q(x, y) is dynamically adjusted based on the heat map: Q(x, y) = 8 × (1 + 1.2 × (0.7 - H(x, y)) / (0.7 - 0.1)). DPCM lossless encoding is used for regions where H(x, y) ≥ 0.7. Other regions are subjected to DCT transform and quantized with a step size of Q(x, y). The EBCOT encoder's code block allocation strategy is improved: B(x, y) = {8 × 8, H(x, y) ≥ 0.5; 16 × 16, 0.3 ≤ H(x, y) < 0.5; 32 × 32, H(x, y) < 0.3}. While maintaining a 30:1 compression ratio, the PSNR reaches 48 dB in critical areas and 32 dB in non-critical areas, with encoding time of 67 ms.
[0116] Step 6: Topological integrity verification and output Verify the topological features of the reconstructed image I' through the compressed sensing framework: calculate the persistent homology PH' of I' k , ensure |PH k -PH' k | / |PH k |<5%; Check the critical point position offset Δc i =|c i -c' i|<0.5pixel; calculate the topological structure similarity (TD-SSIM) index: TD-SSIM=0.8×SSIM+0.2×(1-(|β0-β'0|+|β1-β'1|) / (β0+β1)). Finally, a compressed file that complies with the DICOM WS-07 standard is generated, and the file header is supplemented with topological metadata (PH k parameters, critical point coordinates), the average compression time is 152ms. k is the k-dimensional continuous homology feature set; c' i is the coordinate of the i-th critical point after image reconstruction; β'0 is the number of 0-dimensional connected branches in the reconstructed image; and β'1 is the number of 1-dimensional holes (rings) in the reconstructed image. Tests have shown that, with a compression ratio of 30:1 for liver CT images, the portal vein bifurcation error rate is reduced; the total latency of the processing pipeline for a single 512×512 image is less than 160ms (NVIDIA A100); vascular connectivity is maintained at 99.3% (Euler number change Δχ = 0.2); and the bitstream header information ratio is reduced (optimized by topological metadata compression). A modular design implements the complete chain from topological feature extraction to heatmap generation to adaptive encoding. By exchanging data through shared memory, peak memory usage is kept below 1.2GB.
[0117] This invention achieves lossless compression of key diagnostic structures in medical imaging, improving the reliability of telemedicine. For 3D CT / MRI image data, a continuous homology algorithm automatically extracts topological features such as bifurcation points in vascular networks (0-dimensional homology class β0 ≥ 3) and closed boundaries of tumor lesions (1-dimensional homology class β1 ≥ 1). This algorithm then generates a structural importance heat map to guide bitrate allocation. Using thin-slice CT of the lung (0.625mm slice thickness) as an example, lossless quantization with a Δ=2 ratio is used for bronchial branches of levels 7-9 (0.8-1.2mm in diameter) at a compression ratio of 30:1, while lossy compression with a Δ=15 ratio is used for alveolar regions. This reduces the micro-airway loss rate from 34% to below 5% compared to the JPEG2000 standard. The key features of this method include: constructing a 3×3×3 voxel cube complex to accurately calculate the 3D persistent homology of the bronchial tree (with a persistence threshold of ε = 120 HU); locating 238 saddle points based on the Morse-Smale complex, and constraining the quantization error to be less than 0.5 HU in the vicinity of the saddle points; and dynamic code block control, using 8×8 EBCOT encoding for critical areas and 32×32 large code blocks for non-critical areas. Medical test data shows that this method reduces the Hausdorff distance error of compressed 0.5mm lung nodules, meeting the structural integrity requirements of the DICOM WS-07 standard.
[0118] In the field of industrial high-precision defect detection, this invention provides a compression solution for semiconductor manufacturing that balances detection accuracy and storage efficiency. For wafer defect inspection images (resolution 0.1μm / pixel), Morse theory gradient field analysis is used to locate the critical points (regions of gradient mutation) of micron-scale scratches. Persistent coherence is then used to distinguish between true defects (isolated points β0 ≥ 1) and process noise (transient voids β1 < 0.5). In specific implementation, 4-bit lossless quantization is used for detected ring defects (inner diameter ≥ 1μm), while 8-bit lossy compression is used for background areas. In TSMC's 16nm process line testing, this method improved defect recognition rates, reduced storage space, and increased processing speed compared to the JPEG2000 algorithm. By constructing a defect lifecycle assessment model, only topological features with a lifetime τ > 50ms are retained. A sub-pixel saddle point protection mechanism is developed, constraining the rate of change of the second-order derivative of the quantization error function in a 3×3 neighborhood of the critical point to ≤5%. Adaptive bitrate allocation increases the bitrate contribution of defective areas.
[0119] In the field of topology preservation of remote sensing objects, the present invention solves the problem of object structure distortion caused by remote sensing image compression, and provides a reliable data basis for intelligent interpretation. For 0.5-meter resolution multispectral satellite images, the system constructs a spatial adaptive quantization matrix by continuously and coherently extracting features such as connected branches of road networks (β0 change rate <5%) and closed boundaries of water areas (β1≥1). The implementation of key technologies includes: using Δ=3 fine quantization for road intersections (5×5 pixel neighborhood β0≥4); using Δ=5 medium quantization for water boundary rings (circumference ≥50 pixels); and implementing Δ=12 coarse quantization for vegetation areas. Tests show that in the compression of urban remote sensing images: the topological error rate of road intersections and the Hausdorff distance error of water contours are reduced; when the compression ratio is maintained at 15:1, the connectivity integrity of the vectorized road network is improved. Mapping the topological persistence τ to the quantization step size Δ=Δ max ×(1-τ / 255), achieving lossless preservation of key nodes in the road network.
[0120] The present invention establishes a mathematical mapping relationship between topological features and compression parameters. The topological fingerprint of the image is extracted by the persistent homology algorithm: 0-dimensional homology characterizes the number of connected branches, 1-dimensional homology describes the characteristics of the ring structure, and 2-dimensional homology corresponds to the hollow structure. Combined with Morse theory, the critical points affecting the topological stability are identified, and an adaptive mapping model from Batty number to quantization step size is constructed. The life cycle concept of persistent homology is introduced, and the importance of the structure is quantized as a function of survival time and birth-death interval, providing a rigorous mathematical basis for bit rate allocation. A deep fusion of algebraic topology theory and compression coding is achieved. By designing a topology-aware bit rate allocation model, the portal vein bifurcation error rate is reduced in the liver CT compression test, while the overall compression rate is improved. The persistence diagram is converted into a quantization step size control parameter to achieve lossless compression of key structures under the JPEG2000 framework. While maintaining the same compression rate, the error in blood vessel diameter measurement is reduced, establishing a new standard for diagnostic-level image transmission.
[0121] The preferred embodiments of the present invention are described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the scope of protection of the present invention.
Claims
1. A structure-priority image compression method, characterized in that: include: Get the image to be compressed, and: Perform topological feature extraction to obtain topological feature data that characterizes image connectivity and hole structure; Perform structural key point detection to identify the set of structural key points that affect the topological stability of the image; Generate a topological importance heat map based on topological feature data and a set of structural key points; Adaptively encode the image to be compressed based on the topological importance heat map to generate compressed image data that maintains the integrity of key structures; Identify a set of structural key points, including: The image to be compressed is regarded as a scalar function defined on a two-dimensional manifold, its gradient field is calculated, and the candidate set of critical points with zero gradient is identified; Calculate the eigenvalue of the Hessian matrix for each critical point in the critical point candidate set, and classify the critical point into a maximum point, a minimum point, or a saddle point according to the sign of the eigenvalue to obtain the classified critical point set; Based on the classified critical point set, the connectivity of each critical point is calculated and used as the structural importance weight to form a set of structural key points containing position and weight information.
2. The method according to claim 1, characterized in that Obtain topological feature data, including: Construct a topological space representation of the image to be compressed, calculate the evolution process of the homology group of each dimension, and generate a birth-death interval set containing characteristic birth thresholds and death thresholds; For each birth-death interval, the persistence life span is calculated as the difference between the death threshold and the birth threshold; The birth-death interval set is filtered according to the preset persistence threshold, and the features with a persistence lifespan greater than the persistence threshold are retained to generate topological feature data representing the stable topological structure.
3. The method according to claim 2, characterized in that It also includes converting topological feature data into coded control parameters: Extracting the persistence life of each retained feature from the topological feature data; Establish a mapping function from persistence lifetime to encoding weight, normalize the persistence lifetime to a weight value between 0 and 1, where features with longer persistence lifetime receive higher fidelity weights; The weight value is expanded into a spatial weight distribution according to the spatial position of the corresponding topological feature, which is the encoding control parameter.
4. The method according to claim 2, characterized in that The preset persistence threshold is adaptively determined in the following way: Calculate the persistence lifetime of all topological features from the birth-death interval set to form a persistence lifetime distribution; Perform statistical analysis on the persistence life distribution and calculate the mean and standard deviation of the distribution; The adaptive persistence threshold is determined according to the formula ε = μ + α·σ, where μ is the mean, σ is the standard deviation, and α is the preset control parameter, which is adjusted according to the target compression rate.
5. The method according to claim 1, characterized in that The classified critical point set is obtained, including: The second-order partial derivatives are calculated at each critical point using the central difference scheme to form a discrete Hessian matrix; Solve the eigenvalues λ1 and λ2 of the discrete Hessian matrix; when the eigenvalues λ1 and λ2 are both negative, they are determined to be maximum points; when they are both positive, they are determined to be minimum points; when they are of different signs, they are determined to be saddle points, and the classified critical point set is obtained; For the case where the eigenvalue is close to zero, a stability threshold δ is introduced, and classification is performed only when |λ1|>δ and |λ2|>δ.
6. The method according to claim 5, characterized in that This also includes imposing second-order derivative constraints on the neighborhood of the saddle point: For each identified saddle point, the influential neighborhood is adaptively determined based on its connectivity; Calculate the variation range of the second-order derivative affecting the image to be compressed in the neighborhood, and record the maximum and minimum curvature values; According to the formula Q max = β × (|Ψ 2 f / Ψx 2 | max + |Ψ 2 f / Ψy 2 | max ) Calculate the maximum allowed quantization step size Q of the affected neighborhood max ; Where β is the preset scale factor, Ψ is the partial derivative, f is the scalar function representation of the image to be compressed, and x and y are the horizontal and vertical coordinates of the image.
7. The method according to claim 1, characterized in that Generate topology importance heatmaps, including: Extract the spatial position coordinates and persistence lifetime τ of each feature from the topological feature data i , extract the position coordinates and connectivity weight w of each key point from the set of structural key points j ; Calculate the Euclidean distance d of each pixel in the image to each topological feature and structural key point i and d j ; By the formula I(x, y) = Σ(τ i ·exp(-d i 2 / 2σ 2 )) + Σ(w j ·exp(-d j 2 / 2σ 2 )) Calculate the importance value I(x, y) of each pixel, where σ is the bandwidth parameter that controls the range of influence; The importance values are normalized to the interval [0, 1] to generate a topological importance heat map.
8. The method according to claim 6, characterized in that Generate compressed image data, including: Read the importance value I(x, y) of each pixel position (x, y) in the topological importance heat map; By the formula Q(x, y) = Q min + (Q max -Q min )·(1 - I(x,y)) γ Calculate the quantization step size, where Q min and Q max are the preset minimum and maximum quantization step sizes, respectively, and γ is a nonlinear parameter that controls the quantization step size change curve; For pixels in the neighborhood of the saddle point, the quantization step size is compared with the maximum allowed quantization step size, and the smaller value of the two is taken as the final quantization step size; Based on the image to be compressed, the final quantization step size is applied to the image encoder to generate compressed image data.
9. The method according to claim 8, characterized in that Adaptive coding also includes dynamic code block allocation: The local gradient of each position is calculated based on the importance value I(x, y) of the topological importance heat map; the code block size distribution is determined accordingly: When I(x, y) is greater than the high threshold θ h Or the local gradient is greater than the gradient threshold θ g When , 4×4 code blocks are allocated; When I(x, y) is between the low threshold θ l and high threshold θ h and the local gradient does not exceed θ g When , 8×8 code blocks are allocated; When I(x, y) is less than or equal to the low threshold θ l When , 16×16 code blocks are allocated; The code block size distribution and the final quantization step size are jointly input into the image encoder to achieve adaptive compression with topology preservation.