Image edge detection method, system, device and medium based on multi-scale adaptive weight fusion

CN122780331APending Publication Date: 2026-09-18SHANGHAI TECHN INST OF ELECTRONICS & INFORMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610981536.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

但常规可变形卷积的偏移量仅依赖于局部特征,缺乏对全局场景信息的感知

Benefits of technology

(1)本发明采用基于可变形卷积神经网络与金字塔注意力池化模块的级联结构,可变形卷积神经网络的自适应感受野能更好地覆盖因视角变形而拉长或压缩的目标,并在特征融合时实现更好的跨尺度对齐,从而提升小目标和形变目标的检测精度,在可变性卷积神经网络引入场景特征向量对偏移量进行调节,使偏移模式与场景先验对齐,能根据场景自动切换几何适应策略,可有效增强几何建模的场景适应性,且通过场景先验约束偏移量,可抑制噪声引起的异常偏移,使采样点更稳定地沿边缘分布,进而结合基于图神经网络与元学习框架的自适应权重分配策略进行多尺度融合,能够在保证边缘检测精度的同时,提高了处理效率以及鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122780331A_ABST
    Figure CN122780331A_ABST
Patent Text Reader

Abstract

This invention relates to an image edge detection method, system, device, and medium based on multi-scale adaptive weight fusion, comprising: inputting an initial image into a multi-scale feature extraction module to obtain feature maps at different scales; the multi-scale feature extraction module is a cascaded structure based on a deformable convolutional neural network and a pyramid attention pooling module, wherein the deformable convolutional neural network introduces scene feature vectors for dynamic offset adjustment; treating the feature maps at different scales as graph nodes, and modeling the spatial dependencies between nodes through the message passing mechanism of the graph neural network to generate fusion weights, wherein a meta-learning mechanism is used to adaptively train the graph neural network according to the scene features of the initial image; fusing the feature maps at different scales using the fusion weights to obtain a fused feature map; and performing edge detection on the fused feature map to obtain image edge information. Compared with the prior art, this invention has the advantages of high edge detection accuracy and high robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and in particular to an image edge detection method, system, device, and medium based on multi-scale adaptive weight fusion. Background Technology

[0002] Image edge detection is a fundamental task in computer vision, aiming to accurately extract object contours and structural edges from input images. Its detection quality directly impacts the performance of high-level visual tasks such as autonomous driving, drone inspection, security monitoring, industrial defect detection, and forest tree species identification. Real-world images often contain multi-scale objects and structures: fine edges, such as textures and small object contours, rely on high-resolution detail features, while large structures, such as buildings and mountain outlines, require semantic features with a large receptive field. Therefore, effectively extracting and fusing multi-scale features is a key issue in improving the robustness and accuracy of edge detection.

[0003] In existing technologies, multi-scale feature extraction often employs feature pyramid networks, which aggregate feature maps of different resolutions through top-down paths and lateral connections. However, traditional feature pyramid networks use fixed fusion weights for feature maps at each scale, failing to dynamically adjust the contribution of each scale based on image content. For example, in dense, small-object scenes, such as drone aerial photography of crowds, orchard fruits, or forest tree species identification, high-resolution detail features should have higher weights; while in large-scale structural scenes, such as building facades, mountain outlines, or images of fish otoliths, low-resolution semantic features are more important. Fixed-weight fusion strategies are ill-suited to the complex and ever-changing real-world environment.

[0004] To enhance the geometric adaptability of feature extraction, deformable convolution has been introduced into edge detection networks, which learns offsets to ensure that the sampling position fits the actual shape of the target. However, the offsets of conventional deformable convolutions rely only on local features and lack awareness of global scene information. For example, edges in urban buildings are mostly straight lines, while edges in forest scenes or images of fish otoliths are mostly curved, making it difficult for the same offset learning strategy to simultaneously address both.

[0005] In addition, existing edge detection methods treat all pixels and all scales the same, ignoring the geometric constraints of sparse edge pixels, large scale differences, and edge continuity, which easily leads to problems such as edge breakage and noise response in the detection results.

[0006] In summary, there is an urgent need for an image edge detection method that can effectively improve the accuracy and robustness of edge detection in complex and variable scenarios. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the existing technology and provide an image edge detection method, system, device and medium based on multi-scale adaptive weight fusion.

[0008] The objective of this invention can be achieved through the following technical solutions: According to a first aspect of the present invention, an image edge detection method based on multi-scale adaptive weight fusion is provided, comprising: The initial image is input into the multi-scale feature extraction module to obtain feature maps at different scales; wherein, the multi-scale feature extraction module is a cascaded structure based on a deformable convolutional neural network and a pyramid attention pooling module, and the scene feature vector is introduced into the deformable convolutional neural network for dynamic adjustment of offset; Feature maps at different scales are treated as graph nodes. Spatial dependencies between nodes are modeled and fusion weights are generated through the message passing mechanism of graph neural networks. Meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image. The feature maps of different scales are fused using fusion weights to obtain the fused feature map; Edge detection is performed on the fused feature map to obtain image edge information.

[0009] Preferably, the deformable convolutional neural network incorporates scene feature vectors for dynamic offset adjustment, and the output expression is: , , , In the formula: This is a deformable convolution operation; The base offset learned from the input feature map by standard deformable convolution; The offset prototype corresponding to the k-th sampling position is obtained by encoding based on the edge set type; K is the total number of sampling positions. This refers to the scene adjustment factor associated with the scene feature vector z; For activation functions; These are the learning parameters.

[0010] Preferably, the scene feature vector z is obtained through a lightweight convolutional neural network.

[0011] Preferably, the step of using a meta-learning mechanism to adaptively train the graph neural network based on the scene features of the initial image specifically includes: A meta-learning task distribution is constructed, with each task corresponding to an image scene type. Each task includes a support set and a query set, both of which consist of an image and its corresponding ground truth edge detection values. During the meta-training phase, for each task, the support set is input into the graph neural network, initial weights are output, edge detection loss is calculated using the support set, and the parameters of the graph neural network are updated through gradient descent to obtain task-specific graph neural network parameters. The weights are recalculated on the query set using the task-specific graph neural network parameters, and the edge detection loss on the query set is calculated. The graph neural network parameters are updated by outer loop gradient descent, and the updated graph neural network parameters are used for the inner loop initialization of the next round of meta-training task. The edge detection loss includes scale-weighted edge loss.

[0012] Preferably, the edge detection loss includes a scene-aware edge loss, which introduces a scene-adjusted focusing parameter with respect to the scene feature vector. As an exponential term, the scene adjustment focus parameter Represented as: , These are the initial values ​​for the focusing parameters; , These are learnable parameters; This is the activation function.

[0013] Preferably, the edge detection loss includes an edge continuity loss, used to constrain the alignment of predicted edges along the image gradient normal direction, and to protect weak edges using continuity confidence. The calculation expression is as follows: , In the formula: For predicting the set of edge pixels; For the image at the edge points The gradient; The direction of the edge normal; For the image at the edge points The confidence level of edge continuity; This is an adjustable coefficient used to control the influence intensity of the edge continuity confidence level.

[0014] Preferably, the fused feature map is input into an edge detection module based on a Transformer encoder-decoder architecture to obtain image edge information, specifically including: The fused feature map is input into the Transformer encoder to model pixel-level long-range dependencies through a self-attention mechanism, generating an edge probability map. The edge probability map is mapped to the initial image space using the Transformer decoder, and coarse-grained edges are output. A non-maximum suppression algorithm is used to filter redundant edge points based on the edge direction consistency criterion, while preserving the edge structure and obtaining image edge information.

[0015] According to a second aspect of the present invention, a multi-scale adaptive weight fusion image edge detection system is provided, employing the above-described method, comprising: The multi-scale feature extraction module is used to extract features from the input image to be detected at multiple scales, and obtain feature maps at different scales. The fusion weight generation module treats feature maps at different scales as graph nodes and generates fusion weights by modeling the spatial dependencies between nodes through the message passing mechanism of the graph neural network. In this module, a meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image. The fusion module is used to fuse feature maps of different scales using fusion weights to obtain a fused feature map. The edge detection module is used to perform edge detection on the fused feature map to obtain image edge information.

[0016] According to a third aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement any of the methods described above.

[0017] According to a fourth aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the methods described herein.

[0018] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention adopts a cascaded structure based on deformable convolutional neural network and pyramid attention pooling module. The adaptive receptive field of deformable convolutional neural network can better cover targets that are stretched or compressed due to viewpoint deformation, and achieve better cross-scale alignment during feature fusion, thereby improving the detection accuracy of small targets and deformable targets. The scene feature vector is introduced into the deformable convolutional neural network to adjust the offset, so that the offset mode is aligned with the scene prior. It can automatically switch the geometric adaptation strategy according to the scene, which can effectively enhance the scene adaptability of geometric modeling. Furthermore, by constraining the offset through scene prior, abnormal offset caused by noise can be suppressed, making the sampling points more stably distributed along the edge. Then, combined with the adaptive weight allocation strategy based on graph neural network and meta-learning framework, multi-scale fusion can be performed, which can improve processing efficiency and robustness while ensuring edge detection accuracy.

[0019] (2) In the adaptive weight allocation strategy based on graph neural network and meta-learning framework of the present invention, the dependency relationship between multi-scale features is explicitly modeled by graph neural network, so that the initial weight allocation contains structural coordination information and avoids isolated allocation. At the same time, the meta-learning framework is introduced to treat each scene as an independent task. The inner loop is used to quickly adapt to a small number of support samples and the outer loop optimizes the weight generation parameters, so that the model can obtain meta-knowledge to quickly adjust the weight according to the scene. Thus, under the premise of ensuring computational efficiency, the structural perception initialization, cross-scene rapid generalization, process interpretability and real-time balance of weight allocation are achieved. It is especially suitable for visual systems such as UAVs that need to cope with complex and ever-changing environments.

[0020] (3) Scene-aware edge loss introduces scene-adjusted focus parameters, enabling the model to dynamically adjust the attention to difficult and easy samples according to the image scene features. In difficult scenes such as low contrast and weak edges, it automatically enhances the ability to mine difficult edge pixels, and avoids over-enhancing easy samples in high contrast and clear structure scenes. This significantly improves the accuracy of edge detection and cross-scene generalization ability, while alleviating the problem that the fixed parameters of traditional focus loss cannot adapt to scene changes.

[0021] (4) Introducing edge continuity loss, the predicted edges are aligned along the image gradient normal direction by explicit constraint, and weak edges are protected by continuity confidence, which forces the network to learn continuous edges that conform to geometric priors, significantly reducing edge breakage and burr phenomena. At the same time, gradient consistency is used to effectively suppress false edge responses in texture noise areas, enhance the weak edge perception ability in low contrast areas, and make the edge detection results more complete, smooth and in line with human visual cognition. Attached Figure Description

[0022] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the system architecture in the embodiment. Detailed Implementation

[0023] 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, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0024] Example like Figure 1 As shown, this embodiment provides an image edge detection method based on multi-scale adaptive weight fusion, including: S1. Input the initial image into the multi-scale feature extraction module to obtain feature maps at different scales; wherein, the multi-scale feature extraction module is a cascaded structure based on a deformable convolutional neural network and a pyramid attention pooling module, and scene feature vectors are introduced into the deformable convolutional neural network for dynamic adjustment of offset; S2. The feature maps at different scales are regarded as graph nodes. The spatial dependency between nodes is modeled through the message passing mechanism of the graph neural network to generate fusion weights. The meta-learning mechanism is used to adaptively train the graph neural network according to the scene features of the initial image. S3. Use fusion weights to fuse feature maps of different scales to obtain fused feature maps; S4. Perform edge detection on the fused feature map to obtain image edge information.

[0025] The method of this embodiment will now be described in detail.

[0026] S1. Input the initial image into the multi-scale feature extraction module to obtain feature maps at different scales. The multi-scale feature extraction module is a cascaded structure based on a deformable convolutional neural network and a pyramid attention pooling module. The scene feature vector is introduced into the deformable convolutional neural network for dynamic adjustment of the offset.

[0027] Before performing multi-scale feature extraction, the initial image is preprocessed, such as normalization and noise reduction.

[0028] In this embodiment, the multi-scale feature extraction module employs a cascaded structure of a deformable convolutional neural network (DCNN) and a pyramid attention pooling (PAP) to extract features from the input image to be detected at multiple scales, obtaining feature maps at different scales. This addresses the sensitivity of traditional CNNs to geometric deformation. The pyramid structure downsamples the original image at different ratios to obtain multiple images at different scales, and then extracts features from these images separately to obtain feature maps at different scales. The Feature Pyramid Network (FPN) introduces lateral connections and upsampling operations into the CNN to fuse deep and shallow features, resulting in multiple feature maps at different scales. These feature maps contain information about the image at different scales, providing rich feature representations for subsequent adaptive weight fusion. The deformable convolutional neural network (DCNN) dynamically adjusts the shape of the convolutional kernel by learning spatial offsets to capture geometric deformation edge information in the image to be detected.

[0029] The multi-scale feature extraction process is as follows: (1) Deformable convolutional neural network (backbone network).

[0030] In this embodiment, a deformable convolutional neural network ResNet-50 is used as the backbone network, and some standard 3×3 convolutions are replaced with deformable convolutions, outputting features {C2, C3, C4, C5}, with the specific settings as follows: Multiple residual stages, namely conv2_x, conv3_x, conv4_x, and conv5_x, where: conv2_x contains 3 standard bottleneck blocks, outputs C2 features, has a resolution of 1 / 4 of the input image, and has 256 channels; conv3_x contains 4 bottleneck blocks, in which at least one 3×3 convolutional layer in the bottleneck block is replaced with a deformable convolutional layer, outputting feature C3 with a resolution of 1 / 8 of the input image and 512 channels; conv4_x contains 6 bottleneck blocks, in which at least one 3×3 convolutional layer in the bottleneck block is replaced with a deformable convolutional layer, outputting feature C4 with a resolution of 1 / 16 of the input image and 1024 channels; conv5_x contains 3 bottleneck blocks, in which at least one 3×3 convolutional layer in the bottleneck block is replaced with a deformable convolutional layer, outputting feature C5 with a resolution of 1 / 32 of the input image and 2048 channels.

[0031] (2) Feature pyramid network.

[0032] The feature pyramid network uses a top-down path and lateral connections, with the specific parameter settings as follows: C5 is convolved by 1×1 to obtain M5, and M5 is convolved by 3×3 to output P5; M5 is upsampled by 2 times and added to the 1×1 convolution result of C4. After 3×3 convolution, P4 is output. P4 is upsampled by 2 times and added to the 1×1 convolution result of C3. After 3×3 convolution, P3 is output. P3 is upsampled by 2 times and added to the 1×1 convolution result of C2. After 3×3 convolution, P2 is output. Among them, the resolutions of P2, P3, P4, and P5 are 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image, respectively, and the number of channels is 256.

[0033] The final output features are {P2, P3, P4, P5}.

[0034] (3) Pyramid attention pooling module.

[0035] The pyramid attention pooling module comprises a channel attention submodule and a spatial attention submodule. The channel attention submodule weights the feature map channels using a squeeze-and-excitation (SE) network to enhance key semantic information. The spatial attention submodule focuses on salient edge regions using convolutional block attention (CBAM) to generate a spatial weight mask. The resulting feature map set covers multi-level information, from shallow local details (such as texture and corners) to deep semantic features (such as object contours and scene structure).

[0036] The pyramid attention pooling module, specifically implemented as follows: 1) Multi-scale pooling branch: Four different scales of adaptive average pooling are used to generate feature maps of sizes 1×1, 2×2, 3×3, and 6×6; each pooling result is passed through a 1×1 convolution to reduce the number of channels to C / 4 = 64; bilinear upsampling is performed to the original image size H×W to obtain four context feature maps S1, S2, S3, and S4; the input feature P is concatenated with the four context features along the channel dimension; a 3×3 convolution is applied to reduce the number of channels back to C to obtain F. context ∈R H×W×C .

[0037] 3) Channel attention: for F context Perform global average pooling to obtain the channel description vector v∈R C Channel weights are generated through two fully connected layers: a = σ(W2⋅ReLU(W1⋅v)), where σ is the activation function and W1 and W2 are the parameters of the two fully connected layers; the weights are multiplied back channel by channel to obtain the output Fout = a⊙F context .

[0038] 4) Residual connection output: P enhanced =P+Fout.

[0039] The pyramid attention pooling module described above is applied to P2, P3, P4, and P5 respectively, resulting in enhanced feature maps F2, F3, F4, and F5. These feature maps will be used as multi-scale feature outputs for subsequent edge detection or fusion.

[0040] Furthermore, a scene feature vector z is introduced into the deformable convolutional neural network for dynamic adjustment of the offset, and the calculation expression is as follows: , , , , , , In the formula: This is a deformable convolution operation; The base offset learned from the input feature map by standard deformable convolution; The offset prototype corresponding to the k-th sampling position is obtained by encoding based on the edge set type; K is the total number of sampling positions. This refers to the scene adjustment factor associated with the scene feature vector z; For activation functions; These are the learning parameters.

[0041] S2. The feature maps at different scales are regarded as graph nodes. The spatial dependency between nodes is modeled through the message passing mechanism of the graph neural network to generate fusion weights. The meta-learning mechanism is used to adaptively train the graph neural network according to the scene features of the initial image.

[0042] In this embodiment, a meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image, specifically including: A meta-learning task distribution is constructed, with each task corresponding to an image scene type (such as city, nature, medical image). Each task includes a support set and a query set, both of which consist of images and corresponding ground truth edge detection values. During the meta-training phase, for each task, the support set is input into the graph neural network, initial weights are output, edge detection loss is calculated using the support set, and the parameters of the graph neural network are updated through gradient descent to obtain task-specific graph neural network parameters. The weights are recalculated on the query set using the task-specific graph neural network parameters, and the edge detection loss on the query set is calculated. The graph neural network parameters are updated by outer loop gradient descent, and the updated graph neural network parameters are used for the inner loop initialization of the next round of meta-training task. The edge detection loss includes scale-weighted edge loss.

[0043] In this embodiment, a meta-learning mechanism is used to dynamically adjust the weight allocation strategy according to the scene type of the input image (such as urban, natural, or medical images), supporting adaptive optimization of "one scene, one strategy". It is used to adaptively allocate fusion weights to each scale feature map according to the characteristics of feature maps at different scales, so as to achieve adaptive fusion of multi-scale features.

[0044] S3. Use fusion weights to fuse feature maps of different scales to obtain fused feature maps.

[0045] In one possible implementation, the fusion process employs a dual mechanism of dynamic weighted summation and attention interaction between feature maps: dynamic weighted summation linearly combines feature maps using learned weights; attention interaction between feature maps captures long-range dependencies through a nonlocal neural network, enhancing the consistency of features across scales; wherein the attention mechanism is either a spatial attention mechanism or a channel attention mechanism.

[0046] S4. Perform edge detection on the fused feature map to obtain image edge information.

[0047] In one possible implementation, after obtaining the fused feature map, traditional edge detection algorithms, such as Canny and Sobel, can be used to detect edges on the feature map. Alternatively, deep learning-based edge detection algorithms, such as Fully Convolutional Networks (FCN) and U-Net, can be employed.

[0048] In another possible implementation, the fused feature map is input into an edge detection module based on a Transformer encoder-decoder architecture to obtain image edge information, specifically including: The Transformer encoder models pixel-level long-range dependencies through a self-attention mechanism, generating an edge probability map. The edge probability map is mapped to the initial image space using the Transformer decoder, outputting coarse-grained edges.

[0049] In one possible implementation, after outputting coarse-grained edges, a non-maximum suppression algorithm is used to filter redundant edge points based on the edge direction consistency criterion, retaining the most coherent edge structure to obtain image edge information.

[0050] The image to be detected is a multimodal image. The feature maps of different modalities obtained by multi-scale feature extraction are mapped to a shared semantic space, and corresponding fusion weights are assigned to the feature maps after aligning the modal features.

[0051] In this embodiment, the edge detection loss includes scale-weighted edge loss. By assigning scene-adaptive fusion weights to feature maps of different scales, the contribution of multi-scale features can be dynamically balanced according to the image content. In dense small target scenes, the supervision signal of shallow detail features is enhanced, and in large-scale structural scenes, the guiding role of deep semantic features is strengthened. This effectively suppresses the mutual interference of gradients between scales, improves the efficiency and stability of multi-scale feature collaborative optimization, and achieves an adaptive balance between edge details and overall structure.

[0052] Specifically, scale-weighted edge loss The calculation expression is: , In the formula: For the first Each scale corresponds to scene adaptive weights; This represents the total number of feature map scales. For the first Edge detection loss for feature maps at each scale.

[0053] In one possible implementation, the edge detection loss also includes a scene-aware edge loss L. edge, Scene-aware edge loss L edge Introducing scene adjustment focus parameters based on scene feature vectors As an exponential term, the calculation expression is: , , In the formula: For pixels The probability of belonging to the edge; For pixels The true label; Focus parameters for scene adjustment; These are the initial values ​​for the focusing parameters; , These are learnable parameters; This is the activation function.

[0054] This invention addresses scene-aware edge loss L edge The introduction of scene-adjustable focus parameters allows the model to dynamically adjust the degree of attention paid to easy and difficult samples based on the characteristics of the image scene. In difficult scenes such as low contrast and weak edges, it automatically enhances the ability to mine pixels with hard edges, while avoiding over-enhancing easy samples in high contrast and clear structure scenes. This significantly improves the accuracy of edge detection and cross-scene generalization ability, while alleviating the problem that the fixed parameters of traditional focus loss cannot adapt to scene changes.

[0055] In one possible implementation, the edge detection loss also includes an edge continuity loss. This is used to constrain the alignment of predicted edges along the image gradient normal direction and to protect weak edges using continuity confidence. The calculation expression is: , In the formula: For predicting the set of edge pixels; For the image at the edge points The gradient; n e The direction of the edge normal; For the image at the edge points The confidence level of edge continuity; This is an adjustable coefficient used to control the influence intensity of the edge continuity confidence level.

[0056] This invention introduces edge continuity loss, explicitly constrains the alignment of predicted edges along the image gradient normal direction, and uses continuity confidence to protect weak edges, forcing the network to learn continuous edges that conform to geometric priors. This significantly reduces edge breakage and burr phenomena. At the same time, gradient consistency effectively suppresses false edge responses in texture noise regions, enhances the perception of weak edges in low-contrast regions, and makes the edge detection results more complete, smooth, and consistent with human visual cognition.

[0057] like Figure 2 As shown, this embodiment also provides a multi-scale adaptive weight fusion image edge detection system, which employs the above method and includes: The multi-scale feature extraction module is used to extract features from the input image to be detected at multiple scales, and obtain feature maps at different scales. The fusion weight generation module treats feature maps at different scales as graph nodes and generates fusion weights by modeling the spatial dependencies between nodes through the message passing mechanism of the graph neural network. In this module, a meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image. The fusion module is used to fuse feature maps of different scales using fusion weights to obtain a fused feature map. The edge detection module is used to perform edge detection on the fused feature map to obtain image edge information.

[0058] In this embodiment, the module supports online updates, that is, adjusting the weight parameters based on real-time feedback during the inference process to improve adaptability to dynamic scenarios such as video streams.

[0059] The system is equipped with a cross-modal extension interface, which can be used to map feature maps of different modalities to a shared semantic space through the modal feature alignment module, and then input them to the adaptive weight fusion module. It supports edge detection of multimodal images (such as infrared-visible light, multispectral). The lightweight deployment unit is used to realize real-time edge detection on embedded devices (such as drones, robots).

[0060] The system is equipped with a lightweight deployment unit for deployment. The lightweight deployment unit includes a model compression submodule and a hardware acceleration submodule. The model compression submodule compresses the number of model parameters to less than 1 / 5 of the original model through channel pruning and quantization-aware training (QAT). The hardware acceleration submodule optimizes the memory access mode and parallel computing strategy for the platform.

[0061] The electronic device of this invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) or loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0062] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0063] The processing unit performs the various methods and processes described above. For example, in some embodiments, the methods may be implemented as computer software programs tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute the methods by any other suitable means (e.g., by means of firmware).

[0064] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.

[0065] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0066] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0067] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An image edge detection method based on multi-scale adaptive weight fusion, characterized in that, include: The initial image is input into the multi-scale feature extraction module to obtain feature maps at different scales; wherein, the multi-scale feature extraction module is a cascaded structure based on a deformable convolutional neural network and a pyramid attention pooling module, and the scene feature vector is introduced into the deformable convolutional neural network for dynamic adjustment of offset; Feature maps at different scales are treated as graph nodes. Spatial dependencies between nodes are modeled and fusion weights are generated through the message passing mechanism of graph neural networks. Meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image. The feature maps of different scales are fused using fusion weights to obtain the fused feature map; Edge detection is performed on the fused feature map to obtain image edge information.

2. The image edge detection method based on multi-scale adaptive weight fusion according to claim 1, characterized in that, The deformable convolutional neural network introduces a scene feature vector z, dynamically adjusts the offset, and outputs the following expression: , , , In the formula: This is a deformable convolution operation; The base offset learned from the input feature map by standard deformable convolution; The offset prototype corresponding to the k-th sampling position is obtained by encoding based on the edge set type; K is the total number of sampling positions. This refers to the scene adjustment factor related to the scene feature vector z; For activation functions; These are the learning parameters.

3. The image edge detection method based on multi-scale adaptive weight fusion according to claim 1, characterized in that, The scene feature vectors are obtained through a lightweight convolutional neural network.

4. The image edge detection method based on multi-scale adaptive weight fusion according to claim 1, characterized in that, The meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image, specifically including: A meta-learning task distribution is constructed, with each task corresponding to an image scene type. Each task includes a support set and a query set, both of which consist of an image and its corresponding ground truth edge detection values. During the meta-training phase, for each task, the support set is input into the graph neural network, initial weights are output, edge detection loss is calculated using the support set, and the parameters of the graph neural network are updated through gradient descent to obtain task-specific graph neural network parameters. The weights are recalculated on the query set using the task-specific graph neural network parameters, and the edge detection loss on the query set is calculated. The graph neural network parameters are updated by outer loop gradient descent, and the updated graph neural network parameters are used for the inner loop initialization of the next round of meta-training task. The edge detection loss includes scale-weighted edge loss.

5. The image edge detection method based on multi-scale adaptive weight fusion according to claim 4, characterized in that, The edge detection loss includes a scene-aware edge loss, which introduces a scene-adjusted focusing parameter based on the scene feature vector. As an exponential term, the scene adjustment focus parameter Represented as: , These are the initial values ​​for the focusing parameters; , These are learnable parameters; This is the activation function.

6. The image edge detection method based on multi-scale adaptive weight fusion according to claim 4, characterized in that, The edge detection loss includes an edge continuity loss, which constrains the alignment of predicted edges along the image gradient normal direction and uses continuity confidence to protect weak edges. The calculation expression is as follows: , In the formula: For predicting the set of edge pixels; For the image at the edge points The gradient; The direction of the edge normal; For the image at the edge points The confidence level of edge continuity; This is an adjustable coefficient used to control the influence intensity of the edge continuity confidence level.

7. The image edge detection method based on multi-scale adaptive weight fusion according to claim 1, characterized in that, The fused feature map is input into an edge detection module based on a Transformer encoder-decoder architecture to obtain image edge information, specifically including: The fused feature map is input into the Transformer encoder to model pixel-level long-range dependencies through a self-attention mechanism, generating an edge probability map. The edge probability map is mapped to the initial image space using the Transformer decoder, and coarse-grained edges are output. A non-maximum suppression algorithm is used to filter redundant edge points based on the edge direction consistency criterion, while preserving the edge structure and obtaining image edge information.

8. A multi-scale adaptive weight fusion image edge detection system, employing the method described in claim 1, characterized in that, include: The multi-scale feature extraction module is used to extract features from the input image to be detected at multiple scales, and obtain feature maps at different scales. The fusion weight generation module treats feature maps at different scales as graph nodes and generates fusion weights by modeling the spatial dependencies between nodes through the message passing mechanism of the graph neural network. In this module, a meta-learning mechanism is used to adaptively train the graph neural network based on the scene features of the initial image. The fusion module is used to fuse feature maps of different scales using fusion weights to obtain a fused feature map. The edge detection module is used to perform edge detection on the fused feature map to obtain image edge information.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.