Image semantic segmentation method for separating attention based on space channel

By introducing visual potential propagation and flux conservation constraints into the image semantic segmentation model, the problems of feature redundancy and weight instability in existing models are solved, achieving higher accuracy and more stable semantic segmentation results.

CN121963211APending Publication Date: 2026-05-01OCEAN UNIV OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610113302.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing spatial-channel joint attention models suffer from feature redundancy and unstable weights during computation, lack physical interpretability, resulting in loss of boundary details or blurred target contours, and degraded segmentation performance in elongated structures or low-contrast scenes.

Method used

By introducing visual potential propagation and flux conservation constraints, and using potential diffusion and gradient guidance in spatial and channel feature modeling, the continuity of the target boundary is enhanced, and energy balance is maintained in the feature fusion stage. Adaptive adjustment of semantic channels is achieved by using a capacitor-like coupling mechanism.

Benefits of technology

It significantly improves the boundary accuracy and target integrity of semantic segmentation, enhances the robustness and segmentation accuracy of the model, and ensures the stability and clarity of the segmentation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121963211A_ABST
    Figure CN121963211A_ABST
Patent Text Reader

Abstract

The invention discloses an image semantic segmentation method for separating attention based on a space channel. The method comprises the following steps: preprocessing an input image and extracting multi-scale features by an encoder; constructing a visual potential source item and solving a Poisson equation to obtain a potential field and a potential gradient; generating a space weight graph by utilizing the potential field, and forming a boundary enhancement weight graph by combining the potential gradient to realize space gating; channel characteristics are regarded as parallel capacitor layers to generate channel coupling weights for channel gating; fusing space and channel enhancement features; and a semantic segmentation result is output through step-by-step decoding. According to the method, by introducing a visual potential propagation and flux conservation mechanism, energy balance and accurate boundary control are realized in space and channel modeling, and the structural integrity and stability of a semantic segmentation result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

A semantic image segmentation method based on spatial channel separation attention Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image semantic segmentation method based on spatial channel separation attention. Background Technology

[0002] Image semantic segmentation is one of the core tasks in computer vision. Its goal is to semantically classify each pixel in an input image, thereby achieving accurate object recognition and region segmentation. With the development of deep learning, semantic segmentation methods based on convolutional neural networks have become the mainstream approach. Existing methods typically employ an encoder-decoder structure, using multi-scale feature extraction and progressive upsampling to segment the target region. To enhance the model's ability to pay attention to spatial layout and semantic channels, researchers have proposed various attention mechanisms, such as channel attention, spatial attention, and joint attention structures combining both.

[0003] Existing spatial-channel joint attention models generally suffer from the following problems: spatial attention and channel attention are usually coupled through weighting or serial-parallel methods, and they interfere with each other during the calculation process, resulting in feature redundancy and unstable weights; the generation of attention weights is mostly based on correlation or Softmax normalization operations, lacking physical interpretation and numerical constraints, which can easily lead to the loss of boundary details or blurring of target contours; existing fusion methods ignore the energy transfer laws and local balance relationships between features, and the model may experience problems such as over-suppression or over-amplification of features during training, thereby reducing segmentation accuracy; traditional attention mechanisms focus on statistical significance modeling and cannot guarantee spatial continuity and boundary consistency during feature propagation, especially in slender structures or low-contrast scenes where segmentation performance degrades significantly.

[0004] Therefore, how to provide an image semantic segmentation method based on spatial channel separation attention is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose an image semantic segmentation method based on spatial channel separation attention. This invention achieves physical interpretability and energy balance control of feature weight generation by introducing visual potential propagation and flux conservation constraints in spatial and channel feature modeling. In spatial branching, the continuity of target boundaries is enhanced through potential diffusion and gradient guidance. In channel branching, a capacitor-like coupling mechanism is used to achieve adaptive adjustment of semantic channels. In the feature fusion stage, local flux conservation constraints are used to maintain stable energy distribution. In the decoding stage, the potential gradient is used as a boundary guidance signal to refine the output results. Thus, while ensuring the model's lightweight nature and numerical stability, the boundary accuracy, target integrity, and overall robustness of semantic segmentation are significantly improved.

[0006] An image semantic segmentation method based on spatial channel separation attention according to an embodiment of the present invention includes the following steps:

[0007] The input image is preprocessed and a multi-scale feature set is extracted by the encoder;

[0008] Visual potential source terms are constructed for features at each scale, and the discrete Poisson equation is solved under preset boundary conditions to obtain the corresponding potential field and potential gradient.

[0009] The electric potential field is normalized and mapped to a spatial weight map, and a boundary enhancement weight map is formed with the electric potential gradient. Spatial gating is performed on the feature to obtain spatially enhanced features.

[0010] The channel dimension features are treated as parallel capacitor layers. Channel coupling weights are generated based on channel statistics and potential response differences. Channel gating is then applied to the features to obtain channel enhancement features.

[0011] The spatial enhancement features and channel enhancement features are fused based on the local flux conservation constraint to obtain the enhancement features;

[0012] The enhanced features are decoded step by step, and the semantic segmentation result of the target image is output.

[0013] Furthermore, the preprocessing includes:

[0014] Perform color space unification, brightness normalization, random geometric transformation, and class equalization sampling on the input image:

[0015] The color space unification includes: after reading the input image, converting it from the original acquisition format to the RGB color space, and performing linear normalization on each channel to unify the pixel value range to a preset range;

[0016] The brightness normalization includes: calculating the global average brightness and performing brightness compensation to ensure a stable brightness distribution in the input image;

[0017] The random geometric transformation includes: randomly selecting rotation, scaling, or flipping operations on the input image, cropping the image to the network input size after performing the geometric transformation, and normalizing the cropped area.

[0018] The category-balanced sampling includes: during the training phase, dynamically adjusting the sample selection probability based on the frequency of each category in the dataset.

[0019] It also uses edge detection operators to generate edge hint maps, performs edge detection operations on geometrically enhanced images, extracts regions with large gray-level gradients and generates gray-level edge hint maps;

[0020] The encoder is a convolutional backbone network with a progressive downsampling structure. The backbone network contains multiple feature extraction units in sequence. Each unit includes a convolutional layer, a normalization layer, and an activation layer. The resolution is progressively reduced through stride convolution, and multiple levels of feature maps are output. Each level of feature map represents semantic information at different scales.

[0021] Each layer's features are output after pointwise convolution to align the channel dimensions, forming a multi-scale feature set.

[0022] Furthermore, the process of solving for the electric potential field and the electric potential gradient includes:

[0023] For each feature map, the gradient components are calculated in the horizontal and vertical directions. The gradient magnitude is obtained and the second derivative of the difference between adjacent pixels is calculated to obtain the Laplace response.

[0024] Channel aggregation is performed on the feature map to calculate the average response of each pixel and compare it with the global response mean to obtain the semantic saliency.

[0025] The gradient magnitude, Laplacian response, and semantic saliency are weighted and superimposed according to a preset ratio. In the resulting graph,

[0026] According to a preset threshold, pixel regions with gradient magnitude or significance higher than the preset threshold are set as positive source terms to drive potential diffusion.

[0027] Pixel regions with gradient magnitude or significance lower than a preset threshold are set as negative source terms to form a suppression region;

[0028] Positive and negative source terms together form visual potential source terms at the corresponding scale.

[0029] The discrete solution of the Poisson equation uses a five-point difference template to establish spatial neighborhood relationships, with the center pixel as the node and four adjacent pixels as the neighborhood, to establish spatial connection relationships between pixels.

[0030] Boundary cue maps are introduced at feature boundaries to determine Dirichlet boundary conditions to fix the threshold, and Neumann boundary conditions are set in the outer edge region of the image, with the constraint flux being zero.

[0031] Using the visual potential source term as input, the potential value is initialized on the grid of the corresponding scale. The potential of each pixel is updated step by step using the Gauss-Seidel iterative method. The calculation is terminated when the change between two adjacent iterations meets the convergence condition, and a spatially continuous potential field is obtained.

[0032] The first-order difference of the obtained electric potential field is calculated in two orthogonal directions to obtain the potential gradient components and synthesize the gradient magnitude map.

[0033] Furthermore, the calculation steps for the spatial enhancement features include:

[0034] Read the electric potential field and its potential gradient at the corresponding scale, and keep the spatial size consistent with the original feature map. Perform min-max normalization on the electric potential field to linearly map the numerical range to the standard interval. In multi-scale scenarios, use upsampling or downsampling operations to make the size completely aligned with the feature map to obtain the spatial weight map.

[0035] Boundary distribution information is extracted based on the direction and rate of change of the potential gradient, and gradient connectivity is established between adjacent pixels;

[0036] By traversing each pixel of the gradient field, calculating its gradient direction vector and determining the directional continuity between adjacent pixels, when the gradient direction is continuous and the rate of change exceeds the set change standard, the connected region is marked as a potential boundary region, and a boundary enhancement weight map is generated.

[0037] The spatial weight map is used as a global spatial structure constraint, and the boundary enhancement weight map is used as a local boundary compensation. The comprehensive spatial weight distribution is obtained by pixel-by-pixel weighted fusion.

[0038] Using the comprehensive spatial weight map as a gating factor, the feature map at the corresponding scale is subjected to pixel-wise weighted modulation, and the modulated output is denoted as the spatial enhancement feature.

[0039] Furthermore, the calculation steps for the channel enhancement features include:

[0040] The responses of each channel in the multi-scale feature map are regarded as capacitor units connected in parallel. In the same scale feature map, the response mapping of each channel is regarded as a charge storage unit. Different channels share the same spatial location but store different semantic energies. Through traversal operations on the channel dimension, the features of each channel are extracted independently to form a channel sequence, and a corresponding feature statistical structure is established for each channel.

[0041] Based on the statistical distribution characteristics of each channel response in the global feature set and the difference relationship with its corresponding potential response, the relative coupling strength between channels is determined. The average response value, variance, and variation trend of all channels in different spatial regions are statistically analyzed. Then, the potential field response at the same location is read and the two are compared channel by channel to determine the degree of synchronization of the channel under spatial potential changes. The higher the degree of synchronization, the stronger the consistency between the channel characteristics and the potential response. The lower the degree of synchronization, the weaker the contribution of the channel to the overall characteristics.

[0042] Based on the comparison results of the consistency degree, a channel coupling weight mapping is generated, so that channels whose consistency degree meets the preset criteria are assigned as enhancement weights, and channels that do not meet the criteria are assigned as suppression weights, thus establishing an energy balance-based adjustment mechanism in the channel dimension.

[0043] Subsequently, the channel coupling weights are used to perform weighted modulation on the features of each channel. While maintaining the overall semantic consistency, the main semantic channels are highlighted and noise or redundant channels are suppressed to obtain channel-enhanced features. In actual implementation, the feature response of each channel is multiplied by the corresponding coupling weight, and then the features are aggregated along the channel dimension to form an updated channel-enhanced feature map.

[0044] Furthermore, the fusion step of the enhanced features includes:

[0045] Using local flux conservation as a fusion constraint, the energy difference of feature responses before and after fusion is calculated in the spatial neighborhood. Pixel units at corresponding positions in spatial enhancement features and channel enhancement features are selected, and the feature response intensity of this position and its neighborhood is used as the local energy. The difference between the energy distribution before and after fusion is calculated.

[0046] The fusion ratio is dynamically adjusted based on the comparison results between the energy difference and the preset balance criterion. During fusion, an adjustable weight coefficient is assigned to each position of the spatial enhancement feature and the channel enhancement feature, and the weight ratio is dynamically corrected according to the changing trend of the local energy difference. When the local energy difference is large, the superposition intensity is reduced first to prevent energy concentration. When the local energy difference is small, the fusion ratio is maintained or appropriately increased to ensure information integrity.

[0047] When the energy difference exceeds the allowable range of the balance criterion, an adaptive compensation operation is triggered to limit the increase or decrease of feature values. When a sudden change in local energy is detected, a smooth adjustment is performed on the feature values ​​of the abnormal region. Operations such as interpolation or mean filtering are used to slow down the local rate of change, so as to avoid forming an over-amplified or abruptly attenuated response output in the fusion result to enhance the fusion feature.

[0048] Furthermore, the steps for generating the semantic segmentation result include:

[0049] In the step of decoding the enhanced features step by step and outputting the semantic segmentation result, a top-down multi-level decoding structure is adopted. Enhanced features of different scales are upsampled sequentially and fused with adjacent high-resolution features. Starting from the deepest enhanced features, the spatial resolution is restored through upsampling operations and fused point by point with the higher-resolution features of the previous layer.

[0050] In each decoding stage, channel compression and nonlinear transformation are performed on the fused features through convolutional mapping. This process is repeated layer by layer until the spatial size of the original input image is restored, resulting in a full-resolution feature map.

[0051] In each fusion process, potential gradient information is introduced as a boundary guidance signal to correct the positional deviation of the target edge in the fusion result. When performing feature fusion, a potential gradient map of the corresponding scale is input at the same time. The gradient direction information is used to guide feature updates. The fused features are offset and corrected in the boundary region to ensure that the response of adjacent pixels changes continuously along the potential gradient direction.

[0052] The feature map after step-by-step decoding is converted into a pixel-level classification probability map, and the probability distribution is refined by the boundary guidance signal. The finally decoded features are input into the classification head, where convolution mapping and normalization operations are performed to generate the semantic category probability for each pixel. Then, combined with the potential gradient guidance result, the region with large probability differences near the boundary is refined and corrected.

[0053] The output corresponds to the semantic category of the target image. The final segmentation map outputs the semantic category label of each position in pixels. Its overall distribution completely corresponds to the spatial position of the original image, and the category transition at the boundary is smooth and the structure is complete.

[0054] The beneficial effects of this invention are:

[0055] This invention introduces a visual potential propagation mechanism, transforming the dependency between features from correlation calculation into a potential diffusion process. By establishing energy constraints through solving the discrete Poisson equation in the spatial domain, the generation of spatial attention has clear physical meaning and continuity, thus solving the problems of unstable attention weights and ambiguous responses in boundary regions in traditional attention methods.

[0056] This invention employs a capacitive coupling-like method, adaptively determining channel weights based on the correspondence between channel response and potential change trends, thus achieving a channel regulation mechanism that conforms to the energy balance law. This mechanism can effectively suppress redundant information between channels, highlight key semantic features, and improve the discriminative ability of feature representation.

[0057] This invention introduces a local flux conservation constraint, using energy balance within the spatial neighborhood as the fusion criterion, and dynamically adjusts the combination ratio of spatial enhancement features and channel enhancement features to avoid numerical drift and energy imbalance during feature superposition, thereby significantly improving the stability of the model training and inference stages.

[0058] This invention utilizes potential gradient information as a boundary guidance signal to achieve automatic correction and detail reconstruction of the target contour, ensuring that the segmentation results have high boundary accuracy and structural integrity while maintaining global semantic consistency. In summary, this invention achieves synergistic enhancement of spatial structure and semantic channels through a framework of potential propagation and energy conservation, possessing both physical interpretability and engineering portability, and can significantly improve semantic segmentation performance in complex scenarios. Attached Figure Description

[0059] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0060] Figure 1 is a flowchart of an image semantic segmentation method based on spatial channel separation attention proposed in this invention;

[0061] Figure 2 is a flowchart of the electric potential field solution for an image semantic segmentation method based on spatial channel separation attention proposed in this invention;

[0062] Figure 3 is a flowchart of spatial enhancement feature calculation for an image semantic segmentation method based on spatial channel separation attention proposed in this invention. Detailed Implementation

[0063] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0064] Referring to Figures 1-3, an image semantic segmentation method based on spatial channel separation attention includes the following steps:

[0065] The input image is preprocessed and a multi-scale feature set is extracted by the encoder;

[0066] Visual potential source terms are constructed for features at each scale, and the discrete Poisson equation is solved under preset boundary conditions to obtain the corresponding potential field and potential gradient.

[0067] The electric potential field is normalized and mapped to a spatial weight map, and a boundary enhancement weight map is formed with the electric potential gradient. Spatial gating is performed on the feature to obtain spatially enhanced features.

[0068] The channel dimension features are treated as parallel capacitor layers. Channel coupling weights are generated based on channel statistics and potential response differences. Channel gating is then applied to the features to obtain channel enhancement features.

[0069] The spatial enhancement features and channel enhancement features are fused based on the local flux conservation constraint to obtain the enhancement features;

[0070] The enhanced features are decoded step by step, and the semantic segmentation result of the target image is output.

[0071] In this embodiment, the preprocessing includes:

[0072] Perform color space unification, brightness normalization, random geometric transformation, and class equalization sampling on the input image:

[0073] The color space unification includes: after reading the input image, converting it from the original acquisition format to the RGB color space, and performing linear normalization on each channel to unify the pixel value range to a preset range;

[0074] The brightness normalization includes: calculating the global average brightness and performing brightness compensation to ensure a stable brightness distribution in the input image;

[0075] The random geometric transformation includes: randomly selecting rotation, scaling, or flipping operations on the input image, cropping the image to the network input size after performing the geometric transformation, and normalizing the cropped area.

[0076] The category-balanced sampling includes: during the training phase, dynamically adjusting the sample selection probability based on the frequency of each category in the dataset.

[0077] It also uses edge detection operators to generate edge hint maps, performs edge detection operations on geometrically enhanced images, extracts regions with large gray-level gradients and generates gray-level edge hint maps;

[0078] The encoder is a convolutional backbone network with a progressive downsampling structure. The backbone network contains multiple feature extraction units in sequence. Each unit includes a convolutional layer, a normalization layer, and an activation layer. The resolution is progressively reduced through stride convolution, and multiple levels of feature maps are output. Each level of feature map represents semantic information at different scales.

[0079] Each layer's features are output after pointwise convolution to align the channel dimensions, forming a multi-scale feature set.

[0080] Through the preprocessing and encoder feature extraction steps described above, this implementation achieves color and brightness standardization of the input image, enhances the model's adaptability to deformation and class imbalance, and provides boundary constraints for subsequent potential field solution through edge cue maps. At the same time, the multi-scale features extracted by the convolutional stepwise downsampling encoder maintain consistency in semantic level and spatial details, and form a stable multi-scale feature set after channel alignment, providing a unified and reliable input basis for potential source term construction and spatial channel enhancement, thereby improving the robustness and feature expression accuracy of the overall segmentation model.

[0081] In this embodiment, the process of solving for the electric potential field and the electric potential gradient includes:

[0082] For each feature map, the gradient components are calculated in the horizontal and vertical directions. The gradient magnitude is obtained and the second derivative of the difference between adjacent pixels is calculated to obtain the Laplace response.

[0083] Channel aggregation is performed on the feature map to calculate the average response of each pixel and compare it with the global response mean to obtain the semantic saliency.

[0084] The gradient magnitude, Laplacian response, and semantic saliency are weighted and superimposed according to a preset ratio. In the resulting graph,

[0085] According to a preset threshold, pixel regions with gradient magnitude or significance higher than the preset threshold are set as positive source terms to drive potential diffusion.

[0086] Pixel regions with gradient magnitude or significance lower than a preset threshold are set as negative source terms to form a suppression region;

[0087] Positive and negative source terms together form visual potential source terms at the corresponding scale.

[0088] The discrete solution of the Poisson equation uses a five-point difference template to establish spatial neighborhood relationships, with the center pixel as the node and four adjacent pixels as the neighborhood, to establish spatial connection relationships between pixels.

[0089] Boundary cue maps are introduced at feature boundaries to determine Dirichlet boundary conditions to fix the threshold, and Neumann boundary conditions are set in the outer edge region of the image, with the constraint flux being zero.

[0090] Using the visual potential source term as input, the potential value is initialized on the grid of the corresponding scale. The potential of each pixel is updated step by step using the Gauss-Seidel iterative method. The calculation is terminated when the change between two adjacent iterations meets the convergence condition, and a spatially continuous potential field is obtained.

[0091] The first-order difference of the obtained electric potential field is calculated in two orthogonal directions to obtain the potential gradient components and synthesize the gradient magnitude map.

[0092] Through the above-described process of solving for the electric potential field and potential gradient, this implementation establishes a continuous potential distribution in the feature map, enabling the high saliency region to generate an outward diffusion driving force and the low saliency region to form an inhibition effect, thereby maintaining the balance of feature energy in space. By setting boundary conditions to restrict the change of potential value, the stability and continuity of potential at the edge are ensured. The final obtained potential gradient accurately reflects the direction of feature change, providing a clear spatial prior for the subsequent generation of spatial weight map and boundary enhancement weight map.

[0093] In this embodiment, the calculation steps for the spatial enhancement feature include:

[0094] Read the electric potential field and its potential gradient at the corresponding scale, and keep the spatial size consistent with the original feature map. Perform min-max normalization on the electric potential field to linearly map the numerical range to the standard interval. In multi-scale scenarios, use upsampling or downsampling operations to make the size completely aligned with the feature map to obtain the spatial weight map.

[0095] Boundary distribution information is extracted based on the direction and rate of change of the potential gradient, and gradient connectivity is established between adjacent pixels;

[0096] By traversing each pixel of the gradient field, calculating its gradient direction vector and determining the directional continuity between adjacent pixels, when the gradient direction is continuous and the rate of change exceeds the set change standard, the connected region is marked as a potential boundary region, and a boundary enhancement weight map is generated.

[0097] The spatial weight map is used as a global spatial structure constraint, and the boundary enhancement weight map is used as a local boundary compensation. The comprehensive spatial weight distribution is obtained by pixel-by-pixel weighted fusion.

[0098] Using the comprehensive spatial weight map as a gating factor, the feature map at the corresponding scale is subjected to pixel-wise weighted modulation, and the modulated output is denoted as the spatial enhancement feature.

[0099] Through the above-described calculation steps for spatial enhancement features, this implementation establishes a cooperative constraint relationship between the global spatial structure and local boundary details. Potential field normalization and scale alignment ensure spatial consistency between features at different scales, while gradient direction analysis and connectivity judgment enhance potential boundary regions, thereby improving the integrity and continuity of edge responses. The integrated spatial weights fuse overall layout information and local boundary features, enhancing the gated and modulated features in the target region and suppressing them in the background region. The resulting spatial enhancement features possess a clearer structural expression and more stable boundary performance.

[0100] In this embodiment, the calculation steps for the channel enhancement features include:

[0101] The responses of each channel in the multi-scale feature map are regarded as capacitor units connected in parallel. In the same scale feature map, the response mapping of each channel is regarded as a charge storage unit. Different channels share the same spatial location but store different semantic energies. Through traversal operations on the channel dimension, the features of each channel are extracted independently to form a channel sequence, and a corresponding feature statistical structure is established for each channel.

[0102] Based on the statistical distribution characteristics of each channel response in the global feature set and the difference relationship with its corresponding potential response, the relative coupling strength between channels is determined. The average response value, variance, and variation trend of all channels in different spatial regions are statistically analyzed. Then, the potential field response at the same location is read and the two are compared channel by channel to determine the degree of synchronization of the channel under spatial potential changes. The higher the degree of synchronization, the stronger the consistency between the channel characteristics and the potential response. The lower the degree of synchronization, the weaker the contribution of the channel to the overall characteristics.

[0103] Based on the comparison results of the consistency degree, a channel coupling weight mapping is generated, so that channels whose consistency degree meets the preset criteria are assigned as enhancement weights, and channels that do not meet the criteria are assigned as suppression weights, thus establishing an energy balance-based adjustment mechanism in the channel dimension.

[0104] Subsequently, the channel coupling weights are used to perform weighted modulation on the features of each channel. While maintaining the overall semantic consistency, the main semantic channels are highlighted and noise or redundant channels are suppressed to obtain channel-enhanced features. In actual implementation, the feature response of each channel is multiplied by the corresponding coupling weight, and then the features are aggregated along the channel dimension to form an updated channel-enhanced feature map.

[0105] Through the aforementioned calculation steps for channel enhancement features, this implementation establishes an adaptive adjustment mechanism based on energy balance at the channel dimension. By treating each channel response as a charge storage unit and combining it with potential change characteristics, the contribution of different channels to the global semantics can be accurately identified. Coupled weights generated based on the consistency between channels and potential changes strengthen the dominant semantic channels during fusion, while redundant or noisy channels are effectively suppressed, thereby achieving selective enhancement of semantic information. This process ensures that the feature representation is clearly hierarchical at the semantic level and that the energy distribution is stable and consistent, providing a more discriminative channel representation for subsequent feature fusion.

[0106] In this embodiment, the fusion step of the enhanced features includes:

[0107] Using local flux conservation as a fusion constraint, the energy difference of feature responses before and after fusion is calculated in the spatial neighborhood. Pixel units at corresponding positions in spatial enhancement features and channel enhancement features are selected, and the feature response intensity of this position and its neighborhood is used as the local energy. The difference between the energy distribution before and after fusion is calculated.

[0108] The fusion ratio is dynamically adjusted based on the comparison results between the energy difference and the preset balance criterion. During fusion, an adjustable weight coefficient is assigned to each position of the spatial enhancement feature and the channel enhancement feature, and the weight ratio is dynamically corrected according to the changing trend of the local energy difference. When the local energy difference is large, the superposition intensity is reduced first to prevent energy concentration. When the local energy difference is small, the fusion ratio is maintained or appropriately increased to ensure information integrity.

[0109] When the energy difference exceeds the allowable range of the balance criterion, an adaptive compensation operation is triggered to limit the increase or decrease of feature values. When a sudden change in local energy is detected, a smooth adjustment is performed on the feature values ​​of the abnormal region. Operations such as interpolation or mean filtering are used to slow down the local rate of change, so as to avoid forming an over-amplified or abruptly attenuated response output in the fusion result to enhance the fusion feature.

[0110] Through the aforementioned fusion steps of enhanced features, this implementation establishes an energy conservation constraint between spatial and channel features, maintaining numerical balance and structural continuity in the fusion process. The introduction of local flux conservation ensures the consistency of energy transfer when different feature sources are superimposed. The dynamic weight adjustment mechanism can adaptively allocate the fusion ratio according to energy differences, avoiding excessive feature amplification or attenuation. When local energy changes abruptly, adaptive compensation operations can smooth feature changes, preventing numerical instability or boundary fragmentation in the output. Thus, the fused enhanced features are more continuous in spatial structure and more coordinated in semantic expression, providing a stable and reliable input foundation for subsequent decoding and segmentation.

[0111] In this embodiment, the steps for generating the semantic segmentation result include:

[0112] In the step of decoding the enhanced features step by step and outputting the semantic segmentation result, a top-down multi-level decoding structure is adopted. Enhanced features of different scales are upsampled sequentially and fused with adjacent high-resolution features. Starting from the deepest enhanced features, the spatial resolution is restored through upsampling operations and fused point by point with the higher-resolution features of the previous layer.

[0113] In each decoding stage, channel compression and nonlinear transformation are performed on the fused features through convolutional mapping. This process is repeated layer by layer until the spatial size of the original input image is restored, resulting in a full-resolution feature map.

[0114] In each fusion process, potential gradient information is introduced as a boundary guidance signal to correct the positional deviation of the target edge in the fusion result. When performing feature fusion, a potential gradient map of the corresponding scale is input at the same time. The gradient direction information is used to guide feature updates. The fused features are offset and corrected in the boundary region to ensure that the response of adjacent pixels changes continuously along the potential gradient direction.

[0115] The feature map after step-by-step decoding is converted into a pixel-level classification probability map, and the probability distribution is refined by the boundary guidance signal. The finally decoded features are input into the classification head, where convolution mapping and normalization operations are performed to generate the semantic category probability for each pixel. Then, combined with the potential gradient guidance result, the region with large probability differences near the boundary is refined and corrected.

[0116] The output corresponds to the semantic category of the target image. The final segmentation map outputs the semantic category label of each position in pixels. Its overall distribution completely corresponds to the spatial position of the original image, and the category transition at the boundary is smooth and the structure is complete.

[0117] Through the semantic segmentation result generation steps described above, this implementation achieves hierarchical fusion of multi-scale features and accurate boundary restoration during the decoding stage. The multi-level upsampling and layer-by-layer fusion structure ensures the continuous transmission of semantic information from deep to shallow layers, effectively combining high-level semantics with low-level details. The introduction of the potential gradient provides boundary direction guidance for the decoding process, ensuring spatial continuity of the target contour and eliminating edge offset. After refinement in the boundary regions, the pixel-level probability map output by the classification head exhibits more natural category transitions and clearer region divisions. Therefore, the final semantic segmentation result demonstrates high accuracy and stability in both global structure and local boundaries.

[0118] Example 1:

[0119] To verify the feasibility of this invention in practice, it was applied to the Cityscapes urban street view dataset for testing, validating the proposed image semantic segmentation method based on spatial channel separation attention. The entire process includes image preprocessing, feature extraction, potential field solution, spatial and channel enhancement, flux conservation fusion, and step-by-step decoding output.

[0120] Preprocessing is performed on the original images. The input street scene images are uniformly converted to the RGB color space, and the pixel values ​​of the three channels are linearly normalized to ensure that the brightness and color distribution are consistent. To reduce the impact of illumination differences, global average brightness is calculated and brightness compensation is performed to balance dark and bright areas during the input stage. To enhance the model's adaptability to scale and pose changes, geometric transformations such as rotation, flipping, and translation are randomly performed during the training phase, and the images are cropped to a fixed input size after the transformations. To address the class imbalance problem, the sample selection probability is dynamically adjusted based on the pixel proportion of each class in the dataset, thereby increasing the learning weight of the minority class. Subsequently, edge detection is performed on the geometrically enhanced images to extract regions with large gray-level gradients and generate gray-level edge cue maps for boundary constraints in subsequent electric potential field solutions.

[0121] The preprocessed image is input into a convolutional encoder to extract multi-scale features. The encoder has a four-stage progressive downsampling structure: the first stage extracts texture and contour information, the second stage acquires local structural features, the third stage extracts mid-level semantic relationships, and the fourth stage captures the global context. The feature maps output from each stage are then aligned with the channel dimensions through pointwise convolution to form a multi-scale feature set, providing the input basis for solving the potential propagation problem.

[0122] The visual potential field is then solved. For each scale feature map, gradient components are calculated in the horizontal and vertical directions, and the gradient magnitude is determined. Simultaneously, the second-order difference between adjacent pixels is calculated to obtain the Laplacian response. Channel aggregation is performed on the feature map to obtain the average response of each pixel, which is compared with the global mean to form a semantic saliency map. The gradient magnitude, Laplacian response, and semantic saliency are weighted and superimposed to obtain the visual potential source term. Positive and negative source terms are determined based on the distribution of gradient or saliency; high saliency regions drive potential diffusion, while low saliency regions form suppression regions. Spatial neighborhood relationships are established based on a five-point difference template, and Dirichlet boundary conditions are set using edge cue maps. Neumann conditions are applied to the outer edge of the image to constrain the flux to zero. The discrete Poisson equation is solved using Gauss-Seidel iteration. The calculation terminates when the potential change between two adjacent iterations tends to stabilize, resulting in a spatially continuous potential field. The direction and magnitude of the potential gradient are then calculated to characterize the trend of feature changes.

[0123] In the spatial enhancement stage, the potential field and potential gradient are read, min-max normalization is performed, and the potential field is aligned with the feature map size through interpolation to generate a spatial weight map. The rate of change of the potential gradient direction is analyzed, and gradient connectivity is established between adjacent pixels to determine the boundary region, generating a boundary enhancement weight map. The spatial weight map is used as a global constraint, and the boundary weight map is used as a local compensation. A comprehensive spatial weight distribution is obtained by weighted fusion pixel by pixel using this weight distribution. The feature map is then weighted and modulated pixel by pixel using this weight distribution, which enhances the response of the target region and suppresses the response of the background region, outputting the spatially enhanced feature.

[0124] In the channel enhancement stage, features at each scale are expanded along the channel dimension, treating each channel as an independent response unit. The average response and trend of each channel within the global feature set are statistically analyzed and compared with the electric potential field response to determine the degree of consistency between channels. Based on the consistency results, a channel coupling weight mapping is generated, giving higher weights to semantically dominant channels during fusion and reducing the responses of redundant or noisy channels. Finally, each channel feature is multiplied by its corresponding weight and re-aggregated to obtain the channel-enhanced features.

[0125] The fusion phase, constrained by local flux conservation, merges spatial enhancement features and channel enhancement features point-by-point within the spatial neighborhood. The system calculates the local energy difference before and after fusion and dynamically adjusts the fusion ratio based on the energy balance result. If the local energy difference is too large, adaptive compensation is performed to smooth the feature responses in abnormal regions to avoid abrupt changes. The enhanced features obtained after fusion maintain continuity in spatial structure and energy balance at the semantic level.

[0126] The step-by-step decoding stage employs a top-down multi-layer decoding structure, sequentially upsampling enhanced features at different scales and fusing them with high-resolution features. After each decoding stage, channel compression and nonlinear transformation are performed through convolutional mapping until the spatial dimensions are restored to the same level as the input image. During decoding, a potential gradient is introduced as a boundary guidance signal to correct the boundary direction of the fused features, ensuring that the response in edge regions changes continuously along the gradient direction. Finally, the decoded output features are processed by a classification head to generate pixel-level semantic probability maps, with refinement and correction in the boundary regions. The output segmentation map is spatially aligned with the original image, has smooth boundaries, and is semantically consistent.

[0127] To verify the effectiveness of the method of this invention, traditional attention segmentation networks CBAM and DANet were selected as control models, and experiments were conducted under the same dataset and training conditions. Evaluation metrics included full pixel accuracy (PA), mean intersection-over-union ratio (mIoU), and boundary accuracy (BF Score).

[0128] Table 1 Experimental Results

[0129] Model PA (%) mIoU (%) BF Score (%) CBAM 95.37 9.68 4.2 DANet 95.98 0.18 5.0 Method of this invention 96.78 2.48 7.8 surface

[0130] As shown in Table 1, the method of this invention outperforms the comparative model in all indicators, with the most significant improvement in boundary accuracy. This indicates that the potential propagation and flux conservation mechanisms effectively improve the ambiguity and fragmentation problems in the edge region of traditional methods. This embodiment verifies that the present invention can significantly improve the integrity and stability of the segmentation boundary while maintaining global semantic consistency, demonstrating high engineering feasibility and promotional value.

[0131] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An image semantic segmentation method based on spatial channel separation attention, characterized in that, The process includes the following steps: preprocessing the input image and extracting a multi-scale feature set by the encoder; constructing a visual potential source term for each scale feature and solving the discrete Poisson equation under preset boundary conditions to obtain the corresponding potential field and potential gradient; normalizing and mapping the potential field into a spatial weight map, forming a boundary enhancement weight map with the potential gradient, and performing spatial gating on the features to obtain spatially enhanced features; treating the channel-dimensional features as a parallel capacitor layer, generating channel coupling weights based on the channel statistics and potential response difference, and performing channel gating on the features to obtain channel-enhanced features. The spatial enhancement features and channel enhancement features are fused based on the local flux conservation constraint to obtain the enhancement features; The enhanced features are decoded step by step, and the semantic segmentation result of the target image is output.

2. The image semantic segmentation method based on spatial channel separation attention according to claim 1, characterized in that, The preprocessing includes: performing color space unification, brightness normalization, random geometric transformation, and category equalization sampling on the input image, and generating an edge cue map using an edge detection operator; the encoder is a convolutional backbone network with a step-by-step downsampling structure, which extracts multi-layer feature maps from the preprocessed image; each layer of features is output after point-by-point convolution to align the channel dimensions, forming a multi-scale feature set.

3. The image semantic segmentation method based on spatial channel separation attention according to claim 1, characterized in that, The process of solving the potential field and potential gradient includes: obtaining the visual potential source terms by weighted superposition of the local gradient magnitude, Laplacian response, and semantic saliency of the feature maps at each scale; setting pixel regions with gradient magnitude or saliency higher than the preset threshold as positive source terms to drive potential diffusion according to the preset threshold; setting pixel regions with gradient magnitude or saliency lower than the preset threshold as negative source terms to form suppression regions; establishing spatial neighborhood relationships by using a five-point difference template for discrete solution of the Poisson equation; introducing a boundary cue map at the feature boundary to determine Dirichlet boundary conditions to fix the potential value, and setting Neumann boundary conditions in the outer edge region of the image to constrain the flux to zero; using multi-step Gaussian-Seidel iteration to the preset convergence threshold during the solution process to obtain a spatially continuous and energy-balanced potential field and potential gradient.

4. The image semantic segmentation method based on spatial channel separation attention according to claim 1, characterized in that, The calculation steps for the spatial enhancement features include: normalizing and scaling the obtained potential field to form a spatial weight map with the same size as the input feature map; extracting boundary distribution information based on the direction and rate of change of the potential gradient, establishing gradient connectivity between adjacent pixels, and generating a boundary enhancement weight map; using the spatial weight map as a global spatial structure constraint and the boundary enhancement weight map as a local boundary compensation, and obtaining a comprehensive spatial weight distribution through pixel-by-pixel weighted fusion; and performing weighted modulation on the feature map with the comprehensive spatial weights to obtain spatial enhancement features containing spatial layout information and boundary continuity.

5. The image semantic segmentation method based on spatial channel separation attention according to claim 1, characterized in that, The calculation steps for the channel enhancement features include: treating the responses of each channel in the multi-scale feature map as parallel capacitor units; determining the relative coupling strength between channels based on the statistical distribution characteristics of each channel response in the global feature set and the difference between its corresponding potential response; generating a channel coupling weight mapping based on the comparison results of the consistency degree, assigning enhancement weights to channels whose consistency degree meets the preset criteria and suppression weights to channels whose consistency degree does not meet the criteria, and establishing an energy balance-based adjustment mechanism in the channel dimension; and then using the channel coupling weights to perform weighted modulation on each channel feature, highlighting the main semantic channels and suppressing noise or redundant channels while maintaining overall semantic consistency, thereby obtaining the channel enhancement features.

6. The image semantic segmentation method based on spatial channel separation attention according to claim 1, characterized in that, The fusion step of the enhanced features includes: using local flux conservation as a fusion constraint, calculating the energy difference of the feature responses before and after fusion in the spatial neighborhood; dynamically adjusting the fusion ratio based on the comparison result of the energy difference and the preset balance criterion; and triggering an adaptive compensation operation to limit the increase or decrease of feature values ​​when the energy difference exceeds the allowable range of the balance criterion, and outputting the fused enhanced features.

7. The image semantic segmentation method based on spatial channel separation attention according to claim 1, characterized in that, The steps for generating the semantic segmentation result include: in the step of decoding the enhanced features step by step and outputting the semantic segmentation result, a top-down multi-level decoding structure is adopted, and the enhanced features at different scales are upsampled sequentially and fused with adjacent high-resolution features; in each fusion process, potential gradient information is introduced as a boundary guidance signal to correct the positional deviation of the target edge in the fusion result; the feature map after step-by-step decoding is converted into a pixel-level classification probability map, and the probability distribution is refined by the boundary guidance signal; and the segmentation result corresponding to the semantic category of the target image is output.