A high-resolution remote sensing cultivated land instance segmentation method fusing nonlinear spiking neural p system
By incorporating the NSNP-SAM method with a nonlinear spiking neural P system, the problems of narrow boundaries, clustered plots, and homogeneous background in farmland plot segmentation in high-resolution remote sensing images were solved, achieving efficient farmland instance segmentation and improving segmentation accuracy and boundary delineation capabilities.
Patent Information
- Application Number
- CN202611058204.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies struggle to effectively segment farmland plots in high-resolution remote sensing images, especially in densely adjacent scenes, where separating target instances and delineating their complete boundaries presents challenges such as narrow boundaries, overlapping plots, homogeneous backgrounds, and excessive smoothing of continuous features.
We employ the parameter-efficient SAM fine-tuning method NSNP-SAM, which integrates nonlinear spiking neural P-systems. By introducing the spatiotemporally adaptive neural P-system unit STA-NPU, the spiking attention injection adapter SAIA, the spiking feedforward Transformer adapter SFTA, and the spiking high-frequency cue injection module S-HFPI, we construct a hybrid architecture model to achieve low-level state evolution, deep spatial gating, and cross-scale detail fusion.
It improves the regional overlap accuracy and boundary characterization capability of high-resolution remote sensing farmland instance segmentation, and can effectively separate densely adjacent land blocks and weak boundaries, compensating for local structural losses caused by block embedding and downsampling.
Smart Images

Figure CN123160876A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to remote sensing image processing, visual fundamental models, spiking neural networks and membrane computing, specifically to a high-resolution remote sensing method for segmenting farmland instances by fusing a nonlinear spiking neural P-system. It belongs to the field of computer vision. Background Technology
[0002] High-resolution remote sensing of farmland plots is the foundation for plot-level agricultural inventory, property rights confirmation, crop yield estimation, and dynamic monitoring of precision agriculture. Unlike semantic segmentation, which only determines pixel categories, instance-level plot extraction requires the use of sparse cues such as points, bounding boxes, or masks to separate target instances and delineate their complete boundaries in scenes with densely adjacent plots.
[0003] Farmland plots in actual remote sensing images typically exhibit characteristics such as dense spatial distribution, highly homogeneous background texture, significant differences in shape and scale, narrow boundaries, and easy adhesion between adjacent plots. Adjacent plots may be separated only by field ridges, roads, or weak spectral differences. These boundaries occupy a small spatial proportion in the image but directly determine the segmentation quality of a single instance.
[0004] Visual foundational models, such as the Segmentation All Model (SAM), possess strong general semantic representation capabilities and cue-driven segmentation abilities. However, their pre-training data primarily comes from natural images, leading to domain-specific differences when directly transferred to remotely sensed farmland scenes. Their visual Transformer backbone relies on continuous feature representation, block embedding, and global attention, which can easily result in response decay, excessive edge smoothing, and loss of local details when dealing with densely packed plots and weakly contrasting boundaries.
[0005] Existing efficient parameter fine-tuning methods typically use continuous weights to perform global or soft recalibration of features. However, since the texture inside cultivated land is relatively uniform while the edge regions vary drastically, uniform continuous modulation is difficult to simultaneously satisfy the requirements of background suppression and boundary enhancement. Furthermore, redundant background responses may propagate along network layers and interfere with high-level semantics.
[0006] Spiking neural networks represent local mutations as sparse events through state accumulation, threshold triggering, and discrete pulse firing, making them suitable for perceiving narrow boundaries and subtle texture changes. Spiking neural P systems further emphasize rule-driven, conditional triggering, and distributed parallel evolution, but traditional spiking neural P systems often describe states with an integer number of pulses, making it difficult to directly adapt to the continuous feature tensors in convolutional networks and visual Transformers.
[0007] The nonlinear spiking neural P-system extends neuron states to real numbers and allows the pulse consumption and generation processes to be described by nonlinear functions, enabling rule-based triggering mechanisms to be combined with continuous visual features, spatial gating responses, and multi-scale texture features. Current solutions lack a technical approach to systematically embed this mechanism into the SAM's underlying state evolution, deep adapter gating, and cross-scale high-frequency cue injection process.
[0008] Therefore, there is a need for a remote sensing farmland instance segmentation method that can both retain the general semantic capabilities of the basic visual model and enhance narrow boundaries, block redundant responses from homogeneous backgrounds, and inject multi-scale local details through rule-triggered impulse states. Summary of the Invention
[0009] This invention aims to solve the problems of narrow boundaries, plot adhesion, homogeneous background, and excessive smoothing of continuous features in high-resolution remote sensing farmland instance segmentation. It proposes a parameter-efficient SAM fine-tuning method NSNP-SAM that integrates a nonlinear spiking neural P system.
[0010] This invention, based on freezing the main weights of the SAM pre-training backbone, introduces the spatiotemporal adaptive neural P system unit STA-NPU, the pulse attention injection adapter SAIA, the pulse feedforward Transformer adapter SFTA, the lightweight convolutional neural network branch, and the pulsed high-frequency cue injection module S-HFPI, so that the evolution of the underlying state, deep spatial gating, and cross-scale detail fusion all follow the same conditional triggering and pulse firing ideas.
[0011] The technical solution of this invention includes: data acquisition and preprocessing; constructing a frozen SAM visual Transformer semantic branch and a lightweight convolutional detail branch; using STA-NPU to complete the adaptive conversion of continuous features to sparse impulse responses; using SAIA and SFTA to selectively modulate the adapter incremental features; using S-HFPI to filter and inject multi-scale high-frequency cues; training a learnable module; and outputting a target plot instance mask based on the cues.
[0012] Specifically, the method includes the following steps: S1, data acquisition and preprocessing; S2, constructing a single-instance farmland plot dataset and performing data augmentation; S3, constructing an NSNP-SAM hybrid architecture model that integrates a nonlinear spiking neural P system; S4, constructing a spatiotemporally adaptive neural P system unit STA-NPU and performing underlying spiking state evolution; S5, constructing spiking gating adapters SAIA and SFTA and performing spatially selective feature modulation; S6, constructing a spiking high-frequency cue injection module S-HFPI and training the model; S7, performing farmland plot instance segmentation and performance verification based on the trained model.
[0013] In some embodiments of the present invention, step S1 includes: S11, acquiring high-resolution remote sensing images and their corresponding vector annotation data; S12, performing spatial alignment and rasterization processing on the vector annotation data to generate binary mask labels consistent with the pixel coordinates of the remote sensing images; S13, using a sliding window cropping strategy to simultaneously divide the original large-scale remote sensing images and their corresponding masks into standard-sized image blocks.
[0014] In step S11, the high-resolution remote sensing image can be the Jilin-1 high-resolution remote sensing image. The remote sensing image covers agricultural scenes with fragmented boundaries, varying scales, and strong textural heterogeneity, and is used to characterize the segmentation needs of densely adjacent farmland plots, weak boundary plots, and complex background plots.
[0015] In step S12, the land parcel labels in Shapefile format or other vector format are converted into a binary mask that is strictly spatially aligned with the optical remote sensing image, ensuring that the land parcel regions in the mask labels correspond one-to-one with the locations of land features in the remote sensing image, thereby providing pixel-level supervision information for the subsequent construction of single-instance samples.
[0016] In step S13, to address the issue that the original remote sensing image is too large to be directly input into the model, the remote sensing image and its mask are simultaneously cropped according to a preset window size. In one embodiment, the cropping window size is 512×512 pixels, and the image block and the mask block maintain the same spatial index relationship.
[0017] In some embodiments of the present invention, step S2 includes: S21, performing single-instance conversion on the cropped mask; S22, dividing the dataset according to the unique identifier of the original image before cropping; S23, performing various data augmentation and normalization processes on the training set.
[0018] In step S21, the cropped mask is processed as a single instance to remove pure background areas, areas with too high proportion of invalid pixels, or sample areas that do not meet the training requirements. The farmland plots in the image are converted into a single instance mask format with a single plot as the basic unit, so that the model training process can learn the contour and boundary of a single farmland plot.
[0019] In step S22, to reduce the risk of data leakage caused by overlapping adjacent slices, the unique identifier of the original large-scale remote sensing image before cropping is used as the grouping basis, and all image blocks generated from the same original image are assigned to the same training subset or validation subset; in one embodiment, the training set and validation set are divided in an approximately 8:2 ratio, and the independent test set is only used for the final performance evaluation.
[0020] In step S23, one or more of the following operations are performed on the training set: random cropping, horizontal flipping, vertical flipping, random rotation, brightness adjustment, color perturbation, normalization, and tensor transformation; wherein, the normalization process can use the mean and standard deviation pre-calculated from the remote sensing dataset to reduce illumination differences and improve the model convergence stability.
[0021] In some embodiments of the present invention, step S3 includes: S31, constructing a global semantic branch with a SAM visual Transformer image encoder that freezes pre-trained core weights; S32, constructing a lightweight convolutional neural network branch in parallel to extract local textures and multi-scale boundary details; S33, establishing an end-to-end segmentation framework for mask output of farmland plot instances based on the SAM cue encoder and mask decoder.
[0022] In step S31, the main pre-training parameters of the SAM image encoder are frozen to preserve the global semantic representation capability of the general visual base model, and the remote sensing image slices are encoded into image embeddings suitable for subsequent cue fusion and mask decoding.
[0023] In step S32, the lightweight convolutional neural network branch uses a local receptive field and a hierarchical downsampling structure to extract local high-frequency information such as field ridges, plot boundaries, broken corners, weak texture abrupt changes, and small-scale plot edges, in order to compensate for the details that the visual Transformer may lose during the block embedding and downsampling process.
[0024] In step S33, the prompt encoder receives point, frame, or mask prompts and generates a prompt embedding. The mask decoder fuses the image embedding, the prompt embedding, and the pulse-modulated high-frequency detail features to output the instance mask and boundary contour of the target farmland plot.
[0025] To further define the structural relationship between the nonlinear spiking neural P system and the visual feature processing module in step S3, the nonlinear spiking neural P system for visual perception can be represented as:
[0026] (1)
[0027] Where O represents the set of nonlinear pulse objects, σ1 to σ m This represents a spiking neuron obtained by mapping spatial pixels or feature tokens; syn represents a feature propagation path formed by convolutional projection, attention propagation, residual connections, or cross-attention injection; F in and F out These represent the input features and the output features, respectively.
[0028] The i-th spiking neuron and its set of evolutionary rules can be represented as follows:
[0029]
[0030]
[0031] Where, x i Let R be the real-valued impulse state of the i-th neuron. i R represents the set of evolutionary rules within the i-th neuron; sta R gate and R hf These correspond to the state integral triggering rule, the space gating blocking rule, and the high-frequency pulse injection rule, respectively.
[0032] In some embodiments of the present invention, step S4 includes: S41, generating spatially adaptive retention coefficients based on input features; S42, performing state accumulation and threshold triggering over multiple time steps; and S43, performing state reset, threshold update, temporal fusion, and residual state compensation after pulse emission.
[0033] In step S41, the STA-NPU receives low-level features or intermediate features in the adapter main path, and generates spatial position retention coefficients through one-dimensional convolution, group normalization and sigmoid function, so that the boundary abrupt region can obtain a high state retention capability and the smooth homogeneous background region can obtain a fast state decay.
[0034] The space adaptive preservation coefficient in step S41 can be expressed as:
[0035]
[0036] Where Conv1d represents a one-dimensional convolutional mapping, and GN represents group normalization. Let τ represent the Sigmoid activation function, and τ is used to characterize the degree to which historical states are preserved at different spatial locations.
[0037] In step S42, the current input stimulus and the internal state of the previous time step are nonlinearly accumulated according to the retention coefficient, and the accumulated state is compared with the dynamic threshold; when the accumulated state reaches or exceeds the dynamic threshold, a valid pulse is output, and when the accumulated state is lower than the dynamic threshold, an empty pulse is output.
[0038] The state accumulation, pulse triggering, and state and threshold update in step S42 can be represented as follows:
[0039]
[0040]
[0041]
[0042] Where u represents the accumulated state inside the neuron, θ represents the dynamic threshold, α represents the effective pulse, and λ represents the empty pulse; when the accumulated state reaches the threshold, an effective pulse is output and the state is updated, otherwise an empty pulse is output.
[0043] In step S43, the corresponding threshold state is deducted from the position of the effective pulse and the threshold of the next time step is adaptively updated; after completing the pulse evolution of multiple time steps, the pulse sequence is spliced and fused by one-dimensional convolution, and the remaining state of the last time step is added to the output as a continuous compensation term to form a continuous-discrete hybrid feature.
[0044] The temporal fusion and residual state compensation in step S43 can be expressed as follows:
[0045]
[0046] Where Concat represents the concatenation operation, W res V[T] represents the learnable residual weights, and V[T] represents the remaining state that did not reach the trigger threshold in the last time step; this structure is used to balance discrete pulse selectivity and continuous visual feature integrity.
[0047] In some embodiments of the present invention, step S5 includes: S51, setting a pulsed attention injection adapter SAIA in the attention path of the visual Transformer; S52, setting a pulsed feedforward Transformer adapter SFTA in the feedforward path of the visual Transformer; S53, selectively filtering the incremental features of the adapter using a spatial pulse gating mask and back-injecting the original features in the form of residuals.
[0048] In step S51, the main path of SAIA sequentially performs down projection, pulse nonlinear transformation and up projection. The gated path generates a pulse gated mask for the attention path based on the local spatial response, so as to inject boundary-sensitive incremental information in the long-range dependency modeling process.
[0049] In step S52, the main path of SFTA uses a lightweight convolutional bypass with embedded spiking neurons to perform local convolutional transformation and impulse response modulation in the feedforward path, which is used to locally reorganize the semantic features after attention update.
[0050] In step S53, when the gating response reaches the trigger threshold, the corresponding spatial location is determined to be a boundary abrupt change, a narrow field ridge, or a weak contrast structure, and an effective pulse with a value of 1 is generated; when the gating response is lower than the trigger threshold, the corresponding spatial location is determined to be a homogeneous background or a low response region, and an empty pulse with a value of 0 is generated, thereby forming a spatial pulse gating mask to filter the incremental features of the adapter.
[0051] The spatial pulse gating mask generation, adapter incremental filtering, and residual backinjection in step S53 can be represented as follows:
[0052]
[0053]
[0054]
[0055] Where g represents the spatial gating value, F adp The features generated by the adapter's main path are represented by G, which represents the spatial pulse gating mask, ⊙ which represents element-wise multiplication, and s which represents the learnable scaling factor.
[0056] The residual injection of SAIA and SFTA in the attention path and feedforward path can be further expressed as follows:
[0057]
[0058]
[0059] Among them, F SAIA and F SFTA G represents the feature transformation of the main paths of SAIA and SFTA, respectively. a and G f s1 and s2 represent the corresponding spatial pulse gating masks, respectively, and s1 and s2 represent the corresponding learnable scaling factors.
[0060] In some embodiments of the present invention, step S6 includes: S61, channel alignment of the multi-scale features output by the convolutional neural network branch; S62, generation of a high-frequency pulse cue mask based on the local high-frequency response; S63, channel filtering and cross-attention injection of the pulse-filtered high-frequency cue features; S64, freezing the SAM backbone and training the newly added learnable module.
[0061] In step S61, channel projection is performed on convolutional features of different scales to match their channel dimensions with the semantic features of the visual Transformer. In step S62, the local high-frequency response of each scale feature is extracted and compared with the high-frequency trigger threshold to form a high-frequency pulse cue mask.
[0062] The i-th scale high-frequency pulse cue mask and the filtered high-frequency cue features in step S62 can be represented as follows:
[0063]
[0064]
[0065] Among them, hi ε represents the local high-frequency response at the i-th scale. hf Indicates the high-frequency triggering threshold. This represents a high-frequency pulse cue mask, Proj represents channel projection, and SE represents channel attention filtering.
[0066] In step S63, the high-frequency pulse cue mask is multiplied element-wise with the projected convolutional features, and redundant channel responses are suppressed through a channel attention structure. Then, the high-frequency cue features at different scales are flattened and concatenated into keys and values. Visual Transformer semantic features are used as queries to perform multi-head cross-attention, so that global semantic features can be retrieved on demand and local boundary details can be absorbed.
[0067] The cross-attention injection relationship between the multi-scale high-frequency cue features and the visual Transformer semantic features in step S63 can be expressed as:
[0068]
[0069] Where MHA represents multi-head attention, Q is obtained from the semantic feature mapping of the visual Transformer, and K... hf and V hf Generated from a multi-scale high-frequency cue library; this structure enables global semantic branches to retrieve pulse-filtered local boundary details on demand.
[0070] In step S64, the pre-trained core weights of the SAM visual Transformer backbone are frozen during training, and the trainable parameters of STA-NPU, SAIA, SFTA, lightweight convolutional neural network branch, S-HFPI, and decoding or supervision modules are updated. A first learning rate can be used for the basic fine-tuning module, and a second learning rate greater than the first learning rate can be used for the newly added pulse module and high-frequency cue module.
[0071] In some embodiments of the present invention, step S7 includes: S71, inputting the remote sensing image to be processed and prompting information into the trained model and outputting a target farmland plot instance mask; S72, evaluating the model's regional overlap accuracy, boundary characterization ability and multi-scale plot adaptability using validation and test sets; S73, analyzing the effect of the pulse modulation structure on farmland plot segmentation by combining quantitative indicators and visualization results.
[0072] In step S71, the prompt information includes at least one of positive sample points, negative sample points, target boxes, or prior masks. The mask decoder outputs the binary instance mask and boundary contour of the target farmland plot based on image embedding, prompt embedding, and high-frequency details after pulse modulation.
[0073] In step S72, at least one of the following quantitative indicators is used to evaluate the model's segmentation capability: Dice coefficient, average intersection-union ratio (mIoU), and boundary F-Score. Dice coefficient and mIoU are used to evaluate the quality of regional overlap, while boundary F-Score is used to evaluate the separation effect of narrow boundaries and adjacent plots.
[0074] In step S73, the model performance is analyzed based on the segmentation mask, boundary contour, and quantization index of NSNP-SAM on the test set. When it is necessary to explain the performance, the visualization results of methods such as SAM, PointSAM, HQ-SAM, fabSAM, RTIM, SimpleClick, and CFR-ICL can be used to illustrate the role of the model in boundary enhancement, background suppression, and multi-scale detail compensation.
[0075] The data preprocessing includes rasterizing the vector labeled data into a binary mask spatially aligned with the remote sensing image, using a sliding window to simultaneously crop the image and mask, converting the cropping result into a single-instance mask, and removing invalid regions.
[0076] To reduce the risk of data leakage caused by overlapping adjacent slices, all image blocks generated from the same original image are assigned to the same training subset or validation subset based on the unique identifier of the original image before cropping.
[0077] Perform one or more of the following operations on the training set: resizing, horizontal or vertical flipping, random rotation, brightness adjustment, normalization, and tensor transformation to enhance the model’s robustness to changes in plot size, orientation, lighting, and texture.
[0078] The NSNP-SAM model mainly consists of a SAM visual Transformer branch, a lightweight convolutional neural network branch, a cue encoder, a mask decoder, and an auxiliary supervision head. The SAM visual Transformer branch extracts global semantic priors, while the convolutional branches extract local texture and multi-scale boundary information in layers.
[0079] STA-NPU is located at the bottom-level feature modulation position to generate boundary-sensitive continuous-discrete hybrid features; SAIA and SFTA are embedded in the multi-head attention path and feedforward path of the Transformer block as bypasses, respectively; S-HFPI is located between the convolution branch and the visual Transformer branch to inject pulse-filtered local high-frequency details into the global semantic space.
[0080] The cue encoder receives point, box, or mask cue and generates a cue embedding. The mask decoder fuses the image embedding and the cue embedding and outputs the mask probability and boundary contour of the corresponding farmland instance. The auxiliary supervision head may include at least one of edge supervision and distance transform supervision.
[0081] The rule-driven pulse modulation process includes: using STA-NPU to perform state accumulation, threshold triggering, and state compensation on the input features to obtain boundary-sensitive continuous-discrete hybrid features; using SAIA and SFTA to perform spatial pulse gating in the attention path and feedforward path to filter boundary-related incremental features and suppress homogeneous background responses; and using S-HFPI to convert multi-scale high-frequency details of the convolutional branches into injectable cue features.
[0082] During training, the pre-trained core weights of the SAM visual Transformer backbone are frozen, and the trainable parameters of STA-NPU, SAIA, SFTA, lightweight convolutional neural network branches, S-HFPI, and decoding or supervision modules are updated. Differential learning rates are used for the basic fine-tuning modules and the newly added spurious modules to achieve remote sensing domain adaptation while preserving general semantic priors.
[0083] The model training employs a multi-task joint objective consisting of region overlap loss, pixel-level classification loss, and boundary constraint loss. It also incorporates an iterative hard point sampling strategy to transform boundary neighborhoods with large prediction errors, missed detection regions, and false detection regions into new cue samples, enabling the model to continuously focus on densely adjacent and weakly textured boundary regions.
[0084] During inference, the high-resolution remote sensing image to be processed is input into the trained NSNP-SAM, and at least one of the following cues is provided to the cue encoder: positive sample points, negative sample points, target bounding boxes, or prior masks. The mask decoder fuses the image embedding, cue embedding, and pulse-modulated boundary details to output a binary mask of the target farmland instance.
[0085] Compared with the prior art, the beneficial effects of the present invention include:
[0086] By utilizing the frozen SAM visual Transformer branch to preserve general global semantic capabilities, and by using lightweight trainable modules to achieve efficient parameter adaptation, the training burden of full fine-tuning for remote sensing tasks is reduced.
[0087] The STA-NPU adaptively adjusts the degree of state preservation based on spatial location, and enhances the response to narrow boundaries and local mutations by using multi-time-step state accumulation, dynamic threshold triggering and residual state compensation, while reducing fine-grained semantic truncation caused by binary impulses.
[0088] SAIA and SFTA use rule-triggered discrete gating as a physical switch to spatially filter the incremental features of the adapter, retaining or enhancing the response at effective boundary positions, and outputting empty pulses and blocking the transmission of redundant features at homogeneous background positions.
[0089] S-HFPI first performs high-frequency event triggering and channel filtering on the multi-scale details of the convolutional branches, and then injects semantically guided cross-attention into the visual Transformer to compensate for the local structural loss caused by block embedding and downsampling.
[0090] Rule-triggered and sparse pulse representation prevents low-response regions from generating valid pulses, which helps reduce invalid feature propagation and provides a structural basis for subsequent deployments of event-driven or low-power hardware.
[0091] Experimental results show that the proposed method can simultaneously improve regional overlap accuracy and boundary characterization ability on high-resolution remote sensing farmland datasets, and has good segmentation effect on densely adjacent, weakly boundaryed, and multi-scale plots. Attached Figure Description
[0092] Figure 1 The flowchart below shows the design of a high-resolution remote sensing farmland instance segmentation method that integrates a nonlinear spiking neural P system, as described in this application.
[0093] Figure 2 This is a diagram showing the overall structure of the NSNP-SAM model of this invention.
[0094] Figure 3 This is a structural diagram of the spatiotemporal adaptive neural P system unit STA-NPU of the present invention.
[0095] Figure 4 This is a structural diagram of the pulse attention injection adapter SAIA and the pulse feedforward Transformer adapter SFTA of the present invention.
[0096] Figure 5 This is a structural diagram of the pulsed high-frequency prompt injection module S-HFPI of the present invention.
[0097] Figure 6 A visualization of farmland instance segmentation results in complex backgrounds and small plot scenarios.
[0098] Figure 7 A visualization of farmland instance segmentation results in complex backgrounds and multi-scale plot scenarios.
[0099] Figure 8 A visualization of farmland instance segmentation results in scenarios involving adjacent land parcels and complex boundary topology. Detailed Implementation
[0100] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. These embodiments are used to explain the technical solutions of the present invention and do not constitute a limitation on the scope of protection of the claims; parameters not explicitly defined can be adjusted according to data scale, hardware resources, and application scenarios.
[0101] This embodiment provides a high-resolution remote sensing method for farmland instance segmentation that integrates a nonlinear spiking neural P-system, which sequentially performs data processing, bi-branch feature extraction, rule-driven pulse modulation, multi-scale high-frequency cue injection, model training, and instance mask output.
[0102] Step 1: Acquire high-resolution remote sensing images and their annotation data. This embodiment uses high-resolution remote sensing data from Jilin-1 provided by the iFLYTEK Farmland Extraction Challenge. The images cover agricultural landscapes with fragmented boundaries, varying scales, and significant texture differences.
[0103] The vector annotations in Shapefile format are rasterized into a binary mask aligned with the optical image space, and an overlapping sliding window is used to simultaneously crop the original large-format image and its corresponding mask into 512×512 pixel image blocks.
[0104] Image blocks with a high proportion of pure background or invalid pixels are removed, and the remaining masks are converted into single-instance masks with a single plot as the basic unit. After screening, this embodiment obtains 23,804 valid single-instance mask samples.
[0105] Based on the unique identifier of the original image before cropping, all image patches generated from the same original image are grouped into the same subset; the official training data is divided into training and validation sets in an approximately 8:2 ratio, and the official independent test set is used only for final performance evaluation.
[0106] The training image can be horizontally flipped, vertically flipped, and randomly rotated at 0, 90, 180, or 270 degrees. At least one geometric transformation can be performed with a preset probability of 50%. Random cropping and asymmetric brightness adjustment can also be performed.
[0107] The input image is normalized according to the mean (0.2729, 0.2880, 0.2757) and standard deviation (0.1569, 0.1588, 0.1612), and the processed NumPy array is converted into the tensor format required by the deep learning framework.
[0108] Step 2, construct the overall NSNP-SAM network. For example... Figure 2 As shown, the input image simultaneously enters the SAM visual Transformer image encoder and the lightweight convolutional neural network branch; the former extracts global semantic features, while the latter extracts local texture and boundary features at four resolutions through four-level residual convolution and pyramid downsampling.
[0109] In this embodiment, the pre-trained core weights of the SAM image encoder are frozen, SAIA and SFTA are set within the Transformer block, STA-NPU is set in the bottom layer or adapter main path, and S-HFPI is set between the convolution detail branch and the visual Transformer semantic branch.
[0110] The SAM cue encoder receives simulated or manually given positive sample points, negative sample points, target boxes, or mask cues. The mask decoder uses cross-attention to fuse image embedding and cue embedding, and outputs a target parcel instance mask corresponding to the input image through upsampling.
[0111] Step 3, execute the STA-NPU pulse state evolution. For example... Figure 3 As shown, the STA-NPU corresponds to the state evolution structure in the invention, and its input can be the SAM low-level image embedding, the adapter main path intermediate features, or the local features after convolution branch alignment.
[0112] In one implementation, the input features are first rearranged according to three dimensions: batch, channel, and spatial location, so that each spatial location or token location corresponds to an independently evolving spiking neuron; then, local context is aggregated in the channel dimension through one-dimensional convolution, and the feature distribution of different batches and different scales is stabilized through group normalization.
[0113] Subsequently, the aggregated response is mapped to the 0-1 interval using the Sigmoid function to obtain the spatially adaptive retention coefficient. For local abrupt change areas such as field ridges, plot corners, narrow roads, and weak contrast edges, the retention coefficient tends to be larger, allowing historical states to accumulate continuously over multiple time steps; for large areas of homogeneous cultivated land or background areas, the retention coefficient tends to be smaller, allowing redundant responses to decay rapidly.
[0114] Within each time step, the STA-NPU nonlinearly accumulates the current input stimulus with the internal state of the previous time step and compares the accumulated state with a dynamic threshold. Valid pulses are emitted at locations where the threshold is reached, and empty pulses are emitted at locations where the threshold is not reached. This process transforms salient boundary events in continuous visual features into sparse discrete responses, preventing non-boundary regions from continuously propagating invalid activations to subsequent modules.
[0115] After a valid pulse is emitted, the internal state of the corresponding spatial location is deducted or reset, and the threshold for the next time step is updated based on the current pulse emission status. In this way, frequently triggered locations become more difficult to trigger subsequently, while low-response locations maintain low activity, thereby suppressing continuous false triggering caused by local noise.
[0116] After completing the evolution at the preset time steps, the pulse sequences generated at each time step are spliced together and fused using one-dimensional convolution. The remaining states at the last time step that have not yet reached the trigger threshold are added to the output features as continuous compensation. Thus, STA-NPU retains the selectivity of sparse pulses while avoiding the truncation of weak boundary details caused by complete binarization.
[0117] Step 4, perform pulse gating adaptation. For example... Figure 4 As shown, the SAIA and SFTA correspond to the spatial gating structures in the invention. Their common idea is to learn boundary-related incremental features through a small-scale trainable bypass on the basis of freezing the SAM backbone.
[0118] In SAIA, the input Transformer features are first down-projected into a low-dimensional space to reduce the number of new parameters. The low-dimensional features are then thresholded by impulse nonlinear units and then up-projected back to the original channel dimension to obtain candidate incremental features for the attention path. Parallel gating paths generate gating maps based on local spatial responses to determine which spatial locations allow candidate incremental features to pass through.
[0119] In SFTA, a lightweight ConvPass bypass is placed near the Transformer feedforward path, reorganizing the local structural information after attention update through dimensionality reduction convolution, local convolution, and dimensionality increase convolution. Since farmland plot edges often exhibit short distances, elongated shapes, and local variations, the local convolutional bypass in SFTA can compensate for the insensitivity of pure global attention to narrow boundaries.
[0120] For SAIA and SFTA, the spatial pulse gating mask is treated as a discrete switch. When a spatial location corresponds to a parcel boundary, broken corner, field ridge, or weak texture edge, the gating response reaches the threshold and outputs a valid pulse, allowing the adapter to inject incremental features. When a spatial location corresponds to a homogeneous background or a low-confidence region, the gating response is below the threshold and outputs an empty pulse to block invalid incremental features.
[0121] The adapter output is added to the original Transformer features as a residual, and a learnable scaling factor can be set. The scaling factor can be initialized with zero or near zero, so that the model is close to the original SAM mapping in the early stage of training, and then gradually learns the remote sensing boundary enhancement strength to reduce the destruction of the pre-training semantic space.
[0122] Step 5, perform pulsed high-frequency injection. For example... Figure 5 As shown, the S-HFPI corresponds to the multi-scale high-frequency injection structure in the invention, and its input is the local feature map output by the lightweight convolution branch at different resolutions.
[0123] In one implementation, the convolutional branch outputs feature maps at four scales. The features at each scale are first aligned to a unified channel dimension through 1×1 convolution or equivalent linear projection. For each scale, a high-frequency response that reflects the degree of local mutation is extracted, and the response is compared with a high-frequency trigger threshold to generate a high-frequency pulse cue mask.
[0124] The high-frequency pulse cue mask is element-wise multiplied with the corresponding scale's projected features to preserve candidate responses at field ridges, boundary transitions, narrow plot edges, and weak-contrast boundaries, while filtering out large areas of uniform texture. Subsequently, a squeezed excitation channel attention structure is used for channel reweighting, giving higher weights to channels related to plot boundaries and suppressing channels related to noise textures or repetitive background textures.
[0125] High-frequency cue features at different scales are flattened and stitched together to form a multi-scale cue library. Higher-resolution features focus on narrow boundaries and small plots, while lower-resolution features focus on the outlines of larger plots and contextual relationships. Visual Transformer semantic features are used as queries to perform multi-head cross-attention retrieval within this cue library, thereby absorbing local details on demand rather than indiscriminately stacking all convolutional low-level features.
[0126] The semantic features injected via S-HFPI are then fed into the mask decoder. Because these features simultaneously contain global semantic priors provided by the SAM backbone and high-frequency boundary information filtered by pulses provided by the convolutional branches, the mask decoder can obtain clearer criteria for instance separation when dealing with adjacent plots, weak boundaries, and small-scale plots.
[0127] Step 6, train the model. In this embodiment, the AdamW optimizer is used on an NVIDIA RTX 4090 graphics processor, and the learning rate of the basic fine-tuning module is set to 5×10. -5 The learning rate for newly added modules such as STA-NPU, SAIA, SFTA, convolutional branch, and S-HFPI is set to 2×10. -4 And set weight decay to suppress overfitting.
[0128] Regarding the training objective, a multi-task joint loss function consisting of region overlap loss, pixel-level classification loss, and boundary constraint loss can be used:
[0129]
[0130] Among them, L Dice L is used to improve the regional overlap between the prediction mask and the actual plot mask. BCE Used to constrain pixel-level foreground and background classification, L BoundaryTo enhance the contour consistency at field ridges, boundaries between adjacent plots, and weakly contrasted boundaries, λ1, λ2, and λ3 are the corresponding loss weights. Through multi-task joint optimization, the model can simultaneously focus on the overall plot area, pixel category, and fine boundary structure.
[0131] In some embodiments, an iterative hard point sampling training strategy can also be introduced: after each or several rounds of training, the boundary neighborhoods, missed detection regions, and false detection regions with large differences between the predicted mask and the real mask are sampled to construct new positive or negative sample point cues, which are then re-inputted into the cue encoder to participate in the next round of optimization. This strategy allows the model training process to continuously focus on hard-to-distinguish regions, which is especially suitable for densely adjacent blocks and weakly textured boundary scenes.
[0132] During training, forward propagation, loss calculation, backpropagation, and parameter update are performed on learnable parameters other than the frozen backbone. After each round, the Dice coefficient, mIoU, and boundary F-score are calculated on the validation set, and the model with the best validation metrics is saved.
[0133] Step 7: Perform performance verification. In this embodiment, the trained NSNP-SAM model is verified on a test set isolated from the training data. The evaluation metrics include the Dice coefficient, the mean intersection-union ratio (mIoU), and the boundary F-score, which are used to reflect the quality of region overlap, the overall segmentation consistency, and the ability to characterize boundary contours, respectively.
[0134] Under the final training configuration, NSNP-SAM achieved relatively stable segmentation results on the high-resolution remote sensing farmland dataset, with Dice, mIoU, and Boundary F-Score reaching 0.8662, 0.8036, and 0.6177, respectively. These results demonstrate that the model can enhance the contour representation of narrow boundaries and adjacent plots while maintaining accurate region segmentation.
[0135] Combining the visualization results, it can be seen that, for example Figure 6 As shown, in complex backgrounds and small plot scenes, NSNP-SAM can maintain the complete outline of small-scale farmland instances relatively well; for example... Figure 7 As shown, in multi-scale plot scenarios, the model can balance the consistency of large-scale plot areas with the details of small-scale plot edges; for example... Figure 8 As shown, in scenarios with adjacent plots and complex boundary topology, the model can more clearly distinguish the boundaries between adjacent plots. Some contrast methods are prone to undersegmentation, missegmentation of contiguous areas, or boundary blunting, while NSNP-SAM can more clearly characterize field ridges, difficult corners, and weak contrast boundaries, resulting in higher separation between the target plot and the adjacent background.
[0136] The visualization results and quantitative indicators of the test samples show that the model has good adaptability to densely adjacent plots, weakly textured boundaries, fragmented small plots, and complex corner points. STA-NPU enhances the local abrupt change response through state accumulation and threshold triggering, SAIA and SFTA suppress redundant responses to homogeneous backgrounds through spatial pulse gating, and S-HFPI compensates for local structural details through multi-scale high-frequency cue injection, thereby jointly improving the integrity and boundary clarity of the farmland plot instance mask.
[0137] The above steps can be performed in the order described, or in parallel or with the order adjusted, provided that the data dependencies are satisfied; the size of each convolutional kernel, the number of time steps, the threshold, the learning rate, the number of feature scales, and the cue type can all be set according to the actual task.
[0138] In addition to high-resolution remote sensing farmland instance segmentation, the rule-driven pulse modulation structure can also be used for other remote sensing land feature segmentation tasks with weak boundaries, slender structures, homogeneous backgrounds, or multi-scale targets. Specific applications do not limit the scope of protection of this invention.
[0139] The above embodiments are merely representative technical solutions of the present invention. Any adjustments, substitutions, or improvements made by those skilled in the art to module connections, rule parameters, feature dimensions, training processes, or equivalent calculation methods without departing from the core ideas of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A high-resolution remote sensing cultivated land instance segmentation method of fusing nonlinear impulsive neural P system, characterized in that, Includes the following steps: S1. Data Acquisition and Preprocessing: Acquire high-resolution remote sensing images and corresponding labeled data, and perform spatial alignment, rasterization, sliding window cropping, single-instance mask conversion, and data augmentation. S2. Construct a dual-branch feature encoding network: Use the visual Transformer image encoder of the Segmentation Model SAM with frozen weights as the semantic backbone, and set up a lightweight convolutional neural network branch in parallel to extract local texture and multi-scale boundary details. S3. Construct a spatiotemporal adaptive neural P system unit STA-NPU: Generate spatially adaptive retention coefficients based on input features, and perform state accumulation, threshold triggering, state reset, threshold update, temporal fusion and residual state compensation at multiple time steps to convert continuous visual features into continuous-discrete hybrid features. S4. Constructing Pulse Gated Adapters: Set up a Pulse Attention Injection Adapter (SAIA) and a Pulse Feedforward Transformer Adapter (SFTA) in the attention path and feedforward path of the Visual Transformer, respectively, and generate a spatial pulse gated mask based on the local gated response and trigger threshold to filter the adapter incremental features. S5. Construct a pulsed high-frequency cue injection module S-HFPI: perform channel alignment, high-frequency event triggering, pulse masking and channel filtering on the multi-scale features output by the convolutional neural network branches, and inject the filtered high-frequency cues into the semantic backbone through cross attention; S6. Model Training: Freeze the SAM pre-trained backbone parameters, perform end-to-end optimization of the trainable parameters of STA-NPU, SAIA, SFTA, convolutional neural network branches and S-HFPI, update the parameters using the training set and save the model based on the validation set metrics. S7. Instance segmentation: Input the remote sensing image to be processed and the points, boxes or mask cues into the trained model, and output the instance mask and boundary contour of the target farmland plot through the cue encoder and mask decoder.
2. The method according to claim 1, characterized in that, S1 includes: rasterizing the vector annotations into a binary mask spatially aligned with the remote sensing image; simultaneously cropping the original remote sensing image and the binary mask into 512×512 pixel image blocks; removing pure background or invalid regions and converting them into single-instance masks; grouping the image blocks according to the unique identifier of the original image, and grouping image blocks generated from the same original image into the same subset; and performing flipping, rotation, brightness adjustment, normalization, and tensor transformation on the training data.
3. The method according to claim 1, characterized in that, In S2, the SAM visual Transformer branch is used to extract global semantic features, and the lightweight convolutional neural network branch extracts local texture features at least three scales in a pyramid structure; the STA-NPU is set at the bottom feature modulation position, the SAIA and SFTA are set at the attention path and feedforward path of the Transformer block, respectively, and the S-HFPI is set between the convolutional features and the visual Transformer semantic features.
4. The method according to claim 1 or 3, characterized in that, The STA-NPU generates spatially position-wise retention coefficients through one-dimensional convolution, group normalization, and the Sigmoid function; it nonlinearly accumulates the current input and the state of the previous time step according to the retention coefficients; when the accumulated state reaches a dynamic threshold, it outputs a valid pulse; otherwise, it outputs an empty pulse; after the pulse is output, the corresponding threshold state is deducted and the threshold of the next time step is adaptively updated. The pulse sequences from multiple time steps are spliced together and fused using one-dimensional convolution, and the remaining state of the last time step is added to the output as a continuous compensation term.
5. The method according to claim 1 or 3, characterized in that, Both SAIA and SFTA include a feature transformation main path and a pulse gating path. The pulse gating path performs local mapping on the input features to obtain a gating response. When the gating response reaches the trigger threshold, a valid pulse with a value of 1 is output. When the gating response is lower than the trigger threshold, an empty pulse with a value of 0 is output. The spatial pulse gating mask is multiplied element-wise with the main path output and the original features are back-injected in the form of residuals through a learnable scaling factor; the main path of SAIA uses down projection, pulse transformation and up projection, while the main path of SFTA uses a lightweight convolutional bypass with embedded spiking neurons.
6. The method according to claim 1 or 3, characterized in that, The S-HFPI performs channel projection on convolutional features of different scales, extracts local high-frequency responses, and forms a high-frequency pulse cue mask based on the high-frequency trigger threshold. The high-frequency pulse cue mask is multiplied element-wise with the projected convolutional features and channel attention filtering is performed. The filtering results of different scales are flattened and concatenated into keys and values. Multi-head cross attention is performed using visual Transformer semantic features as queries, and the cross attention output is injected into the visual Transformer semantic space in the form of residuals.
7. The method according to claim 1, characterized in that, The model is trained using a differential learning rate. The basic fine-tuning module uses a first learning rate, while the STA-NPU, SAIA, SFTA, convolutional neural network branches, and S-HFPI use a second learning rate greater than the first learning rate. The model uses at least one of the following as validation or evaluation metrics: Dice coefficient, average intersection-union ratio mIoU, and boundary F-Score.
