An unmanned aerial vehicle small sample scene semantic segmentation method based on meta learning

CN122990210APending Publication Date: 2026-10-27TAIZHOU VOCATIONAL COLLEGE OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611381659.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]现有技术存在如下问题:现有小样本语义分割方法大多基于自然图像近景场景设计,未充分利用航拍飞行元数据,缺少将高度、倾斜角等信息转化为物理尺度先验以指导分割的有效手段;现有方法通常依靠支持集和查询集的直接纹理相似性进行原型匹配,未有效分离纹理变化与结构边界,容易将建筑阴影、路面纹理和车辆反光误判为语义边界;现有训练元任务构建时多在随机或同类条件下抽取样本,未强制跨飞行条件采样,导致模型训练时面对的表观差异不足,难以适应真实应用中不同飞行高度和姿态带来的域差异;现有原型计算通常对所有支持集像素赋予等权或简单注意力,缺少基于物理尺度的精细化加权,限制了因透视和距离变化带来尺度多样性时的原型质量

Benefits of technology

本发明将飞行高度、相机倾斜角、视场角等飞行元数据转化为物理地面采样距离,与单目相对深度估计网络相结合,生成以“米/像素”为单位的绝对尺度先验图,为语义分割提供统一的跨飞行条件尺度基准;在颜色梯度的基础上引入由绝对尺度先验图导出的尺度边界增强因子,构建多方向结构响应张量,有效抑制路面纹理、阴影与反光造成的伪边缘,突出建筑物轮廓、道路边界和水体岸线等稳定语义结构边界;提出跨飞行条件簇的元任务采样机制,强制支持集样本与查询集样本来自不同飞行高度、相机姿态和光照条件的飞行条件簇,并对查询集执行尺度对齐与结构边界保护下的纹理重组增强,使模型在训练阶段持续面对真实域差异,被迫学习尺度不变和结构稳定的类别表征;提出尺度感知类别原型计算与注意力快速适配机制,为尺度更接近查询集的像素赋予更大权重,并通过内层循环注意力迭代更新原型,同时将结构边界强度图、类别先验响应与查询集特征拼接输入结构引导解码器,提升边界分割精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990210A_ABST
    Figure CN122990210A_ABST
Patent Text Reader

Abstract

The application relates to a kind of unmanned aerial vehicle small sample scene semantic segmentation methods based on meta learning, belong to artificial intelligence technical field.It includes the following steps: collecting unmanned aerial vehicle aerial city scene sample, constructs meta task basic data;Use flight metadata to calculate ground sampling distance, combine monocular relative depth estimation to generate absolute scale prior graph, joint color gradient and scale gradient to extract multi-directional structure response tensor, generate structure boundary intensity graph and binary edge mask;Based on flight condition vector clustering, divide flight condition cluster, construct training meta task time forced support set and query set cross-cluster sampling, execute scale alignment and structure boundary protection texture reorganization enhancement on query set;Scale perception prototype segmentation network is constructed, scale perception class prototype is generated in inner loop, and network parameters are optimized by loss function in outer loop.The application can effectively suppress aerial texture false edge interference, and improve the precision of small sample semantic segmentation under cross flight condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a method for semantic segmentation of drone scenes in small samples based on meta-learning. Background Technology

[0002] Semantic segmentation of urban scenes captured by drones is an important research direction in remote sensing and computer vision, widely applied in tasks such as urban planning, traffic monitoring, disaster assessment, and environmental analysis. Unlike traditional ground-based or satellite perspectives, drone platforms offer adjustable flight altitude, varied camera attitudes, and flexible shooting times, resulting in a high degree of diversity in the acquired urban area images in terms of pixel scale, feature appearance, and lighting conditions. Even the same type of feature, such as roads, buildings, or green spaces, can exhibit vastly different absolute scales, perspective distortions, texture brightness, and boundary sharpness under varying aerial shooting conditions, posing a significant challenge to high-precision semantic segmentation.

[0003] Existing technologies suffer from the following problems: Most existing few-sample semantic segmentation methods are designed based on close-up scenes in natural images, failing to fully utilize aerial flight metadata and lacking effective means to transform information such as altitude and tilt angle into physical scale priors to guide segmentation; existing methods typically rely on direct texture similarity between support sets and query sets for prototype matching, failing to effectively separate texture variations from structural boundaries, and easily misjudging building shadows, road textures, and vehicle reflections as semantic boundaries; existing training meta-tasks often sample under random or similar conditions, without forcing cross-flight condition sampling, resulting in insufficient appearance differences faced by the model during training, making it difficult to adapt to domain differences brought about by different flight altitudes and attitudes in real-world applications; existing prototype computation typically assigns equal weight or simple attention to all support set pixels, lacking fine-grained weighting based on physical scale, which limits the prototype quality when scale diversity is caused by perspective and distance changes. Summary of the Invention

[0004] To achieve the above objectives, the present invention employs the following technical solution: This invention provides a method for semantic segmentation of drone scenes in few samples based on meta-learning, comprising the following steps: S1. Collect drone aerial photography samples of urban scenes and construct basic data for the meta-task, including aerial photography input images, pixel-level category annotations corresponding to the aerial photography input images, and flight metadata. S2. Utilize flight metadata to estimate ground sampling distance, combine monocular relative depth cues from aerial input images to generate an absolute scale prior map, and extract the structural response tensor by combining color gradient and absolute scale prior map gradient to obtain a structural boundary intensity map and generate a binarized edge mask. S3. Form flight condition clusters based on flight metadata. When constructing training meta-tasks, force support set samples and query set samples to come from different flight condition clusters. Perform scale alignment and structural boundary protection texture reconstruction on query set samples to obtain support set enhanced aerial images and enhanced query aerial images. S4. Construct a scale-aware prototype segmentation network. Use a shared feature extraction backbone network to extract support set feature maps and query set feature maps. In the inner loop, use support set annotations and absolute scale prior maps to generate scale-aware category prototypes. Calculate the cosine similarity between the query feature vector at each spatial location in the query set feature map and the scale-aware prototypes of each semantic category to generate a category prior response map. Concatenate the category prior response map with the query set feature map and the downsampled structure boundary strength map, and input it into the structure-guided decoder. Simultaneously, output the semantic segmentation prediction map and the prediction boundary map. In the outer loop, use the query set segmentation loss and boundary loss to update the shared feature extraction backbone network and the structure-guided decoder.

[0005] Step S1 specifically includes: Collect aerial images of urban areas; the aerial images are denoted as [image name]. , Indicates the first RGB images of urban areas captured by a drone; semantic segmentation ground truth labels are generated for each aerial input image, denoted as . , Indicates the first Pixel-level category labeling for each aerial input image; synchronously saving flight metadata for each aerial input image, including flight altitude. Camera tilt angle Camera field of view Shooting time and camera imaging width Spatial size adjustment is performed on the aerial input image and semantic segmentation ground truth annotation to obtain training image blocks and training annotation blocks of consistent size; training samples, validation samples and test samples are divided according to flight area, flight time and flight conditions.

[0006] In step S2, the ground sampling distance is estimated using flight metadata: Read aerial input images Corresponding flight altitude Camera tilt angle Camera field of view and camera imaging width The ground sampling distance is calculated based on the flight altitude, camera field of view, camera tilt angle, and camera imaging width. Outlier limits are imposed on ground sampling distance.

[0007] In step S2, generating the absolute scale prior map specifically includes: Input aerial photography images Input a lightweight monocular relative depth estimation network to obtain a relative depth map. ; In relative depth map Select the central area , Represents the set of spatial locations of the central region of the aerial input image; the relative depth map Normalize by the median of the central region, then multiply the normalized result by the ground sampling distance. To obtain the absolute scale prior map ; For absolute scale prior diagrams Smoothing and truncation processes are performed to obtain a stable absolute scale prior map.

[0008] In step S2, extracting the structural response tensor specifically includes: Preset Discrete directions Indicates the number of directions, for each discrete direction. Constructing the directional gradient operator ; Aerial input images Calculate the first RGB three color channels respectively The directional gradients in each discrete direction are calculated, and the L2 norm of the directional gradients for the three color channels is taken to obtain the color directional gradient intensity. For absolute scale prior diagrams Calculate the first The absolute value of the directional gradient in each discrete direction yields the scale directional gradient intensity. ; Multiplying the color direction gradient intensity and the scale boundary enhancement factor, we obtain the first... Structural response results in discrete directions ; Structural response tensor along discrete directional dimensions Take the maximum value to obtain the maximum structural response diagram. Perform minimum-maximum normalization on the maximum structural response map to obtain the structural boundary strength map. According to the structural boundary strength diagram Generate a binarized edge mask .

[0009] In step S3, a flight condition vector is constructed based on the flight altitude, camera tilt angle, ground sampling distance, and shooting time of each aerial input image. The training samples are then divided into multiple flight condition clusters using K-means clustering. When constructing the training meta-task, it is forced that the support set samples and query set samples come from different flight condition clusters. Construct a flight condition vector for each aerial input image. , Indicates the first The flight condition description vector corresponding to the aerial input image; flight condition vector Including flight altitude Camera tilt angle Ground sampling distance The sine and cosine values ​​of the shooting time; For flight condition vectors Each dimension in the vector is standardized to obtain a standardized flight condition vector. Perform K-means clustering on the flight condition vectors corresponding to all training samples to obtain A cluster of flight conditions; When constructing the training meta-task, from Two different flight condition clusters are randomly selected from each flight condition cluster. One flight condition cluster provides the support set sample, and the other provides the query set sample. Samples are extracted from the flight condition clusters corresponding to the support set. Annotated aerial images are used as support set samples, and samples are extracted from the corresponding flight condition clusters in the query set. The aerial images with labeled borders are used as samples for the query set.

[0010] In step S3, scale alignment is performed on the query set samples, and the reference ground sampling distance of the current training meta-task support set samples is calculated. , This represents the average ground sampling distance of the support set samples; for each query set sample, the query set ground sampling distance is read. ; Calculate the scaling ratio , for scale ratio Range constraints are applied to obtain a stable scale ratio; bilinear resampling is then performed on the query set samples based on the stable scale ratio to obtain scale-aligned query aerial images. Perform synchronous spatial transformation on the semantic segmentation truth labels, absolute scale prior maps, structural boundary strength maps, and binarized edge masks corresponding to the query set samples.

[0011] In step S3, the structural boundary protection texture reconstruction enhancement specifically includes: Select reference-style aerial images from the training sample database. ; Scale-aligned aerial images and reference style aerial images The color space is converted from RGB to Lab to obtain a scale-aligned query Lab image and a reference style Lab image. Flat regions are determined using a binarized edge mask, and channel-level statistical matching is performed on the scale-aligned query Lab image within these flat regions to obtain a style-matched Lab image. The style-matched Lab image is then converted back to RGB color space to obtain a texture style candidate image. The texture style candidate images are blended with the query aerial images according to their proportions and scale, and the blending intensity is denoted as . ;Select texture style candidate images Query aerial images with scale alignment According to mixing strength Weighted blending is performed to generate candidate images for the query set with reference style incorporated; Gaussian smoothing is applied to the binarized edge mask to obtain a soft edge protection mask. ; An enhanced query aerial image is obtained by using a soft-edge protection mask to preserve the structural edges in the scale-aligned query aerial image and applying texture-style candidate images only in flat areas. The support set samples are resized, color normalized, and subjected to lightweight random perturbations to obtain support set-enhanced aerial images. .

[0012] Step S4 specifically includes: Constructing a shared feature extraction backbone network The shared feature extraction backbone network uses MobileNetV3-Large as its backbone network; it will support the integration of enhanced aerial images. Input shared feature extraction backbone network The support set feature map is obtained. This will enhance the ability to query aerial images. Input the same shared feature extraction backbone network , obtain the feature map of the query set ; Computational scale-aware initial category prototype: Downsample the support set semantic segmentation ground truth annotations to the spatial resolution of the support set feature map to obtain the downsampled support set annotations. The absolute-scale prior graphs of the support set and the query set are downsampled to obtain the downsampled absolute-scale prior graph of the support set. and the absolute scale prior graph of the downsampled query set The average scale of the query set is obtained by averaging the absolute scale prior map of the downsampled query set samples over the non-filled regions. ; Calculate the scale-aware weight for each spatial location in the support set samples. For each semantic category Calculate the initial category prototype ; Computational scale-aware category prototype: inner loop iteration from Begin with scale-aware initial category prototypes As the prototype of the 0th step category Each iteration In the middle, using the current prototype Attention weights are calculated using the support set features, and then the category prototypes are updated using a weighted summation method to obtain... This process is repeated. Next, complete the first After several iterations, the final scale-aware category prototype is obtained. .

[0013] The structure-guided decoder described in step S4 includes three convolutional blocks and two output heads; each of the three convolutional blocks includes... Convolutional layer, group normalization, and ReLU activation function; two output heads: a segmentation output head and a boundary output head; the segmentation output head includes... Convolutional layers, bilinear interpolation upsampling, and a softmax function are used to generate the query set semantic segmentation prediction map; the boundary output header employs... Convolutional layers and the sigmoid function are used to generate the predicted boundary map.

[0014] The advantages of this invention are: This invention transforms flight metadata such as flight altitude, camera tilt angle, and field of view into physical ground sampling distances, and combines this with a monocular relative depth estimation network to generate an absolute scale prior map in meters per pixel, providing a unified cross-flight condition scale benchmark for semantic segmentation. Based on the color gradient, a scale boundary enhancement factor derived from the absolute scale prior map is introduced to construct a multi-directional structural response tensor, effectively suppressing false edges caused by road textures, shadows, and reflections, and highlighting stable semantic structural boundaries such as building outlines, road boundaries, and waterfronts. A meta-task sampling mechanism across flight condition clusters is proposed, forcing... The model supports flight condition clusters where the sample set and query set samples come from different flight altitudes, camera attitudes, and lighting conditions. It also performs scale alignment and texture reconstruction enhancement under structural boundary protection on the query set, so that the model continuously faces differences in the real domain during the training phase and is forced to learn scale-invariant and structurally stable category representations. The model proposes a scale-aware category prototype computation and fast attention adaptation mechanism, which assigns greater weight to pixels whose scale is closer to that of the query set and updates the prototype iteratively through inner loop attention. At the same time, the structural boundary intensity map, category prior response and query set features are concatenated and input into the structure to guide the decoder, thereby improving the boundary segmentation accuracy. Attached Figure Description

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

[0016] Figure 1 This is a flowchart of the steps of the method of the present invention; Figure 2 A flowchart for generating an absolute scale prior graph; Figure 3 This is a diagram illustrating the process of extracting scale-aware structural response tensors. Figure 4 A graph showing the relationship between structural response and color gradient; Figure 5 Flowchart for training meta-tasks; Figure 6 A graph showing the scale ratio distribution of the query set; Figure 7 Data flow graph for the shared feature extraction backbone network; Figure 8 A flowchart for generating scale-aware initial category prototypes; Figure 9 A flowchart for structure-guided decoding and query set semantic segmentation prediction; Figure 10 Generate an image based on the segmentation results of the new scene. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Example 1 In this embodiment, as Figure 1 As shown, this invention provides a method for semantic segmentation of UAV few-shot scenes based on meta-learning, the specific steps of which include: S1. Collection of urban scene samples by drone and processing of basic meta-task data. Drone aerial images of urban areas are characterized by an overhead view, a wide range of ground feature scale variations, significant changes in flight altitude, frequent changes in camera attitude, and significant differences in local illumination. In small-sample semantic segmentation tasks, support set samples and query set samples often come from different flight conditions, resulting in inconsistencies in pixel scale, perspective distortion, texture brightness, and boundary morphology for the same type of ground features.

[0019] This invention first collects aerial input images, semantic segmentation ground truth annotations, and flight metadata. Then, it organizes the training data into a meta-task sample library suitable for constructing support sets and query sets, enabling subsequent processing to simultaneously utilize image content, pixel annotations, and flight condition information. The specific steps are as follows: Aerial input image and semantic segmentation ground truth annotation acquisition 1) Collect aerial images of the urban area. The aerial images are denoted as follows: ,in, This represents the sample index, with a value ranging from 1 to... , This indicates the total number of aerial input images; Indicates the first A RGB image of an urban area captured by a drone, with a size of , This represents the pixel height of the aerial input image, for example, 1080. This represents the pixel width of the aerial input image, for example, 1920, and 3 represents the number of RGB color channels.

[0020] 2) Create semantic segmentation ground truth labels for each aerial input image. The semantic segmentation ground truth labels are denoted as follows: ,in, Indicates the first The pixel-level category labeling of the aerial input image, with a size of [size missing]. The label value for each spatial location is the corresponding semantic category index.

[0021] The total number of semantic categories is denoted as , This indicates the number of urban semantic categories that need to be identified. For example, if we take 5, the 5 categories are background, roads, buildings, green spaces, and water bodies. We can also add categories such as vehicles, bare land, and bridges depending on the specific application.

[0022] 3) Synchronously save the flight metadata corresponding to each aerial input image. The flight metadata should include at least the flight altitude. Camera tilt angle Camera field of view Shooting time and camera imaging width Among them, regarding the first Aerial input image: This indicates the vertical height of the drone relative to the ground, in meters, for example, 80 to 150. It represents the angle between the camera's optical axis and the vertical downward direction, in degrees. 0° indicates orthogonal shooting, and for example, it can range from 0° to 35°. This indicates the camera's horizontal field of view, in degrees, for example, 70° to 90°. This indicates the shooting time and is used to reflect the difference in sunlight direction and light intensity. In practical implementation, if the drone flight control log outputs the pitch angle of the camera's optical axis relative to the horizontal plane, it is first converted into the camera tilt angle between the camera's optical axis and the vertically downward direction to avoid confusion in the angle definition during subsequent scale estimation; before performing trigonometric function calculations, the camera tilt angle and camera field of view are uniformly converted to radians.

[0023] 4) Spatial resizing of the aerial input image and semantic segmentation ground truth annotations yields training image blocks and training annotation blocks of consistent size. In practice, the original aerial input image is cropped to a fixed size. or When cropping image blocks, ensure that the proportion of effective labeled regions in each image block is greater than a preset threshold, such as greater than 70%; generate corresponding labeled blocks using the same cropping position for semantic segmentation ground truth labels, and prohibit the use of bilinear interpolation for semantic segmentation ground truth labels to avoid the category index being interpolated into a non-integer value.

[0024] 5) Divide the training samples, validation samples, and test samples according to the flight area, flight time, and flight conditions. This will ensure that aerial images of the same continuous flight path or adjacent shooting times do not appear in the training samples and test samples at the same time as much as possible. This will reduce the risk that the model will rely solely on the texture similarity of adjacent images and make the test results closer to the real small sample segmentation scenario across flight conditions.

[0025] S2. Flight-scale priors and structural boundary response extraction Aerial images only contain pixel coordinates and cannot directly reflect the real ground scale corresponding to each pixel. Different flight altitudes, different camera tilt angles, and different ground sampling distances will cause roads of the same width, the edge of the same roof, or the green area of ​​the same size to appear as different pixel sizes in the image.

[0026] This invention utilizes flight metadata to estimate ground sampling distances and combines monocular relative depth cues from aerial input images to generate an absolute-scale prior map. Then, it extracts the structural response tensor by combining color gradients and the gradients from the absolute-scale prior map. This enables subsequent enhancement and segmentation training to prioritize the protection of stable semantic structures such as building boundaries, road outlines, and waterfronts. The specific steps are as follows: S201, Ground Sampling Distance Estimation Based on Flight Metadata This step utilizes the flight altitude, camera tilt angle, camera field of view, and camera imaging width synchronously recorded during drone aerial photography to calculate the actual ground length corresponding to a single pixel in the central region of the aerial input image, i.e., the ground sampling distance. This provides a unified physical scale benchmark for the subsequent generation of absolute scale prior maps and cross-flight condition scale alignment. The specific steps are as follows: 1) Read aerial input images Corresponding flight altitude Camera tilt angle Camera field of view and camera imaging width .

[0027] Furthermore, the ground sampling distance is recorded as... , Indicates the first The actual ground length corresponding to a single pixel in the central region of the aerial input image, in meters per pixel, is used to provide a benchmark for alignment across flight condition scales.

[0028] In one implementation, the ground sampling distance is calculated based on the flight altitude, camera field of view, camera tilt angle, and camera imaging width, and is expressed as: , in, Represents the tangent function. Represents the cosine function; The larger the value, the further the camera is from the orthogonal direction, and the larger the ground coverage scale corresponding to the central area of ​​the image.

[0029] It should be noted that the above formula is used to obtain an approximate scale benchmark that can be implemented in engineering. When the UAV camera can directly output the actual ground sampling distance or camera intrinsic parameters and sensor dimensions, it can also be directly read or calculated according to the camera imaging model. .

[0030] In one embodiment, for example, if rice, , , First, convert 84° and 20° to radians, then substitute them into the formula to obtain... Approximately 0.12 meters per pixel. This value indicates that one pixel in the central region of the aerial input image corresponds to approximately 0.12 meters on the ground; if another aerial input image... With a resolution of 0.18 meters per pixel, a road of the same actual width occupies fewer pixels in the aerial input image.

[0031] 2) Limit outliers in ground sampling distance to avoid excessive deformation in subsequent scale alignment caused by errors in flight metadata recording.

[0032] In practical implementation, it can be The distance is limited to a preset range, such as 0.03 meters per pixel to 0.50 meters per pixel; if the calculation result exceeds this range, the median ground sampling distance at adjacent shooting times along the same flight path will be used as the replacement.

[0033] S202, Absolute Scale Prior Map Generation Ground sampling distances calculated using flight metadata are combined with relative depth maps output by a lightweight monocular relative depth estimation network to generate an absolute scale prior map in meters per pixel. This provides a local physical scale reference relative to the image center for each spatial location, used for subsequent scale alignment, structural boundary extraction, and class prototype weighting. Figure 2 As shown, the specific steps are as follows: 1) Input aerial images Input a lightweight monocular relative depth estimation network to obtain a relative depth map. , Indicates the first The relative distances between spatial locations in the input aerial image, with a size of [size missing]. Its value does not directly represent the true depth, but only the relative scale change between different spatial locations within the same aerial input image.

[0034] In one implementation, the lightweight monocular relative depth estimation network consists of a MobileNet encoder and a progressive upsampling decoder. The input is a normalized aerial image, and the output is a single-channel relative depth map. The MobileNet encoder extracts features at 1 / 4, 1 / 8, and 1 / 16 scales, and the progressive upsampling decoder gradually restores the low-resolution features to the original image size. The convolution outputs a relative depth map. If the training data lacks real depth annotations, a publicly available aerial depth model or a pre-trained model based on urban aerial data can be used as the initialization model. In this invention, the lightweight monocular relative depth estimation network is only used to generate scale priors and is not used as the core training objective of the few-shot semantic segmentation meta-learning outer loop.

[0035] In this implementation, the encoder uses MobileNetV2 as its backbone, removing its last global average pooling and classification layers, and retaining feature maps at scales of 1 / 4, 1 / 8, and 1 / 16. The decoder consists of three progressively upsampling blocks, each containing a bilinear interpolation upsampling layer and two 3×3 convolutional layers. After convolution, batch normalization and ReLU activation functions are applied. The upsampling blocks gradually restore the low-resolution features to the original image size. After the output of the last upsampling block, a 1-channel relative depth map is generated through a 1×1 convolution.

[0036] 2) In the relative depth map Select the central area , This represents the set of spatial locations of the central region of the aerial input image, for example, taking the image center. The set of spatial locations corresponding to pixel blocks; then, the median of the relative depth values ​​of the central region is calculated and used as a scale normalization reference.

[0037] Furthermore, the relative depth map Normalize by the median of the central region, then multiply by the ground sampling distance. To obtain the absolute scale prior map , is represented as: , in, Indicates the first The absolute scale prior image corresponding to the aerial input image, with a size of [size missing]. , used to characterize the local physical scale of each spatial location relative to the central region; This represents the spatial location index in the aerial image input, used to traverse all pixel positions; Indicates spatial location The local scale prior value at that location, i.e., the absolute scale prior map. In spatial location Elements at the location; Indicates spatial location The relative depth value at a location, i.e., the relative depth map. In spatial location Elements at the location; This represents the median value within the set of spatial locations in the central region. Indicates the spatial location index within the central area; This represents the depth-normalized stability constant, used to prevent numerical instability caused by an excessively small median. For example, taking... .

[0038] 3) For absolute scale prior maps Smoothing and truncation processes are performed to obtain a stable absolute scale prior map.

[0039] In the specific implementation, first use Median filtering removes isolated deep noise, and then the values ​​are truncated to... to Within this range, the monocular relative depth estimation network avoids extreme values ​​at locations such as vehicles, tree canopy shadows, or highly reflective roofs, thereby improving the stability of subsequent scale weight calculations.

[0040] It should be noted that the absolute scale prior diagram It is not a precise 3D reconstruction result, nor does it require the restoration of the true building height. Its role is to combine the ground sampling distance provided by the flight metadata with the relative scale changes within the image, providing a unified scale reference for scale alignment, structural boundary extraction, and category prototype weighting.

[0041] S203, Scale-Aware Structural Response Tensor Extraction Based on the color gradient, a scale gradient suppression factor is introduced. The product of the color direction gradient intensity and the scale boundary enhancement factor is calculated for each discrete direction to obtain a multi-directional structural response tensor. Then, the maximum value is taken along the direction and normalized to generate a structural boundary intensity map and a binarized edge mask. This achieves the purpose of preserving stable semantic structural boundaries and suppressing texture pseudo-edges. The specific steps are as follows: 1) Preset Discrete directions This indicates the number of directions; for example, 8 corresponds to 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315°. For each discrete direction... Constructing the directional gradient operator directional gradient operator Used to calculate the aerial input image or absolute scale prior image along the first... Spatial change rate in each discrete direction This represents a discrete direction index, with values ​​ranging from 1 to... .

[0042] In one implementation, the directional gradient operator This can be achieved using the Sobel operator, the Scharr operator, or the neighboring pixel difference operator. For example, using the Sobel operator, for the horizontal direction ( (0°) Using a horizontal Sobel kernel For the vertical direction ( (90°) Using a vertical Sobel kernel For the 45° direction ( ) and 135° direction ( Along the diagonal directions, the horizontal gradient component is first calculated using horizontal and vertical Sobel kernels. and vertical gradient components Press again Synthesis to obtain along the direction The gradient of, where, For the first Azimuth angles in discrete directions.

[0043] In this implementation, when neighboring pixels are missing at image boundaries, a mirror-fill method is used. For example, when calculating the gradient in the horizontal direction, if the leftmost pixel lacks a left neighbor, the value of the first pixel to its right is mirrored and used for the calculation.

[0044] 2) Input aerial images Calculate the first RGB three color channels respectively The directional gradients in each discrete direction are calculated, and the L2 norm of the directional gradients for the three color channels is taken to obtain the color directional gradient intensity. ,in, Indicates the first Aerial input image in spatial location Along the first The intensity of color change in each discrete direction.

[0045] In practical implementation, if spatial location The red, green, and blue channels are located along the first... The gradients in each discrete direction are respectively , and Then the gradient intensity in the color direction is ;in, Indicates the red channel along the first Gradient in each discrete direction, Indicates the green channel along the first Gradient in each discrete direction, Indicates the blue channel along the first The gradient in each discrete direction.

[0046] 3) For absolute scale prior maps Calculate the first The absolute value of the directional gradient in each discrete direction yields the scale directional gradient intensity. , Indicates spatial location Along the first The intensity of local scale changes in discrete directions. The greater the gradient intensity in the scale direction, the more likely the location is to be on the outer contour of a building, road boundary, shoreline boundary, or at a location of elevation change; the smaller the gradient intensity in the scale direction, the more likely the location is to be a texture change or lighting change within the same semantic region.

[0047] 4) Multiply the color direction gradient intensity and the scale boundary enhancement factor to obtain the first... Structural response results in discrete directions , Indicates the first The first aerial input image is in the Discrete direction, spatial location The structural response intensity at the location is calculated as follows: , in, Indicates the first The structural response tensor of the aerial input image is a tensor of size . The three-dimensional tensor Represents the structural response tensor No. Two-dimensional components of each directional channel, Representing two-dimensional components In spatial location Element; This represents the scale gradient adjustment coefficient, used to control the degree to which the scale direction gradient enhances the structural response; for example, it is set to 0.5. This represents the structural response stability constant, used to avoid a denominator of 0, for example, taking... ; This represents the natural exponential function.

[0048] It should be noted that when a location exhibits only color change without significant scale change, the scale boundary enhancement factor approaches 0, and the structural response at that location is suppressed. Conversely, when a location exhibits both color and scale change, the scale boundary enhancement factor increases, and the structural response at that location is preserved and highlighted. Therefore, the structural response tensor... It can reduce false edges caused by road textures, tree shadows, vehicle reflections, and roof patterns, making it more suitable for representing stable structural boundaries in semantic segmentation.

[0049] 5) Structural response tensor along discrete directional dimensions Take the maximum value to obtain the maximum structural response diagram. ,in, Indicates the first The strongest structural response in all directions from the aerial input image, with a size of [size missing]. .

[0050] Furthermore, minimum-maximum normalization is performed on the maximum structural response map to obtain the structural boundary strength map. , This represents the normalized soft boundary prior graph, with values ​​ranging from 0 to 1. A larger value indicates that it is more likely to be located at the semantic structure boundary.

[0051] 6) According to the structural boundary strength diagram Generate a binarized edge mask .

[0052] In the specific implementation, let the binarization threshold of the structure edge be . , This represents the threshold for determining structural edges, for example, 0.3; if Then Set to 1 to represent spatial location It belongs to the edge region of the structure; otherwise it will Setting it to 0 indicates spatial location. It belongs to a flat area or a weakly boundaryed area. Among them, Indicates spatial location The normalized structural boundary strength value at that point is the structural boundary strength map. In spatial location Elements at the location; Indicates the first Binarized edge mask corresponding to the aerial input image In spatial location The element at that position takes the value 0 or 1.

[0053] In one embodiment, as an example, if the normalized maximum structural response at a certain spatial location in eight directions is 0.62, and Then, this spatial location is marked as the structural edge region. If the normalized maximum structural response at another spatial location is 0.12, then that spatial location is marked as a flat region. .

[0054] In one embodiment, such as Figure 4 As shown in the figure, the relationship between structural response and color gradient is analyzed. The horizontal axis represents the gradient intensity in the color direction (dimensionless), and the vertical axis represents the structural response intensity (dimensionless). The color of the scatter points represents the gradient intensity in the scale direction. It can be seen from the figure that when the scale gradient intensity is low, even if the color gradient is large, the structural response is suppressed to a low level; while when the scale gradient intensity is high, the structural response increases significantly with the increase of the color gradient.

[0055] S3. Meta-mission-oriented cross-flight condition enhancement and training meta-mission construction Meta-learning training requires the model to learn rapid adaptation capabilities from a large number of training meta-tasks. If the support set samples and query set samples in the training meta-tasks come from the same flight altitude, similar camera pose, or similar lighting conditions, the model is prone to relying on similar textures to complete segmentation, and cannot adapt to the scale and style changes brought about by new flight conditions in real applications.

[0056] This invention forms flight condition clusters based on flight metadata. When constructing the training meta-task, it forces the support set samples and query set samples to come from different flight condition clusters. Furthermore, it performs scale alignment and structural boundary-preserving texture reassembly on the query set samples, ensuring the model continuously addresses cross-flight condition differences during training. Figure 5 As shown, the specific steps are as follows: S301, Flight Condition Cluster Construction and Cross-Cluster Meta-Task Sampling A flight condition vector is constructed based on the flight altitude, camera tilt angle, ground sampling distance, and shooting time of each aerial input image. Training samples are then divided into multiple flight condition clusters using K-means clustering. When constructing the training meta-task, the support set samples and query set samples are forced to come from different flight condition clusters. This ensures the model continuously faces cross-flight condition differences during training, learning more scale- and structurally stable category representations. The specific steps are as follows: 1) Construct a flight condition vector for each aerial input image. , Indicates the first The flight condition description vector corresponding to each aerial input image.

[0057] In one implementation, the flight condition vector Including flight altitude Camera tilt angle Ground sampling distance The shooting time is represented by sine and cosine values. Using sine and cosine values ​​to represent the shooting time avoids the problem that 23:00 and 0:00 are numerically far apart but their actual light cycles are adjacent.

[0058] In one embodiment, for example, if the shooting time is 14:30 (i.e., 14.5 hours), and assuming a 24-hour cycle, the corresponding radians are... sine value cosine value If the shooting time is 02:15 (2.25 hours), the radian value is approximately 0.589, the sine value is approximately 0.56, and the cosine value is approximately 0.83. By using the two values ​​of sine and cosine, the problem of 23:00 and 00:00 being 23 hours apart in numerical value but adjacent in terms of light cycle can be avoided.

[0059] 2) For flight condition vectors Standardization is performed on each dimension.

[0060] In the specific implementation, the flight altitude and ground sampling distance are normalized using mean-variance, the camera tilt angle is normalized by dividing by the maximum allowable tilt angle, and the sine and cosine values ​​of the shooting time are kept within the range of -1 to 1. The normalized flight condition vector is used for clustering, and the original flight metadata is still used for ground sampling distance calculation and scale alignment.

[0061] 3) Perform K-means clustering on the flight condition vectors corresponding to all training samples to obtain... A cluster of flight conditions, among which... This indicates the number of flight condition clusters, for example, 5. Each flight condition cluster corresponds to a set of similar combinations of flight altitude, camera tilt angle, ground sampling distance, and shooting time.

[0062] In the actual implementation, first initialize randomly. For each cluster center, calculate the Euclidean distance from each flight condition vector to its nearest cluster center, and assign each flight condition vector to the nearest cluster center. Then, update the cluster centers based on the mean of the flight condition vectors within each flight condition cluster. Repeat this assignment and update process until the change in cluster centers is less than a preset threshold or a preset number of iterations is reached. The preset number of iterations can be 100, and the threshold for cluster center change can be set to... .

[0063] 4) When constructing the training meta-task, from Two different flight condition clusters are randomly selected from the flight condition clusters. One flight condition cluster provides a support set sample, and the other flight condition cluster provides a query set sample.

[0064] Specifically, the number of support set samples is denoted as , This represents the number of labeled support set samples in the current training meta-task, for example, 1 to 5; the number of query set samples is denoted as... , This indicates the number of query set samples in the current training meta-task, for example, 2 to 4.

[0065] In one embodiment, as an example, suppose there are 5 flight condition clusters. When constructing a training meta-task, cluster 2 and cluster 4 are randomly selected. Cluster 2 provides support set samples, and cluster 4 provides query set samples. Samples are extracted from cluster 2. Annotated aerial images were used as support set samples, and samples were extracted from cluster 4. The three labeled aerial images are used as query set samples, and it is ensured that the five semantic categories to be identified in the current task appear at least once in the three extracted support set samples.

[0066] 5) Extract from the flight condition cluster corresponding to the support set Annotated aerial images are used as support set samples, and samples are extracted from the corresponding flight condition clusters in the query set. The aerial images with labeled bands are used as query set samples. During extraction, it is ensured that the target semantic category involved in the current training meta-task appears at least once in the support set samples. If a target semantic category does not exist in the extracted support set samples, the support set samples are extracted again to avoid the inability to initialize subsequent category prototypes.

[0067] It should be noted that the design motivation for cross-flight condition cluster sampling is to incorporate the domain differences caused by flight altitude, camera tilt angle, and lighting time into the training meta-task, so that the model cannot rely solely on similar textures of the support set and query set to complete the prediction, but must learn a more scale- and structurally stable category representation.

[0068] S302, Query set sample scale alignment This step calculates the reference ground sampling distance for the support set samples of the current training meta-task, then determines the resampling ratio based on the ground sampling distance of the query set samples, and performs spatial scale scaling on the aerial images of the query set and their corresponding annotations, prior images, and masks to make the pixel scale of the ground features in the query set more consistent with that of the support set, thereby reducing the impact of intra-class scale differences on prototype matching. The specific steps are as follows: 1) Calculate the reference ground sampling distance for the support set samples of the current training meta-task. , This represents the average ground sampling distance of the support set samples, which is used as a reference benchmark for query set scale alignment.

[0069] In practical implementation, if the support set contains multiple support set samples, the ground sampling distance of all support set samples is taken as the arithmetic mean or median, with the median preferred to reduce the impact of abnormal flight metadata.

[0070] In one embodiment, if the support set contains three samples with ground sampling distances of 0.11 m / pixel, 0.13 m / pixel, and 0.12 m / pixel, respectively, then the median of 0.12 m / pixel is preferred as the ground sampling distance of the query set. .

[0071] 2) For each query set sample, read the ground sampling distance of the query set. , This represents the ground sampling distance of the current query set sample. Calculate the scale ratio. , The scale resampling ratio of the query set samples relative to the support set samples is expressed as: , in, This represents the scaling stability constant, used to avoid a denominator of 0, for example, taking... .when When the ground sampling distance of the query set sample is larger, the same feature has smaller pixels in the query set sample, and the query set sample needs to be enlarged; when When the ground sampling distance of the query set sample is smaller, the same ground feature has larger pixels in the query set sample, and the query set sample needs to be reduced in size.

[0072] 3) Scale ratio By applying range restrictions, a stable scaling ratio is obtained.

[0073] In one implementation, the stable scaling ratio can be limited to between 0.5 and 2.0 to avoid severe image blurring or excessive distortion of semantic annotations caused by extreme scale resampling.

[0074] 4> Perform bilinear resampling on the query set samples based on the stable scale scaling ratio to obtain scale-aligned query aerial images. , This represents the scale-aligned aerial images of the query set samples.

[0075] In practical implementation, if the stable scaling ratio is 1.25, the height and width of the query set samples are enlarged to 1.25 times their original size; if the stable scaling ratio is 0.8, the height and width of the query set samples are reduced to 0.8 times their original size. After resampling, if the spatial size is larger than the model input size, center clipping or random clipping is used; if the spatial size is smaller than the model input size, edge copying and padding are used.

[0076] It should be noted that the stable scaling ratio refers to the scaling ratio of the initial calculation. The scaling ratio obtained after range limitation is used for actual spatial resampling to prevent severe image blurring or excessive distortion of semantic annotations caused by extreme resampling. For example, if Within the limits Within this range, the stable scaling ratio is 1.5; if If the upper limit is exceeded, the stable scale scaling ratio is truncated to 2.0.

[0077] In one embodiment, for example, the ground sampling distance for the support set is 0.12 meters / pixel, and the ground sampling distance for the query set is 0.18 meters / pixel. If the query set is enlarged by 1.5 times in both height and width, and the original query set size is 720×960, it will be enlarged to 1080×1440. If the model input requires 512×512, then center clipping can be used to obtain 512×512.

[0078] 5) Perform synchronous spatial transformation on the semantic segmentation truth labels, absolute scale prior maps, structural boundary strength maps, and binarized edge masks corresponding to the query set samples.

[0079] In the specific implementation, the semantic segmentation ground truth labels and binarized edge masks corresponding to the query set samples are scaled using nearest neighbor interpolation to ensure that the label values ​​remain integers; the absolute scale prior map and structural boundary strength map are scaled using bilinear interpolation to maintain numerical continuity and smoothness. All maps use the exact same scale ratio and interpolation position as the aerial images in the query set to achieve spatial alignment.

[0080] In one embodiment, the reference ground sampling distance for the support set of samples is... The query set ground sampling distance is 0.12 meters per pixel. If the pixel size is 0.18 meters, then the scaling ratio is... This indicates that the ground features in the query set samples are too small at the pixel level. After enlarging both the width and height of the query set samples by 1.5 times, the pixel scale of roads of the same width is closer in the support set samples and the query set samples, thereby reducing the scale bias when matching the model prototype.

[0081] In one embodiment, such as Figure 6 As shown, the scale scaling ratio distribution of the query set is analyzed. The horizontal axis represents the scale scaling ratio (dimensionless), and the vertical axis represents the frequency. The red dashed line marks the positions where the scale scaling ratio equals 1.0. In scenarios with different flight conditions, there are real differences in the pixel scale of ground objects. It is necessary to calculate the scale scaling ratio based on the actual ground sampling distance and to scale and resample the query set to achieve scale alignment, thereby reducing the negative impact of intra-class scale inconsistency on prototype matching.

[0082] S303, Structural Boundary Protection Texture Reconstruction Enhancement A binarized edge mask is used to distinguish structural edges from flat regions. Within flat regions, aerial images of another flight condition cluster are referenced to perform channel-level brightness and color statistical matching on the query set samples to generate texture style candidate images. Then, a soft edge protection mask is used to preserve the structural edges as the original scale-aligned image content, while only flat regions are replaced with texture style candidate images. This introduces cross-condition appearance perturbation while protecting semantic boundaries, forcing the model to rely on structural boundaries and scale priors. The specific steps are as follows: 1) Select reference style aerial images from the training sample library , This refers to a reference image used to provide lighting, color, and local texture style.

[0083] In practice, the reference style aerial images are preferentially selected from flight condition clusters that are different from the query set samples to increase the appearance perturbation intensity of the query set samples, and the reference style aerial images are adjusted to be scale-aligned with the query aerial images. Same space dimensions.

[0084] 2) Align scale when querying aerial images and reference style aerial images The conversion from RGB color space to Lab color space yields a scale-aligned query Lab image and a reference-style Lab image. In Lab color space, the luminance channel and color channel are separated, making it easier to perform luminance and color statistical matching.

[0085] 3) Determine the flat region based on the binarized edge mask. Specifically, the flat region is... Spatial location, This represents the binarized edge mask of the query set samples after scale alignment; within the flat region, the mean and standard deviation of the scale-aligned query Lab image and the reference style Lab image are statistically analyzed in the L, a, and b channels, respectively, to provide the statistical parameters of the source and target images for channel-level statistical matching.

[0086] 4) Perform channel-level statistical matching on the scale-aligned query Lab image within flat regions to obtain a style-matched Lab image.

[0087] In practical implementation, for any channel in the Lab color space ( (Can represent L channel, a channel, or b channel), scale-aligned query Lab image in channels The pixel value is subtracted from the mean of that channel in the flat region, then divided by the sum of the standard deviation and the stability constant of that channel in the flat region, multiplied by the standard deviation of the corresponding channel in the reference style Lab image, and then the mean of the corresponding channel in the reference style Lab image is added; where the stability constant is denoted as... This is used to prevent the standard deviation from being 0, for example, by taking... .

[0088] In one embodiment, taking the L channel as an example, let the mean value of the L channel of the scale-aligned query Lab image within a flat region be [value missing]. Standard deviation is The mean value of the L channel of the reference style Lab image is Standard deviation is For a certain spatial location within a flat area Its L channel original pixel value Then the L channel value after style matching is: , in, Indicates spatial location After style matching Channel pixel values; This indicates a scale-aligned query for Lab images within a flat region. Channel mean; This indicates a scale-aligned query for Lab images within a flat region. Channel standard deviation; This represents the stability constant, used to prevent division by zero, and can be taken as... .

[0089] It should be noted that structural edge regions typically correspond to semantic category boundaries such as building outlines, road boundaries, and water shorelines. Forcibly performing color and texture style transfer at the edges can easily blur or destroy semantic boundaries, leading to a decrease in segmentation accuracy. Channel-level statistical matching is only performed in flat areas, and the pixel values ​​of structural edge regions are not changed temporarily. The original structural edge content is then preserved through a soft edge protection mask.

[0090] 5) Convert the Style Match Lab image back to the RGB color space to obtain texture style candidate images. , This indicates that a query set of candidate images with reference lighting and color style has been introduced.

[0091] Furthermore, the texture style candidate images are blended with the query aerial images according to their proportions and scale, and the blending intensity is denoted as... , This represents the texture remodeling intensity, for example, ranging from 0.3 to 0.6. The higher the blending intensity, the stronger the influence of the reference style; the lower the blending intensity, the more of the original appearance of the query set is preserved.

[0092] In the specific implementation, candidate images of texture styles are selected. Query aerial images with scale alignment According to mixing strength Weighted blending is performed to generate candidate images of the query set with reference style incorporated, represented as follows: , in, This indicates an assignment operation, where the result of the expression on the right is assigned to the variable on the left. For example, taking... Then it will ultimately participate in the subsequent soft mask protection. In the sample, 40% of the candidate images are from texture style candidates after statistical matching, and 60% are from the original scale-aligned query aerial images. After mixing, the candidate images have reference lighting and color style in flat areas without completely losing the original texture features of the query set.

[0093] 6) Binarized edge mask (i.e., the scale-aligned binary edge mask of the query set) Perform Gaussian smoothing to obtain a soft-edge protection mask. , This represents a soft mask with values ​​ranging from 0 to 1, whose size and scale are aligned with the aerial images being retrieved; values ​​are closer to 1 near the edges of structures and closer to 0 inside flat areas.

[0094] In practical implementation, the Gaussian kernel size can be taken as... The standard deviation can be taken as 1.0; using a soft edge protection mask can avoid abrupt seams at the junction of the edge mask in the enhanced image.

[0095] 7) Use a soft-edge protection mask to preserve the structural edges in the scale-aligned query aerial image, and only apply texture-style candidate images in flat areas to obtain an enhanced query aerial image. , is represented as: , in, This indicates that the aerial images used to enhance the query are used as the query set input for the outer loop of the current training meta-task; Indicates the spatial location of scale-aligned aerial images. The RGB pixel values ​​at that location are scale-aligned queries for aerial images. In spatial location Elements at the location; Indicates the spatial location of candidate images for texture style The RGB pixel values ​​at that location are candidate images for texture style. In spatial location The element at that location.

[0096] 8) Perform size adjustment, color normalization, and light random perturbation on the support set samples to obtain the support set enhanced aerial images. , This indicates the model input image corresponding to the support set samples in the current training meta-task.

[0097] It should be noted that the support set samples do not undergo strong structure-preserving texture reconstruction to retain the stability of the class appearance of a small number of labeled samples; the query set samples undergo stronger cross-conditional augmentation to force the model to learn transferable structural and scale cues. The support set only undergoes size adjustment, color normalization, and light random perturbation to maintain its original appearance corresponding to the labels as much as possible, making the class prototype reliable; the query set, on the other hand, enforces scale alignment and texture reconstruction, which amplifies the difference between its appearance and that of the support set. This forces the meta-learning model to not rely on simple texture similarity for segmentation, but to use more stable scale priors and structural boundary information to establish class correspondences.

[0098] It should be noted that building outlines, road boundaries, and water shorelines usually correspond to semantic category boundaries. If strong texture transfer is applied directly to the entire image, it is easy to destroy the segmentation boundaries. The interior of road surfaces, rooftops, squares, and green areas are usually flat areas. Introducing external lighting and color styles into these areas will not significantly change the semantic category, but it can significantly amplify the appearance differences between support set samples and query set samples. This forces the meta-learning model to rely more on structural boundaries and scale priors, rather than on variable textures.

[0099] S4. Construction and Meta-learning Training of Scale-Aware Prototype Segmentation Network After processing S1 to S3, each training meta-task includes support set augmented aerial images, augmented query aerial images, semantic segmentation ground truth annotations, absolute scale prior maps, and structural boundary strength maps. The support set samples provide a small number of annotations, and the query set samples are used to evaluate the model's adaptation in the current training meta-task.

[0100] This invention employs a shared feature extraction backbone network to extract support set feature maps and query set feature maps. In the inner loop, it generates a scale-aware category prototype using support set annotations and absolute scale prior maps, and achieves rapid adaptation through minimal attention updates. In the outer loop, it updates the shared feature extraction backbone network and the structure-guided decoder using query set segmentation loss and boundary loss. The specific steps are as follows: S401, Construction of Shared Feature Extraction Backbone Network This step constructs a shared feature extraction backbone network that supports both the support set and the query set. This network takes enhanced aerial images as input and outputs spatial resolution reduced to the original. Figure 1 The feature map is 4 / 4, supporting the use of the set feature map to calculate the category prototype, and the query set feature map is used for similarity matching with the prototype, ensuring that the two types of features are in the same embedding space, such as Figure 7 As shown, the specific steps are as follows: 1) Construct a shared feature extraction backbone network , This indicates a feature extraction network used to simultaneously process both augmented aerial images and augmented query aerial images, belonging to the outer loop trainable metaparameter set. Part of; This represents the set of all trainable parameters that need to be updated in the outer loop of the meta-learning process.

[0101] In one implementation, the shared feature extraction backbone network uses MobileNetV3-Large as the backbone network, removes the last fully connected classification layer, and adjusts the spatial downsampling stride of the final stage to 1, so that the spatial resolution of the output feature map is 1 / 4 of the input image. Subsequently, a simplified dilated spatial pyramid pooling module is connected. This module contains three parallel 3×3 dilated convolutional branches with dilation rates of 1, 3, and 6, respectively. Each branch outputs 64 channels. The outputs of the three branches are concatenated along the channel dimension and then mapped to a 1×1 convolutional layer. 3D feature channels, where, This represents the feature channel dimension, for example, 256; the network has trainable parameters for the outer loop. Part of it.

[0102] 2) Will support the integration of enhanced aerial imagery Input shared feature extraction backbone network The support set feature map is obtained. Input supports enhanced aerial images The size is (e.g., 512×512×3), the support set feature map obtained after passing through the shared feature extraction backbone network. Size is (like ), This represents the set of feature maps corresponding to the support set samples in the current training meta-task. Each spatial location of this feature map corresponds to a 256-dimensional feature vector. The feature vectors belonging to the same category are aggregated into category prototypes through scale-aware weighting in step S402. For a single support set augmented aerial image, the size of the support set feature map is... , used to calculate category prototypes.

[0103] 3) Enhance the query of aerial images Input the same shared feature extraction backbone network , obtain the feature map of the query set , This represents the set of feature maps corresponding to the query set samples in the current training meta-task; for a single enhanced query aerial image, the size of the query set feature map is... It is used to calculate similarity with scale-aware category prototypes.

[0104] In one embodiment, for a feature vector of a spatial location in the feature map of the query set, the cosine similarity between it and the prototypes of "road" and "building" is calculated respectively. If the similarity with the prototype of "road" is 0.9 and the similarity with the prototype of "building" is 0.2, then it is determined that the location is highly likely to belong to the "road" category.

[0105] It should be noted that the support set enhanced aerial images and the enhanced query aerial images use the exact same shared feature extraction backbone network. Therefore, the support set feature map and the query set feature map are located in the same feature space, which facilitates subsequent category prototype matching.

[0106] S402, Scale-Aware Initial Category Prototype Calculation This step supports semantic segmentation ground truth annotation and downsampling of the absolute scale prior image to the support set feature map resolution. Using the query set average scale as a reference, scale-aware weights are assigned to each pixel in the support set. Weighted averages are then performed on the support set feature vectors belonging to the same semantic category to generate scale-aware initial category prototypes. This ensures that support set pixels with scales closer to the query set contribute more to the prototypes. Figure 8 As shown, the specific steps are as follows: 1) Downsample the support set semantic segmentation ground truth annotations to the spatial resolution of the support set feature map to obtain the downsampled support set annotations. , Indicates the size is It supports set category labeling; downsampling uses nearest neighbor interpolation to ensure that the category indexes are not mixed.

[0107] 2) Downsample the absolute scale prior map of the support set and the absolute scale prior map of the query set to the spatial resolution of the corresponding feature maps to obtain the downsampled absolute scale prior map of the support set. and the absolute scale prior graph of the downsampled query set Bilinear interpolation is used for downsampling of the absolute scale prior map to maintain the continuity of scale values.

[0108] 3) Calculate the average scale of the query set , This represents the average absolute scale prior value of the query set samples within the valid region during the current training meta-task, which is used as a reference benchmark for pixel scale weighting of the support set.

[0109] In the specific implementation, the absolute scale prior map of the downsampled query set samples is averaged over the non-filled regions to obtain... If a filled region exists, the filled region is not included in the average calculation.

[0110] 4) Calculate the scale-aware weight for each spatial location in the support set samples. ,in, This indicates the supported set sample index, with a value range of 1 to... ; Indicates the first Support set sample spatial location The weights of features at a given location are used to contribute to the support set pixels that are closer to the average scale of the query set during category prototype construction. The calculation method is as follows: , in, Indicates the first The absolute-scale prior map of the support set samples in spatial location The scale value at is the first Downsampled absolute scale prior map of support set samples In spatial location Elements at the location; This represents the scale sensitivity coefficient, used to adjust the strength of the influence of scale differences on the weights, for example, it is set to 2.0; This represents the scale weight stability constant, used to prevent the denominator from becoming unstable due to an excessively small average scale of the query set. For example, taking... .

[0111] In one embodiment, for example, if the average scale of the query set... The scale value for a given support set spatial location is 0.20 meters per pixel. The relative scale difference is The scale-aware weight is approximately If the scale value of another support set location is 0.165 meters per pixel, the relative scale difference is smaller, the scale-aware weight is closer to 1, and the location contributes more to the category prototype.

[0112] 5) For each semantic category Calculate the initial category prototype ,in, This represents a semantic category index, with values ​​ranging from 1 to... ; Indicates the first The initial class prototype, with dimensions of , used to characterize the The initial feature centers of the class in the current training meta-task support set.

[0113] In the specific implementation, it iterates through all support set samples and all spatial locations, and filters out those belonging to the first position in the downsampled support set annotation. The position of the class is determined by summing the support set feature vectors at these positions according to scale-aware weights, and then dividing by the sum of the corresponding weights to obtain the first position. The initial class prototype is represented as: , in, Indicates the first The spatial location of the support set samples The support set feature vector at point has a dimension of . ; This indicates an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise. This represents the stability constant calculated from the prototype, used to prevent the denominator from being zero when a certain category does not exist in the support set. For example, taking... .

[0114] It should be noted that if a semantic category does not exist in the current support set of samples, then the semantic category will not participate in the prototype update of the current training meta-task; alternatively, the global category prototype maintained during the training phase can be used as a backup prototype for the semantic category, thereby avoiding numerical instability caused by missing categories.

[0115] S403, Rapid Adaptation of Inner Loop Attention Prototype This step starts with a scale-aware initial category prototype. Within the effectively labeled region of the support set, attention weights are obtained by calculating the dot product similarity between the category prototype and the feature vectors of the support set. Then, the attention weights are used to perform a weighted summation of the feature vectors of the support set, iteratively updating the category prototype with a small stride. After T inner loop iterations, a scale-aware category prototype that contains both scale prior information and adapts to the feature distribution of the support set for the current task is obtained. The specific steps are as follows: 1) Initial category prototype As the prototype of the 0th step category , Indicates the beginning of the inner loop. Class prototype. Let the number of iterations in the inner loop be... , This represents the number of class prototype updates in each training meta-task, for example, 3 to 5; Step category prototype denoted as , This represents the index of the inner loop iteration step, with a value ranging from 0 to... .Finish After the second iteration, the scale-aware category prototype is obtained. ,in, Indicates the first step after adapting to the current training meta-task. Class prototype.

[0116] In the specific implementation, the inner loop iterations from Begin with scale-aware initial category prototypes As the prototype of the 0th step category Each iteration In the middle, using the current prototype Attention weights are calculated using the support set features, and then the category prototypes are updated using a weighted summation method to obtain... This process is repeated. Next, complete the first After several iterations, the final scale-aware category prototype is obtained. .

[0117] 2) in the In the inner loop of the step, select the support set labels belonging to the first... All spatial locations of the class form the first Class valid position set ,in, This indicates that the current training meta-task is supported by the first set of annotations. A collection of spatial locations for a class.

[0118] Furthermore, calculate the category prototype. and The dot product similarity between the feature vectors of each support set is calculated and divided by . Scaling, then Perform Softmax normalization within the range to obtain the attention weights. , Indicates the first Step inner loop Support set sample spatial location For the Attention weights for class prototype updates; Representing feature channel dimension The square root of the value is used to stabilize the range of the dot product. A larger attention weight indicates a closer match between the support set feature vector and the current class prototype, resulting in a greater contribution to subsequent prototype updates.

[0119] In one embodiment, as an example, suppose that a support set sample contains categories. The feature vectors of the three valid pixels (of the road) are compared with the current prototype. dot product similarity After scaling to 2.1, 1.8, and 0.3 respectively, the attention weights after Softmax normalization are approximately 0.71, 0.26, and 0.03, respectively, meaning that the pixel most similar to the prototype contributes the most.

[0120] 3) Update the number of attention weights. Class prototype.

[0121] During the update, first... The support set feature vectors in the dataset are summed using attention-weighted summation to obtain the current i-th... The class's attention feature center; then the inner loop learning rate. By controlling the magnitude of the movement of the category prototype towards the attention feature center, we obtain the next category prototype. , is represented as: , in, This represents the learning rate of the inner loop, used to control the update magnitude of the category prototype at each step; for example, it is initialized to 0.2. It can be used as a trainable meta-parameter in the outer loop, or it can be set as a fixed hyperparameter. If Larger categories are more likely to be identified by features in the current support set; if... It is smaller, the category prototype updates are more stable, and it is suitable for scenarios with high support set annotation noise.

[0122] 4) Repeat the attention weight calculation and category prototype update for all semantic categories until completion. The inner loop iterations yield scale-aware category prototypes for all semantic categories. .

[0123] It should be noted that the scale-aware initial category prototype addresses the question of "which support set pixels are closer to the query set in terms of physical scale", while the attention prototype fast adaptation addresses the question of "which support set features are more stable and reliable in the discriminative space". When the two are combined, the category prototype is both constrained by the flight scale prior and can be quickly adjusted according to the support set features of the current training meta-task, thus making it suitable for small sample cross-flight condition segmentation.

[0124] S404, Structure-Guided Decoding and Query Set Semantic Segmentation Prediction This step calculates the cosine similarity between the query feature vector at each spatial location in the query set feature map and the scale-aware prototype of each semantic category, generating a category prior response map. Then, this response map is concatenated with the query set feature map and the downsampled structural boundary strength map, and input into the structure-guided decoder. Simultaneously, it outputs a semantic segmentation prediction map and a prediction boundary map, utilizing the structural boundary prior to improve boundary segmentation accuracy. Figure 9 As shown, the specific steps are as follows: 1) Feature map of query set Each spatial location in Calculate the scale-aware category prototype corresponding to each semantic category. The cosine similarity between them yields the category prior response map. , This represents the category prior response graph of the query set samples, with a size of [size missing]. ; Indicates spatial location Belongs to the Prototype similarity score of classes, category prior response map In spatial location First The elements of each channel are represented as: , in, Indicates the spatial location of the query set feature map. The query feature vector at a given location is the query set feature map. In spatial location The vector at that location; This indicates the transpose of the query feature vector; Represents the L2 norm of a vector; This represents the cosine similarity stability constant, used to prevent the denominator from being zero. For example, taking... .

[0125] 2) Obtain the structural boundary strength map corresponding to the query set samples. downsampling to Obtain the boundary strength map of the downsampled structure. , The soft hints representing structural boundaries with the same spatial resolution as the query set feature map have a size of [size missing]. Downsampling uses bilinear interpolation and maintains the numerical range of 0 to 1.

[0126] In practical implementation, structural boundary strength diagram This is the structural boundary strength map obtained by processing the query set samples in step S203. In step 5 of S203, the maximum structural response map of the query set samples is normalized by performing minimum-maximum normalization to generate this map. When entering step 2 of S404, the generated structural boundary strength map is read directly. The sampled data is then downsampled to the feature map resolution to obtain the downsampled structural boundary intensity map. .

[0127] 3) Query set feature map Category Prior Response Diagram and downsampled structural boundary strength map By concatenating along the channel dimension, the input features of the decoder are obtained. , The input features of the structure-guided decoder are represented by the size of . .

[0128] 4) Input features to the decoder Input structure guides decoder The semantic segmentation prediction graph of the query set is obtained. and predicted boundary map .

[0129] in, This indicates a structure-guided decoder, belonging to the outer loop trainable metaparameter set. Part of; This represents the semantic segmentation prediction graph for the query set, with a size of [size missing]. Each channel represents the probability of the corresponding semantic category; Represents the predicted boundary map, with a size of It is used to assist in constraining the boundary division.

[0130] In one implementation, the structure-guided decoder It includes 3 convolutional blocks and 2 output heads. The first convolutional block uses... The convolution maps the input channels to 128 dimensions, followed by group normalization and the ReLU activation function; the second convolutional block uses... The convolution maintains a 128-dimensional output, followed by group normalization and ReLU activation; the third convolutional block uses... The convolution outputs 64-dimensional features. The segmentation output head uses... Convolution maps 64-dimensional features to Each channel is then upsampled using bilinear interpolation. Finally, the semantic segmentation prediction map of the query set is obtained through the Softmax function. The boundary output header uses... Convolution maps 64-dimensional features to one channel, and then the Sigmoid function is used to obtain the predicted boundary map.

[0131] It should be noted that the structural boundary strength map is not a segmentation result, but a soft cue for structural boundaries. By inputting the structural boundary strength map together with the query set feature map and the category prior response map into the structure-guided decoder, the decoder can pay more attention to category changes at locations such as road boundaries, building outlines, and water shorelines, thereby reducing missegmentation across texture regions and boundary blurring problems.

[0132] S405. Calculation of Outer Cyclic Loss and Update of Meta-parameters This step calculates a weighted sum of pixel-level cross-entropy loss and boundary loss based on the semantic segmentation prediction results and ground truth annotations of the current training meta-task, forming the total loss of the outer loop. This total loss is then used for backpropagation to update the set of all trainable meta-parameters in the outer loop, including the shared feature extraction backbone network and the structure-guided decoder. The specific steps are as follows: 1) Calculate pixel-level cross-entropy loss based on the semantic segmentation truth labels of the query set. , This represents the pixel-level category difference between the query set semantic segmentation prediction graph and the query set semantic segmentation ground truth annotation, and is used to train the main segmentation capability of the model.

[0133] In practical implementation, if the training data has class imbalance, higher class weights can be set for smaller categories such as roads and water bodies to avoid the model being overly biased towards the background and large building areas.

[0134] 2) Generate a boundary truth map based on the semantic segmentation truth annotations of the query set. , It represents the true semantic boundary of the query set sample.

[0135] In the specific implementation, for each pixel in the semantic segmentation truth label of the query set, its 4 neighboring pixels are checked; if the category index of any neighboring pixel is different from that of the current pixel, then the current pixel is marked as a boundary pixel. Otherwise, mark it as a non-boundary pixel. To increase boundary tolerance, a dilation operation can be performed on the boundary truth map, with the dilation kernel size set to [value missing]. .

[0136] 3) Based on the predicted boundary map and boundary truth map Calculate boundary loss , This represents the difference between the predicted boundary and the true semantic boundary. In one implementation, the boundary loss uses a binary cross-entropy loss. Since the number of boundary pixels is usually less than that of non-boundary pixels, boundary pixels can be given higher weights, for example, setting the weight of boundary pixels to 3 and the weight of non-boundary pixels to 1.

[0137] In one embodiment, as an example, suppose a certain pixel is a boundary pixel, and the boundary ground truth is... Predicting boundary values If the boundary pixel weight is set to 3, then the binary cross-entropy loss of that pixel is... If the pixel is not on the boundary, the ground truth value is 0, the prediction value is 0.2, the non-boundary weight is 1, and the loss is... .

[0138] 4) Weight the pixel-level cross-entropy loss and boundary loss to obtain the total loss of the outer loop. , is represented as: , in, This represents the total loss of the outer loop of the current training meta-task; This represents the boundary loss weight, used to adjust the strength of the boundary supervision during training, for example, taking values ​​from 0.2 to 0.5.

[0139] 5) Based on the total loss of the outer loop Update the set of trainable metaparameters in the outer loop. The set of trainable metaparameters for the outer loop. Including a shared feature extraction backbone network Parameters and structure guide decoder The parameters and the trainable inner recurrent learning rate In one implementation, the Adam optimizer is used to update parameters, with an initial learning rate of... Weight decay The number of training rounds is 50 to 200, and each training batch contains 4 to 8 training meta-tasks.

[0140] 6) Repeatedly perform cross-flight condition training meta-task sampling, query set scale alignment, structure boundary protection texture reconstruction, scale-aware prototype adaptation, structure-guided decoding, and outer loop parameter update until the validation set average intersection-union ratio no longer improves or reaches the preset number of training rounds.

[0141] After training, save the optimal set of meta-parameters corresponding to the highest average intersection-union ratio (IU / UCR) of the validation set. ,in, This represents the set of fixed model parameters used for fast segmentation of new flight scenarios after meta-learning training.

[0142] It should be noted that the scale-aware prototype segmentation network consists of three parts: a shared feature extraction backbone network, a scale-aware prototype computation and inner recurrent attention fast adaptation module, and a structure-guided decoder. The shared feature extraction backbone network maps the support set and query set images to the same feature space; the scale-aware prototype computation uses support set annotations and absolute scale priors to generate initial category prototypes, which are then quickly adapted in a few iterations by the inner recurrent attention mechanism; the structure-guided decoder fuses query set features, category prior responses, and structural boundary strength maps to output semantic segmentation prediction maps and prediction boundary maps, and the parameters are optimized overall through an outer recurrent meta-learning loss.

[0143] S5, Small Sample Semantic Segmentation for New Flight Scenarios After meta-learning training is completed, this invention can be used for small-sample semantic segmentation tasks in new flight altitudes, new camera poses, or new urban areas. In new flight scenarios, only a small number of labeled support set samples and a few query set samples to be predicted are needed; it does not require retraining all network parameters. Figure 10 As shown, the specific steps are as follows: 1) Collect support set aerial images, support set semantic segmentation ground truth labels, and query set aerial images from the new flight scenario, and read the corresponding flight metadata. The number of support set samples can be 1 to 5, and the query set samples are the aerial images of the semantic segmentation results to be predicted.

[0144] 2) Perform ground sampling distance estimation, absolute scale prior map generation and structural response tensor extraction in steps S201 to S203 on the support set samples and query set samples of the new flight scenario to obtain the absolute scale prior map and structural boundary strength map of the new flight scenario.

[0145] 3) Using the ground sampling distance of the new flight scene support set samples as a reference, perform scale alignment processing in S302 on the new flight scene query set samples to obtain the new flight scene scale-aligned query aerial image; in the meta-test stage, strong texture reconstruction enhancement can be omitted, and only color normalization and size adjustment can be performed to keep the content of the image to be predicted true and stable.

[0146] 4) Input the enhanced aerial images and query aerial images for the new flight scene support set into the optimal set of meta-parameters. Determined shared feature extraction backbone network The new flight scenario support set feature map and the new flight scenario query set feature map are obtained respectively; this step does not update the parameters of the shared feature extraction backbone network.

[0147] 5) Based on the semantic segmentation ground truth annotations of the new flight scenario support set, the absolute scale prior map of the new flight scenario support set, and the average scale of the new flight scenario query set, perform the scale-aware initial category prototype calculation and rapid adaptation of the inner loop attention prototype in S402 and S403 to obtain the scale-aware category prototype of the new flight scenario; this process only updates the category prototype within the current task and does not update the optimal meta-parameter set. .

[0148] 6) Calculate the category prior response map based on the feature map of the new flight scene query set and the scale-aware category prototype of the new flight scene; downsample the structure boundary intensity map of the new flight scene and concatenate it with the category prior response map and the feature map of the new flight scene query set, and input it with the optimal meta-parameter set. Determined structure guides decoder Output the semantic segmentation prediction graph of the new flight scenario query set.

[0149] 7) Organize the semantic segmentation prediction graph of the new flight scene query set. In the specific implementation, the semantic category with the highest predicted probability is taken as the final category for each pixel; for isolated connected regions with an area smaller than a preset threshold, smoothing correction can be performed based on the majority category of the neighborhood, and the preset threshold is, for example, 20 to 50 pixels; for regions with low confidence near the boundary, category transitions at higher positions of the structural boundary strength map can be retained to avoid excessive smoothing that would flatten the edges of roads or buildings.

[0150] Through the above process, this invention can segment urban semantic categories such as roads, buildings, green spaces, water bodies, and backgrounds without retraining the complete segmentation network in new flight scenarios. It can achieve rapid adaptation of category prototypes using only a small number of support set annotations.

[0151] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for semantic segmentation of drone scenes in a few samples based on meta-learning, characterized in that, Includes the following steps: S1. Collect drone aerial photography samples of urban scenes and construct basic data for the meta-task, including aerial photography input images, pixel-level category annotations corresponding to the aerial photography input images, and flight metadata. S2. Utilize flight metadata to estimate ground sampling distance, combine monocular relative depth cues from aerial input images to generate an absolute scale prior map, and extract the structural response tensor by combining color gradient and absolute scale prior map gradient to obtain a structural boundary intensity map and generate a binarized edge mask. S3. Form flight condition clusters based on flight metadata. When constructing training meta-tasks, force support set samples and query set samples to come from different flight condition clusters. Perform scale alignment and structural boundary protection texture reconstruction on query set samples to obtain support set enhanced aerial images and enhanced query aerial images. S4. Construct a scale-aware prototype segmentation network. Use a shared feature extraction backbone network to extract support set feature maps and query set feature maps. In the inner loop, use support set annotations and absolute scale prior maps to generate scale-aware category prototypes. The query feature vector at each spatial location in the query set feature map is calculated to have a cosine similarity to the scale-aware prototype of each semantic category. This generates a category prior response map, which is then concatenated with the query set feature map and the downsampled structure boundary strength map. This concatenation is input into the structure-guided decoder, which outputs a semantic segmentation prediction map and a prediction boundary map. In the outer loop, the shared feature extraction backbone network and the structure-guided decoder are updated using the query set segmentation loss and boundary loss.

2. The method for semantic segmentation of UAV few-sample scenes based on meta-learning according to claim 1, characterized in that, Step S1 specifically includes: Collect aerial images of urban areas; the aerial images are denoted as [image name]. , Indicates the first RGB images of urban areas captured by a drone; semantic segmentation ground truth labels are generated for each aerial input image, denoted as . , Indicates the first Pixel-level category labeling for each aerial input image; synchronously saving flight metadata for each aerial input image, including flight altitude. Camera tilt angle Camera field of view Shooting time and camera imaging width Spatial size adjustment is performed on the aerial input image and semantic segmentation ground truth annotation to obtain training image blocks and training annotation blocks of consistent size; training samples, validation samples and test samples are divided according to flight area, flight time and flight conditions.

3. The method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, In step S2, the ground sampling distance is estimated using flight metadata: Read aerial input images Corresponding flight altitude Camera tilt angle Camera field of view and camera imaging width The ground sampling distance is calculated based on the flight altitude, camera field of view, camera tilt angle, and camera imaging width. Outlier limits are imposed on ground sampling distance.

4. The method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, In step S2, generating the absolute scale prior map specifically includes: Input aerial photography images Input a lightweight monocular relative depth estimation network to obtain a relative depth map. ; In relative depth map Select the central area , Represents the set of spatial locations of the central region of the aerial input image; the relative depth map Normalize by the median of the central region, then multiply the normalized result by the ground sampling distance. To obtain the absolute scale prior map ; For absolute scale prior diagrams Smoothing and truncation processes are performed to obtain a stable absolute scale prior map.

5. The method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, In step S2, extracting the structural response tensor specifically includes: Preset Discrete directions Indicates the number of directions, for each discrete direction. Constructing the directional gradient operator ; Aerial input images Calculate the first RGB three color channels respectively The directional gradients in each discrete direction are calculated, and the L2 norm of the directional gradients for the three color channels is taken to obtain the color directional gradient intensity. For absolute scale prior diagrams Calculate the first The absolute value of the directional gradient in each discrete direction yields the scale directional gradient intensity. ; Multiplying the color direction gradient intensity and the scale boundary enhancement factor, we obtain the first... Structural response results in discrete directions ; Structural response tensor along discrete directional dimensions Take the maximum value to obtain the maximum structural response diagram. Perform minimum-maximum normalization on the maximum structural response map to obtain the structural boundary strength map. According to the structural boundary strength diagram Generate a binarized edge mask .

6. The method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, In step S3, a flight condition vector is constructed based on the flight altitude, camera tilt angle, ground sampling distance, and shooting time of each aerial input image. The training samples are then divided into multiple flight condition clusters using K-means clustering. When constructing the training meta-task, it is forced that the support set samples and query set samples come from different flight condition clusters. Construct a flight condition vector for each aerial input image. , Indicates the first The flight condition description vector corresponding to the aerial input image; flight condition vector Including flight altitude Camera tilt angle Ground sampling distance The sine and cosine values ​​of the shooting time; For flight condition vectors Each dimension in the vector is standardized to obtain a standardized flight condition vector. Perform K-means clustering on the flight condition vectors corresponding to all training samples to obtain A cluster of flight conditions; When constructing the training meta-task, from Two different flight condition clusters are randomly selected from each flight condition cluster. One flight condition cluster provides the support set sample, and the other provides the query set sample. Samples are extracted from the flight condition clusters corresponding to the support set. Annotated aerial images are used as support set samples, and samples are extracted from the corresponding flight condition clusters in the query set. The aerial images with labeled borders are used as samples for the query set.

7. The method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, In step S3, scale alignment is performed on the query set samples, and the reference ground sampling distance of the current training meta-task support set samples is calculated. , This represents the average ground sampling distance of the support set samples; for each query set sample, the query set ground sampling distance is read. ; Calculate the scaling ratio , for scale ratio By imposing range restrictions, a stable scaling ratio can be obtained; Bilinear resampling is performed on the query set samples based on the stable scale scaling ratio to obtain scale-aligned query aerial images. ; Perform synchronous spatial transformation on the semantic segmentation truth labels, absolute scale prior maps, structural boundary strength maps, and binarized edge masks corresponding to the query set samples.

8. The UAV few-shot scene semantic segmentation method based on meta-learning according to claim 1, characterized in that, In step S3, the structural boundary protection texture reconstruction enhancement specifically includes: Select reference-style aerial images from the training sample database. ; Scale-aligned aerial images and reference style aerial images The color space is converted from RGB to Lab to obtain a scale-aligned query Lab image and a reference style Lab image. Flat regions are determined using a binarized edge mask, and channel-level statistical matching is performed on the scale-aligned query Lab image within these flat regions to obtain a style-matched Lab image. The style-matched Lab image is then converted back to RGB color space to obtain a texture style candidate image. The texture style candidate images are blended with the query aerial images according to their proportions and scale, and the blending intensity is denoted as . ;Select texture style candidate images Query aerial images with scale alignment According to mixing strength Weighted blending is performed to generate candidate images for the query set with reference style incorporated; Gaussian smoothing is applied to the binarized edge mask to obtain a soft edge protection mask. ; An enhanced query aerial image is obtained by using a soft-edge protection mask to preserve the structural edges in the scale-aligned query aerial image and applying texture-style candidate images only in flat areas. The support set samples are resized, color normalized, and subjected to lightweight random perturbations to obtain support set-enhanced aerial images. .

9. The method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, Step S4 specifically includes: Constructing a shared feature extraction backbone network The shared feature extraction backbone network uses MobileNetV3-Large as its backbone network; it will support the integration of enhanced aerial images. Input shared feature extraction backbone network The support set feature map is obtained. This will enhance the ability to query aerial images. Input the same shared feature extraction backbone network , obtain the feature map of the query set ; Computational scale-aware initial category prototype: Downsample the support set semantic segmentation ground truth annotations to the spatial resolution of the support set feature map to obtain the downsampled support set annotations. The absolute-scale prior graphs of the support set and the query set are downsampled to obtain the downsampled absolute-scale prior graph of the support set. and the absolute scale prior graph of the downsampled query set The average scale of the query set is obtained by averaging the absolute scale prior map of the downsampled query set samples over the non-filled regions. ; Calculate the scale-aware weight for each spatial location in the support set samples. For each semantic category Calculate the initial category prototype ; Computational scale-aware category prototype: inner loop iteration from Begin with scale-aware initial category prototypes As the prototype of the 0th step category Each iteration In the middle, using the current prototype Attention weights are calculated using the support set features, and then the category prototypes are updated using a weighted summation method to obtain... This process is repeated. Next, complete the first After several iterations, the final scale-aware category prototype is obtained. .

10. A method for semantic segmentation of UAV few-shot scenes based on meta-learning according to claim 1, characterized in that, The structure-guided decoder described in step S4 includes three convolutional blocks and two output heads; each of the three convolutional blocks includes... Convolutional layer, group normalization, and ReLU activation function; two output heads: a segmentation output head and a boundary output head; the segmentation output head includes... Convolutional layers, bilinear interpolation upsampling, and a softmax function are used to generate the query set semantic segmentation prediction map; the boundary output header employs... Convolutional layers and the sigmoid function are used to generate the predicted boundary map.