Visual classification method and system based on dynamic multi-scale space blocks

By employing a dynamic multi-scale spatial block visual classification method, and utilizing the collaborative structure of a dynamic Tanh attention module and a multi-functional feature enhancement module, the problem of insufficient detection accuracy and generalization ability of existing models in complex natural scenes is solved, achieving efficient and high-precision visual classification on edge devices.

CN121600330AActive Publication Date: 2026-03-03GUANGDONG OCEAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610116048.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-28
Publication Date
2026-03-03
Estimated Expiration
2046-01-28

AI Technical Summary

Technical Problem

Existing computer vision models face challenges when dealing with complex natural scenes, such as huge differences in target scale, drastic changes in lighting conditions, similar textures between targets and backgrounds, blurred and irregular object boundaries, and complex long-distance spatial dependencies. These challenges lead to decreased detection accuracy and insufficient generalization ability, and make it difficult to deploy high-precision models on resource-constrained edge devices.

Method used

A dynamic multi-scale spatial block visual classification method is constructed. By introducing a dual-module collaborative structure of a dynamic Tanh attention module and a multi-functional feature enhancement module, the feature processing flow is optimized and reconstructed. This includes the dynamic Tanh attention module performing nonlinear preprocessing on the initial feature map, the multi-functional feature enhancement module performing feature enhancement, and finally outputting the visual classification result through the classification head.

Benefits of technology

It significantly improves the classification accuracy and robustness of the model in complex visual scenes, meets the dual requirements of lightweight and high precision for edge computing and real-time coastal monitoring, and achieves efficient perception of multi-scale targets and complex spatial structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600330A_ABST
    Figure CN121600330A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, in particular to a visual classification method and system based on dynamic multi-scale space blocks. The method comprises the following steps: acquiring an image to be classified and a trained dynamic multi-scale space block visual classification network; inputting the to-be-classified image into the dynamic multi-scale space block visual classification network, performing feature extraction on the to-be-classified image through the backbone network to obtain an initial feature map, and processing the initial feature map through the dynamic multi-scale space module to obtain an enhanced feature map; inputting the enhanced feature map into the classification head, and outputting a visual classification result; the method effectively improves the precision and robustness of complex scenes such as beach state recognition, and is suitable for edge calculation and real-time monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and specifically to a visual classification method and system based on dynamic multi-scale spatial blocks. Background Technology

[0002] Object detection is a fundamental task in computer vision, aiming to locate and identify objects of interest from images. One-stage detectors, represented by the YOLO series, achieve a good balance between speed and accuracy, with YOLOv11 enhancing feature extraction capabilities by introducing a C2PSA module. However, when dealing with complex real-world scenes (such as remote sensing images and environmental monitoring videos), existing models still face challenges such as significant differences in target scale, drastic changes in lighting conditions, similar textures between targets and backgrounds, blurred and irregular object boundaries, and complex long-distance spatial dependencies, leading to decreased detection accuracy and insufficient generalization ability.

[0003] Existing models primarily employ linear normalization methods, lacking the ability to adaptively adjust to the distribution of input features, making it difficult to stably handle complex and variable visual features. Feature enhancement modules often focus on single-scale or single-dimensional (local or global) processing, lacking a systematic cross-stage, multi-scale feature collaborative extraction and fusion mechanism, resulting in poor detection performance for small targets, blurred targets, and targets with complex spatial structures. Some studies use models with large numbers of parameters and computational complexity, making them difficult to deploy on resource-constrained edge devices; while lightweight models experience a significant decrease in accuracy in complex scenes. Traditional feedforward networks and some attention mechanisms separate or simplify the modeling of spatial structural information and inter-channel dependencies, failing to achieve deep collaborative modulation of spatial context and channel features.

[0004] In the field of beach condition recognition, existing technologies are mostly improvements based on older frameworks such as YOLO-V3. These improvements involve adding residual connections to enhance gradient flow and training stability, or using Argus imagery and convolutional neural networks to classify the condition of a single sandbar beach. These methods have limitations in feature representation capabilities, multi-scale information fusion, and adaptive processing, making it difficult to simultaneously meet the dual requirements of lightweight deployment and high-precision recognition. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a visual classification method and system based on dynamic multi-scale spatial blocks. By constructing a dual-module collaborative structure of a dynamic Tanh attention module and a multi-functional feature enhancement module, the feature processing flow is optimized and reconstructed, significantly improving the classification accuracy, robustness, and computational efficiency of the model in complex visual scenes.

[0006] On one hand, embodiments of the present invention provide a visual classification method based on dynamic multi-scale spatial blocks, comprising the following steps:

[0007] The image to be classified and the trained dynamic multi-scale spatial block visual classification network are obtained; wherein, the dynamic multi-scale spatial block visual classification network includes a backbone network, a dynamic multi-scale spatial module and a classification head;

[0008] The image to be classified is input into the dynamic multi-scale spatial block visual classification network. The backbone network extracts features from the image to obtain an initial feature map. The dynamic multi-scale spatial module processes the initial feature map to obtain an enhanced feature map. The dynamic multi-scale spatial module includes a dynamic Tanh attention module and a multi-functional feature enhancement module. The dynamic Tanh attention module performs dynamic nonlinear preprocessing on the initial feature map to obtain an intermediate feature map, and the multi-functional feature enhancement module enhances the intermediate feature map to obtain the enhanced feature map.

[0009] The enhanced feature map is input into the classification head, and the visual classification result is output.

[0010] Optionally, the dynamic Tanh attention module performs dynamic nonlinear preprocessing on the initial feature map to obtain an intermediate feature map, including:

[0011] The initial feature map is input into the first dynamic Tanh normalization layer, and the initial feature map is subjected to an adaptive nonlinear transformation through a learnable scaling parameter to obtain the first calibration feature map.

[0012] The first calibration feature map is input to a self-attention mechanism to model the global context relationship, resulting in an attention feature map;

[0013] The attention feature map is input into the second dynamic Tanh normalization layer for secondary enhancement to obtain the second calibration feature map;

[0014] The second calibration feature map is input into the feedforward network for local feature transformation to obtain the intermediate feature map.

[0015] Optionally, the step of performing an adaptive nonlinear transformation on the initial feature map using learnable scaling parameters to obtain a first calibrated feature map includes:

[0016] The initial feature map is multiplied by the learnable scaling parameter and then input into the hyperbolic tangent activation function. The output of the hyperbolic tangent activation function is multiplied by the learnable scaling coefficient and then added to the learnable translation parameter to obtain the first calibration feature map.

[0017] Optionally, the multifunctional feature enhancement module performs feature enhancement on the intermediate feature map to obtain the enhanced feature map, including:

[0018] The intermediate feature map is input into the temperature scaling spatial attention module for global context information aggregation and modulation to obtain a global modulated feature map.

[0019] The global modulation feature map is input into the multi-scale visual adapter module for multi-scale local spatial feature extraction to obtain a multi-scale enhanced feature map.

[0020] The multi-scale enhanced feature map and the initial feature map are input into the spatial-channel enhancement feedforward network module for spatial-channel deep fusion to obtain the enhanced feature map.

[0021] Optionally, the multifunctional feature enhancement module includes a temperature-scaling spatial attention module. The step of inputting the intermediate feature map into the temperature-scaling spatial attention module for global context information aggregation and modulation to obtain a global modulated feature map includes:

[0022] The intermediate feature map is projected into a query matrix, a key matrix, and a value matrix through a linear transformation.

[0023] Calculate the eigenvector of each eigenvector in the key matrix. The norm squared value, the said The norm squared value is multiplied by the learnable temperature parameter and then input into the Softmax function to generate the location importance weights;

[0024] The positional importance weights are weighted and aggregated with the square of the value matrix to obtain global contextual features;

[0025] The attention weights are obtained by calculating the difference between each feature vector and the global context features through a reciprocal nonlinear transformation.

[0026] The global modulation feature map is obtained by multiplying the attention weight by the product of the query matrix and the position importance weight.

[0027] Optionally, the multi-functional feature enhancement module includes a multi-scale visual adapter module. The step of inputting the global modulation feature map into the multi-scale visual adapter module for multi-scale local spatial feature extraction to obtain a multi-scale enhanced feature map includes:

[0028] The global modulation feature map is projected to a low-dimensional space through a 1×1 convolution to obtain the projected feature map;

[0029] The projected feature map is convolved by parallel multi-branch depthwise separable convolution, where the first branch uses a 3×3 convolution kernel, the second branch uses a 5×5 convolution kernel, and the third branch uses a 7×7 convolution kernel, resulting in three branch feature maps with different receptive fields.

[0030] The three branch feature maps are arithmetically averaged and then residually concatenated with the input feature to obtain a fused feature map.

[0031] The fused feature map is processed by the GELU activation function and the Dropout regularization layer, and then channel information is exchanged through 1×1 convolution to obtain the multi-scale enhanced feature map.

[0032] Optionally, the multi-functional feature enhancement module includes a spatial-channel enhancement feedforward network module. The step of inputting the multi-scale enhanced feature map and the initial feature map into the spatial-channel enhancement feedforward network module for spatial-channel deep fusion to obtain the enhanced feature map includes:

[0033] The initial feature map is compressed in the spatial dimension by global average pooling to obtain the channel descriptor;

[0034] The channel descriptor is input into a multilayer perceptron to generate channel attention weights. The channel attention weights are then weighted with the multi-scale enhanced feature map to obtain channel enhanced features.

[0035] The multi-scale enhanced feature map is processed by average pooling and a convolutional encoder-decoder structure to extract multi-scale spatial context information, resulting in spatial enhanced features.

[0036] The channel enhancement features and the spatial enhancement features are concatenated along the channel dimension and then fused using a 1×1 convolution to obtain the enhancement feature map.

[0037] On the other hand, embodiments of the present invention provide a visual classification system based on dynamic multi-scale spatial blocks, including:

[0038] At least one processor;

[0039] At least one memory for storing at least one program;

[0040] When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any of the preceding descriptions.

[0041] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the method described in any of the preceding claims.

[0042] The embodiments of the present invention have the following beneficial effects:

[0043] This invention introduces a dynamic Tanh attention module by adopting dynamic Tanh normalization. It uses learnable scaling parameters to adaptively adjust the saturation range of the nonlinear mapping, replacing traditional linear normalization with dynamic nonlinear transformation. This effectively enhances the discriminativeness and stability of feature representation and solves the problem of insufficient adaptive adjustment capability of feature distribution in complex scenes. By constructing a multi-functional feature enhancement module including a temperature-scaling spatial attention module, a multi-scale visual adapter module, and a spatial-channel enhancement feedforward network module, a complete optimization chain is formed from global context filtering, multi-scale local detail mining to intelligent fusion of spatial-channel information, significantly improving the model's perception capability for multi-scale targets and complex spatial structures. By creating a dual-module collaborative structure that connects the dynamic Tanh attention module and the multi-functional feature enhancement module, the feature processing flow is decoupled into two stages: dynamic preprocessing and composite enhancement. This achieves efficient collaboration between front-end calibration and back-end refinement, achieving a breakthrough in recognition accuracy while maintaining low computational complexity. This invention meets the dual requirements of lightweight design and high accuracy for edge computing and real-time coastal monitoring, providing a new technical path for lightweight target detection in complex natural scenes. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a flowchart illustrating a visual classification method based on dynamic multi-scale spatial blocks in an embodiment of the present invention.

[0046] Figure 2 This is an overall architecture diagram of the dynamic multi-scale spatial block visual classification network in an embodiment of the present invention;

[0047] Figure 3 This is a schematic diagram of the structure of the dynamic Tanh attention module in an embodiment of the present invention;

[0048] Figure 4 This is a schematic diagram of the structure of the multifunctional feature enhancement module in an embodiment of the present invention;

[0049] Figure 5 This is a schematic diagram of the temperature scaling spatial attention module in an embodiment of the present invention;

[0050] Figure 6 This is a schematic diagram of the structure of the multi-scale vision adapter module in an embodiment of the present invention;

[0051] Figure 7This is a schematic diagram of the structure of the space-channel enhancement feedforward network module in an embodiment of the present invention;

[0052] Figure 8 This is a diagram of the dual-module collaborative structure of the dynamic multi-scale spatial module in this embodiment of the invention. Detailed Implementation

[0053] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0055] It is understood that the terms "first," "second," etc., used in this invention may be used to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of embodiments of this invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to determination," or "in the event of a determination."

[0056] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0057] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this invention is for descriptive purposes only and is not intended to limit the invention.

[0058] This invention discloses a visual classification method based on dynamic multi-scale spatial blocks. The core of the method is to construct a dynamic multi-scale spatial block (DMS). By connecting a dynamic Tanh attention block (DTABlock) with a multi-feature enhancement module (MFE), the feature processing flow is optimized and reconstructed.

[0059] refer to Figure 1 ,like Figure 1 The image shows a visual classification method based on dynamic multi-scale spatial blocks provided by an embodiment of the present invention. The method includes the following steps:

[0060] S100, acquire the image to be classified and the trained dynamic multi-scale spatial block visual classification network; wherein, the dynamic multi-scale spatial block visual classification network includes a backbone network, a dynamic multi-scale spatial module and a classification head;

[0061] The images to be classified are beach state images, which include five beach state categories: low tide terraces, transverse sandbars and rifts, rhythmic sandbars and channels, coastal sandbars and channels, and dissipation type.

[0062] S200, the image to be classified is input into the dynamic multi-scale spatial block visual classification network. The backbone network extracts features from the image to obtain an initial feature map. The dynamic multi-scale spatial module processes the initial feature map to obtain an enhanced feature map. The dynamic multi-scale spatial module includes a dynamic Tanh attention module and a multi-functional feature enhancement module. The dynamic Tanh attention module performs dynamic nonlinear preprocessing on the initial feature map to obtain an intermediate feature map. The multi-functional feature enhancement module enhances the intermediate feature map to obtain the enhanced feature map.

[0063] S300, input the enhanced feature map into the classification head and output the visual classification result.

[0064] refer to Figure 2 The dynamic multi-scale spatial block visual classification network provided in this embodiment of the invention includes a backbone network, a dynamic multi-scale spatial module, and a classification head. The input image, after data preprocessing, enters the backbone network for preliminary feature extraction to obtain an initial feature map. The initial feature map is input to the dynamic multi-scale spatial module, which then sequentially passes through a dynamic Tanh attention module for dynamic nonlinear preprocessing and a multi-functional feature enhancement module for deep feature enhancement, resulting in an enhanced feature map. The enhanced feature map is input to the classification head, where it undergoes target category prediction and bounding box regression to output the final visual classification result.

[0065] The proposed visual classification method based on dynamic multi-scale spatial blocks, through its modular design, can be embedded as a plug-and-play unit into existing target detection frameworks, significantly improving detection performance in complex scenes under limited computational resources. The method's effectiveness has been validated in a beach state recognition task, and it is also applicable to visual classification tasks such as remote sensing monitoring, environmental dynamic analysis, and industrial visual inspection, which face challenges such as significant illumination variations, large target scale differences, local texture blurring, and complex spatial structures. It has broad industrial application prospects and market value. This method can be deployed on edge computing devices, drones, underwater robots, and other platforms to meet the needs of real-time monitoring and autonomous detection.

[0066] In some embodiments, in S200, the dynamic Tanh attention module performs dynamic nonlinear preprocessing on the initial feature map to obtain an intermediate feature map, including:

[0067] S211, the initial feature map is input into the first dynamic Tanh normalization layer, and the initial feature map is subjected to adaptive nonlinear transformation through learnable scaling parameters to obtain the first calibration feature map;

[0068] S212, global contextual relationship modeling is performed on the self-attention mechanism of the first calibration feature map input part to obtain the attention feature map;

[0069] S213, The attention feature map is input into the second dynamic Tanh normalization layer for secondary enhancement to obtain the second calibration feature map;

[0070] S214, the second calibration feature map is input into the feedforward network for local feature transformation to obtain the intermediate feature map.

[0071] refer to Figure 3 The dynamic Tanh attention module comprises two dynamic Tanh normalization layers (DYT layers) and a partial self-attention mechanism (PSA). The first dynamic Tanh normalization layer, located on the forward input path of the PSA, performs adaptive nonlinear transformation and distribution calibration on the initial input feature map, yielding a first calibrated feature map. This first calibrated feature map is then input to the PSA for global context modeling, resulting in an attention feature map. The second dynamic Tanh normalization layer, located before the feedforward network, performs secondary enhancement on the attention feature map, yielding a second calibrated feature map. This second calibrated feature map is then input to the feedforward network for local feature transformation and dimensionality adjustment, resulting in an intermediate feature map.

[0072] In some embodiments, S211, the step of performing an adaptive nonlinear transformation on the initial feature map using a learnable scaling parameter to obtain a first calibrated feature map includes:

[0073] The initial feature map is multiplied by the learnable scaling parameter and then input into the hyperbolic tangent activation function. The output of the hyperbolic tangent activation function is multiplied by the learnable scaling coefficient and then added to the learnable translation parameter to obtain the first calibration feature map.

[0074] The dynamic Tanh normalization is calculated as follows: the input features are multiplied by the learnable scaling parameter α and then input into the hyperbolic tangent activation function Tanh. The output of the Tanh function is multiplied by the learnable scaling coefficient γ, and then a learnable translation parameter β is added to obtain the calibrated features. The Tanh function compresses the features to the (-1,1) interval, and the learnable parameter α enables the model to adaptively adjust the saturation interval of the nonlinear mapping, thereby enhancing the discriminative power of the features.

[0075] In some embodiments, in S200, the multifunctional feature enhancement module performs feature enhancement on the intermediate feature map to obtain the enhanced feature map, including:

[0076] S221, The intermediate feature map is input into the temperature scaling spatial attention module for global context information aggregation and modulation to obtain a global modulated feature map;

[0077] S222, The global modulation feature map is input into the multi-scale visual adapter module to extract multi-scale local spatial features and obtain a multi-scale enhanced feature map;

[0078] S223, the multi-scale enhanced feature map and the initial feature map are input into the spatial-channel enhancement feedforward network module for spatial-channel deep fusion to obtain the enhanced feature map.

[0079] refer to Figure 4 The multifunctional feature enhancement module is composed of a temperature scaling spatial attention module (TSSA), a multi-scale visual adapter module (Mona), and a spatial-channel enhancement feedforward network module (SCEFN) connected in series, forming a progressive feature optimization link of "global perception → multi-scale extraction → intelligent fusion".

[0080] In some embodiments, the multifunctional feature enhancement module includes a temperature-scaling spatial attention module. In S221, inputting the intermediate feature map into the temperature-scaling spatial attention module for global context information aggregation and modulation to obtain a global modulated feature map includes:

[0081] S2211, the intermediate feature map is projected into a query matrix, a key matrix, and a value matrix through a linear transformation;

[0082] S2211, Calculate each eigenvector in the key matrix. The norm squared value, the said The norm squared value is multiplied by the learnable temperature parameter and then input into the Softmax function to generate the location importance weights;

[0083] S2211, The positional importance weights are weighted and aggregated with the square of the value matrix to obtain global context features;

[0084] S2211, The difference between each feature vector and the global context feature is calculated by the inverse nonlinear transformation to obtain the attention weights;

[0085] S2211, Multiply the attention weight by the product of the query matrix and the position importance weight to obtain the global modulation feature map.

[0086] Temperature scaling spatial attention module, such as Figure 5 As shown, the received input features Where B is the batch size, N = H × W is the total number of spatial locations, and C is the channel dimension. First, X is projected into a query matrix, key matrix, and value matrix through a linear transformation, and then the projected feature tensors are rearranged into a multi-head representation. The eigenvectors in the key matrix are then calculated. Norm square value, The squared norm value is multiplied by the learnable temperature parameter τ and then input into the Softmax function to generate positional importance weights. The temperature parameter τ controls the sharpness of the importance distribution: a smaller τ results in a sharper distribution, focusing attention on a few key features; a larger τ results in a smoother distribution, achieving broader information aggregation. The positional importance weights are weighted and aggregated with the square of the value matrix to obtain global context features. The difference between each feature vector and the global context features is calculated using a reciprocal nonlinear transformation 1 / (1+dots) to obtain the attention weights. Finally, the attention weights are multiplied by the product of the query matrix and the positional importance weights to output the global modulation feature map.

[0087] In some embodiments, the multi-functional feature enhancement module includes a multi-scale visual adapter module. In S222, the step of inputting the global modulation feature map into the multi-scale visual adapter module for multi-scale local spatial feature extraction to obtain a multi-scale enhanced feature map includes:

[0088] S2221, The global modulation feature map is projected to a low-dimensional space through a 1×1 convolution to obtain a projected feature map;

[0089] S2221, The projected feature map is convolved by parallel multi-branch depthwise separable convolution, wherein the first branch uses a 3×3 convolution kernel, the second branch uses a 5×5 convolution kernel, and the third branch uses a 7×7 convolution kernel to obtain three branch feature maps with different receptive fields.

[0090] S2221, After arithmetically averaging the three branch feature maps, perform residual concatenation with the input feature to obtain a fused feature map;

[0091] S2221, the fused feature map is processed by the GELU activation function and the Dropout regularization layer, and then channel information is interacted through 1×1 convolution to obtain the multi-scale enhanced feature map.

[0092] Multi-scale vision adapter modules such as Figure 6 As shown, the input features are received and projected into a low-dimensional space through a 1×1 convolution to obtain a projected feature map. Parallel multi-branch depthwise separable convolutions are used to extract multi-scale context. The first branch uses a 3×3 convolution kernel, the second branch uses a 5×5 convolution kernel, and the third branch uses a 7×7 convolution kernel. The number of convolutional groups is set to the number of input channels. The outputs of the three branches are arithmetically averaged and concatenated with the input feature residuals to obtain a fused feature map. After processing the fused feature map with the GELU activation function and Dropout regularization layer, channel information is exchanged through a 1×1 convolution to obtain a multi-scale enhanced feature map.

[0093] In some embodiments, the multifunctional feature enhancement module includes a spatial-channel enhancement feedforward network module. In S223, the step of inputting the multi-scale enhanced feature map and the initial feature map into the spatial-channel enhancement feedforward network module for spatial-channel deep fusion to obtain the enhanced feature map includes:

[0094] S2231, The initial feature map is compressed in the spatial dimension by global average pooling to obtain the channel descriptor;

[0095] S2232, The channel descriptor is input into a multilayer perceptron to generate channel attention weights, and the channel attention weights are weighted with the multi-scale enhanced feature map to obtain channel enhanced features;

[0096] S2233, The multi-scale enhanced feature map is processed by average pooling and a convolutional encoder-decoder structure to extract multi-scale spatial context information and obtain spatial enhanced features;

[0097] S2234, The channel enhancement features and the spatial enhancement features are concatenated along the channel dimension and then fused by a 1×1 convolution to obtain the enhancement feature map.

[0098] Spatial-channel enhanced feedforward network modules such as Figure 7As shown, a dual-path architecture is employed. The main path receives the input features from the main path and compresses them in the spatial dimension using global average pooling to obtain channel descriptors. These channel descriptors are then input into a multilayer perceptron to generate channel attention weights. These channel attention weights are then weighted with the input features from the main path (i.e., the multi-scale augmented feature map) to obtain channel-enhanced features. The spatially guided path receives the spatially guided features and extracts multi-scale spatial context information using average pooling and a convolutional encoder-decoder structure to obtain spatially enhanced features. The channel-enhanced features and spatially enhanced features are concatenated in the channel dimension and fused using a 1×1 convolution to obtain a deep fused feature map.

[0099] refer to Figure 8 This embodiment employs a dual-module collaborative structure, where a dynamic multi-scale spatial module connects the dynamic Tanh attention module and the multi-functional feature enhancement module. Input features are first processed and calibrated using the dynamic Tanh attention module to obtain an intermediate feature map. This intermediate feature map is then input to the multi-functional feature enhancement module, where it undergoes global modulation via a temperature-scaling spatial attention module, multi-scale extraction via a multi-scale visual adapter module, and deep fusion via a spatial-channel enhancement feedforward network module to obtain an enhanced feature map.

[0100] This collaborative paradigm of "dynamic front-end calibration and deep back-end refinement" achieves separation of responsibilities: the front-end dynamic Tanh attention module suppresses outlier features by leveraging the saturation properties of the hyperbolic tangent function, preventing excessive dominance of weight allocation in attention calculations, protecting gradient flow, and generating accurate attention maps; the back-end multi-functional feature enhancement module fully mines feature information, adaptively adjusts the receptive field through a temperature scaling mechanism, integrates a large receptive field context through parallel multi-scale convolutions, and achieves deep collaborative modulation through spatial-channel dual paths. The organic combination of these two approaches achieves performance breakthroughs while maintaining computational efficiency.

[0101] This invention discloses a visual classification method based on dynamic multi-scale spatial blocks. By constructing a dynamic multi-scale spatial block visual classification network, high-precision classification in complex visual scenes is achieved. This embodiment uses a beach state recognition task as an example to illustrate the implementation process of the technical solution in detail.

[0102] refer to Figure 2The dynamic multi-scale spatial block visual classification network provided in this embodiment of the invention includes a backbone network, a dynamic multi-scale spatial module, and a classification head. The input image (resolution H×W, number of channels C) is preprocessed and then fed into the backbone network for feature extraction and enhancement. The backbone network contains multiple convolution and feature extraction modules. The feature maps obtained after processing by the convolution and feature extraction modules are then fed into the dynamic multi-scale spatial module for feature enhancement. The neck network is located between the backbone network and the head network, and its function is to perform feature fusion and enhancement. The head network is the decision-making part of the object detection model, responsible for generating the final detection result.

[0103] Step 1: Data Acquisition and Processing;

[0104] This invention uses a beach dataset as the experimental benchmark. This dataset contains high-resolution images under five different beach conditions (such as different light intensities, turbidity, and background interference). These are:

[0105] (1) Low tide terrace: A sandbar is attached to the beach and exposed above the water at low tide, presenting a terrace shape. Sandbars on low tide terraces usually maintain good coastal continuity. In images, this state appears as a narrow and continuous sandbar parallel to the shoreline, closely attached to the shoreline.

[0106] (2) Lateral sandbars and crack currents: The most prominent feature of this state is that the sandbars are distributed laterally, almost perpendicular to the shoreline, and bend towards the ocean, forming fixed and clearly shaped crack current channels between adjacent sandbars. In the images, the sandbars and crack current channels are aligned in the same direction along the shore, and the unbroken water area exhibits a clear linear structure.

[0107] (3) Rhythmic sandbars and channels: The connection between the sandbars and the shoreline is completely broken, and they gradually migrate offshore, developing into rhythmic sandbar and channel structures. In the images, the offshore sandbars are arranged rhythmically and are clearly separated from the shoreline by grooves.

[0108] (4) Coastal sandbars and channels: The sandbars are located offshore and are characterized by being long and straight. They extend parallel to the shoreline and are accompanied by a continuous channel. In the image, this feature is shown as a straight, continuous and wide offshore sandbar with a regular structure and lack of obvious curvature.

[0109] (5) Dissipating type: Its main characteristic is that the beach profile is extremely flat, and the nearshore sandbars completely disappear or degenerate into an imperceptible form. In images, this state is manifested as a large area without obvious concentrated wave breaking lines, with the overall structure diffuse and lacking clear wave breaking traces.

[0110] Step 2: Data processing;

[0111] Images with good quality and high visibility were selected from the original dataset. To address the uneven classification of samples, multi-scale data augmentation strategies were applied to the classes with a smaller proportion, including random horizontal flipping, ±15° rotation, and blur and noise reduction, to augment the data. The final dataset contained a total of 9972 images. The entire dataset was randomly divided into training, validation, and test sets in a ratio of 7:2:1.

[0112] Step 3: Dynamic Tanh Attention Module;

[0113] The Dynamic Tanh Attention module aims to replace part of the processing flow of the C2PSA module in YOLOv11 by introducing Dynamic Tanh Normalization (DYT). The core of DYT is to replace the traditional linear normalization with a dynamic nonlinear transformation, and its calculation method is shown in the following equation:

[0114] ;

[0115] In the formula: is a learnable, dynamically scaling parameter; Tanh is the hyperbolic tangent activation function; and The scaling and translation parameters are learnable. The Tanh function compresses the features to the (-1, 1) interval, while the learnable... This enables the model to adaptively adjust the saturation range of the nonlinear mapping, thereby enhancing the discriminative power of the features.

[0116] refer to Figure 3 , Figure 3 The internal structure of the dynamic Tanh attention module is described in detail. This module is designed to perform dynamic non-linear preprocessing on the input features. The features first pass through the first dynamic Tanh normalization layer, through learnable parameters. Adaptive nonlinear transformation and distribution calibration are performed; the calibrated features are then input into a partial self-attention (PSA) mechanism for global contextual modeling. After secondary enhancement through a second dynamic Tanh normalization layer, the features are fed into a feedforward network (FFN) for local feature transformation and dimensionality adjustment.

[0117] The first dynamic Tanh normalization layer, located in the forward input path of the self-attention mechanism, preprocesses the original features by optimizing global dependencies before feature map flattening and dimensionality permutation operations. Through the dynamic Tanh normalization layer, features undergo appropriate non-linear compression and distribution adjustment before attention computation. The saturation property of the Tanh function suppresses outliers in the features, preventing them from excessively dominating weight allocation during attention computation. Simultaneously, the smoothing property of the Tanh function protects gradient flow, contributing to the generation of more accurate and representative attention maps, enabling the model to more precisely focus on key regions in the image.

[0118] The second dynamic Tanh normalization layer, located before the feedforward network layers, preprocesses local feature enhancements. While the feedforward network primarily handles local feature transformations and dimensionality adjustments, this dynamic Tanh normalization layer effectively enhances the discriminative boundaries of features and improves their distribution properties through dynamic nonlinear transformations, facilitating more effective feature fusion and transformation in subsequent linear layers. This dual dynamic Tanh normalization layer design provides multi-level training adaptability, offering ideal input conditions for the core computation modules.

[0119] Step 4: Multifunctional Feature Enhancement Module;

[0120] The multi-functional feature enhancement module is a composite structure consisting of three cooperating sub-modules, used to replace some functions in C2PSA to achieve multi-level feature enhancement.

[0121] refer to Figure 4 The multi-functional feature enhancement module is a composite structure consisting of three complementary sub-modules connected in series. The temperature-scaling spatial attention module receives input features and performs adaptive aggregation and modulation of global contextual information. The multi-scale visual adapter module receives the output of the temperature-scaling spatial attention module and extracts local spatial features from different receptive fields. The spatial-channel enhancement feedforward network module receives the output of the multi-scale visual adapter module and performs deep fusion of depth features with multi-scale spatial contextual information extracted from the spatial guidance path. These three sub-modules form a progressive feature optimization chain of "global perception → multi-scale extraction → intelligent fusion".

[0122] 1. Temperature scaling spatial attention module;

[0123] refer to Figure 5 The temperature scaling spatial attention module receives input features and calculates the importance weights of feature tokens using learnable temperature parameters (τ), thereby achieving adaptive aggregation and modulation of global context information.

[0124] A temperature-scaled spatial attention module is introduced, constructing attention by measuring the global importance of each feature token. It utilizes a learnable temperature parameter to sharpen the token importance distribution and employs an efficient weighted fusion mechanism to aggregate and modulate global contextual information. While maintaining linear computational complexity, this significantly enhances the model's ability to perceive key spatial regions. The goal of the temperature-scaled spatial attention module is to output a feature modulated by global spatial context. .

[0125] (1) Given input features Where B is the batch size. Let C be the total number of spatial locations and C be the channel dimension.

[0126] (2) The input features are projected onto the multi-head representation space through a shared linear transformation. After the linear transformation, three projection matrices Q, K, and V are generated. The projected feature tensors are reorganized into multiple attention heads in the channel dimension, each responsible for capturing the feature representations of different subspaces:

[0127] ;

[0128] Where h represents the number of attention heads; d = C / h is the feature dimension of each head; and C is the number of channels. This yields the multi-head feature tensor. .

[0129] (3) The temperature scaling spatial attention module calculates the temperature scaling spatial attention for each normalized token vector. The squared norm, which reflects the intensity of the location feature, is multiplied by the temperature parameter and then input into the softmax function to generate the location importance weight Pi.

[0130] ;

[0131] ;

[0132] ;

[0133] In the formula, Let S represent the i-th feature dimension; S is the sum of squared feature norms at each position; This is a temperature parameter. The function of the temperature parameter is: when... When τ is small, the Softmax output distribution is sharper, causing the attention head to focus highly on a few key tokens with the strongest energy; when τ is large, the distribution is flatter, and the head smoothly aggregates information from a wider range of tokens. This learnable scaling mechanism enables the model to adaptively adjust its receptive range at different semantic levels.

[0134] (4) The temperature scaling spatial attention module aggregates a global context feature dots by weighting the element-wise squares of the original feature W with the position importance weight Pi. Then, the difference between each token and the global summary is transformed into attention weights through the reciprocal nonlinear transformation, so that the model can effectively suppress noise information and enhance the expression of useful signals.

[0135] ;

[0136] ;

[0137] ;

[0138] in, It is a numerically stable term; the reciprocal nonlinear function has edge suppression characteristics: tokens that are highly similar to the global summary dots receive a weight close to 1; tokens that are significantly different receive a weight close to 0.

[0139] (5) The original features are modulated using the calculated importance weight Pi and scaled using the attention weight attn to obtain the output of each head. The calculation method is shown in the following formula:

[0140] ;

[0141] The negative sign in the formula is dynamically combined with the subsequent weight updates of the network layers to ensure the effectiveness of the gradient flow.

[0142] 2. Multi-scale vision adapter module

[0143] refer to Figure 6 The multi-scale visual adapter module receives the output of the temperature-scaling spatial attention module and simultaneously extracts local spatial features of different receptive fields through parallel multi-branch depthwise separable convolutions (kernel sizes 3×3, 5×5, 7×7), and then fuses them to enhance multi-scale representation capabilities.

[0144] (1) The feature x is projected into a low-dimensional space and captures multi-scale context through parallel multi-branch deep convolution. The number of groups of all its convolutions (3×3, 5×5, 7×7) is set to the number of input channels. Each convolution kernel is responsible for only one input channel, which enables the multi-scale visual adapter to integrate convolution kernels with large receptive fields at a lower computational cost, thereby capturing a wide range of contextual information in the image more efficiently.

[0145] ;

[0146] ;

[0147] ;

[0148] ;

[0149] in, This represents a depthwise separable convolution with a kernel size of k. Convolutions with different kernel sizes provide different receptive fields, ranging from local details to broader context. The outputs of the three branches are fused by arithmetic averaging and the original features are preserved through residual connections, mitigating gradient vanishing and promoting smooth information flow.

[0150] (2) The inter-channel information is exchanged by a 1×1 convolutional projection layer, and the final output is the projection result z;

[0151] ;

[0152] ;

[0153] ;

[0154] (3) Through the synergistic effect of GELU activation function and Dropout regularization, GELU activation function provides good gradient flow characteristics for the network, while Dropout layer forces the network to learn redundant feature representations by randomly discarding 10% of the activation values, effectively preventing overfitting while maintaining nonlinear expressive ability.

[0155] ;

[0156] ;

[0157] ;

[0158] ;

[0159] In the formula: erf is the error function.

[0160] 3. Spatial-channel enhanced feedforward network module

[0161] refer to Figure 7 The spatial-channel enhanced feedforward network module receives the output of the multi-scale visual adapter module and adopts a dual-path architecture to deeply fuse depth features with multi-scale spatial context information extracted from the spatial guidance path, and achieves adaptive feature selection through a gating mechanism.

[0162] (1) Introduce two inputs, namely the main path input feature map. and spatial guidance path input feature map .

[0163] (2) On the main path, the input features are first preprocessed by a lightweight channel attention mechanism. The channel attention module captures the global context information of each channel through a global average pooling layer, compressing the spatial dimension into a single scalar value to form a channel descriptor. Then, the convolutional layer learns the complex dependencies between channels and uses the Sigmoid activation function to generate attention weights CA between 0 and 1.

[0164] ;

[0165] ;

[0166] ;

[0167] in, Indicates global average pooling; and There are two linear projection layers. It is the ReLU activation function. Element-wise multiplication representing the channel direction.

[0168] (3) Project the enhanced features into a higher-dimensional space.

[0169] ;

[0170] in, Point convolution weights; Indicates the convolution operation; This represents the feature tensor after high-dimensional projection.

[0171] (4) Feed the data into a depthwise convolutional layer for spatial encoding and segmentation:

[0172] ;

[0173] After convolution, the features are evenly divided into two parts: ,in Used for subsequent feature fusion Reserved for gating operations.

[0174] (5) Spatial branching provides enhanced multi-scale spatial information for subsequent feature fusion. The spatial guidance path extracts structured information through an encoder-decoder structure:

[0175] ;

[0176] ;

[0177] ;

[0178] in, is average pooling with a step size of 2; LN is a normalized layer.

[0179] (6) The feature fusion module is responsible for combining spatial guidance information with the main branch. It integrates the two information sources in the channel dimension through a splicing operation. The spliced ​​features are then compressed in dimension and integrated through a 1×1 fusion convolution.

[0180] ;

[0181] ;

[0182] (7) Perform a second depth transformation on the fused features and apply a gating mechanism. To improve efficiency, reuse the weights of the main path depthwise convolution to perform depthwise convolution processing on the compressed features:

[0183] ;

[0184] Step 5: The dual-module collaborative structure of the dynamic multi-scale spatial module;

[0185] refer to Figure 8 The dynamic Tanh attention module is connected in series with the multifunctional feature enhancement module to form a dynamic multi-scale spatial module structure, which serves as the core enhancement unit in the YOLOv11 backbone network.

[0186] refer to Figure 8 The dynamic multi-scale spatial module structure is an organic combination of a dynamic Tanh attention module and a multi-functional feature enhancement module. Input features first undergo dynamic nonlinear preprocessing and calibration via the dynamic Tanh attention module, and then are fed into the multi-functional feature enhancement module for deep global-local multi-scale feature enhancement and fusion. This achieves separation and synergy between "dynamic preprocessing" and "composite enhancement," with front-end calibration providing stable, high-quality input for complex back-end processing, while back-end enhancement fully mines feature information, thus achieving a performance breakthrough overall.

[0187] The dynamic multi-scale spatial block visual classification method proposed in this invention adopts a modular design, which can be embedded into existing target detection frameworks as plug-and-play units, significantly improving the detection performance in complex scenes under limited computing resources. The method has verified its effectiveness in the beach state recognition task and is also applicable to other visual classification tasks with challenges such as significant changes in illumination, large differences in target scale, blurred local textures, and complex spatial structures, and has broad industrial application prospects and market value.

[0188] Compared with related technologies, the present invention has the following improvements:

[0189] 1. By introducing a dynamic Tanh attention module built with dynamic Tanh normalization, the problem of insufficient adaptability of traditional linear normalization to complex nonlinear feature distributions is effectively solved. Experiments on a self-built beach dataset show that the model including the dynamic Tanh attention module captures target features more comprehensively and reduces missed detections.

[0190] 2. The designed multifunctional feature enhancement module integrates a temperature-scaling spatial attention module, a multi-scale visual adapter module, and a spatial-channel enhancement feedforward network module. These three modules work together to form a complete optimization chain from global context filtering and multi-scale local detail mining to intelligent feature fusion. Experiments show that the model achieves optimal overall performance when used in combination, with mAP@50 reaching 0.922, significantly improving the localization and classification capabilities for difficult targets (such as blurry or small-scale targets).

[0191] 3. The proposed dual-module collaborative architecture organically combines the dynamic Tanh attention module with the multifunctional feature enhancement module, creatively decoupling the feature processing flow. The final YOLOv11-DMS model achieves a detection accuracy of mAP@50:0.929 with a computational complexity of GFLOPs=10.4, meeting the dual requirements of lightweight design and high accuracy for edge computing and real-time coastal monitoring.

[0192] 4. The dynamic multi-scale spatial module enables the model to adaptively handle the dynamic and complex features in beach imagery caused by illumination variations, tidal fluctuations, and weather conditions. The model exhibits accurate and stable detection performance under various typical beach conditions and different imaging conditions, demonstrating its strong robustness to complex real-world scenes.

[0193] 5. The design of the dynamic Tanh attention module and the multi-functional feature enhancement module features modularity and versatility. The collaborative paradigm of "front-end dynamic calibration and back-end deep refinement" not only effectively solves the specific problem of beach state recognition, but also provides a new idea and technical path for performance optimization of other lightweight target detection models that need to be deployed in complex natural scenes.

[0194] This invention also provides a visual classification system based on dynamic multi-scale spatial blocks, comprising: at least one processor; at least one memory for storing at least one program; and when the at least one program is executed by the at least one processor, causing the at least one processor to implement the method as described in any of the preceding embodiments.

[0195] The processor may be a central processing unit (CPU), a graphics processing unit (GPU), or other processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the system to perform desired functions. The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the methods described in the embodiments of the present invention. Various application programs and various data may also be stored in the computer-readable storage medium.

[0196] The content of the above method embodiments is applicable to this embodiment. The specific functions implemented in this embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments. Therefore, they will not be repeated here.

[0197] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0198] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0199] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0200] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0201] This invention also provides a computer program product, including a computer program or computer instructions, which are stored in a memory. A processor of a computer device reads the computer program or computer instructions from the memory and executes the computer program or computer instructions, causing the computer device to perform the above-described method.

[0202] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0203] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

Claims

1. A visual classification method based on dynamic multi-scale spatial blocks, characterized in that, The method includes the following steps: The image to be classified and the trained dynamic multi-scale spatial block visual classification network are obtained; wherein, the dynamic multi-scale spatial block visual classification network includes a backbone network, a dynamic multi-scale spatial module and a classification head; The image to be classified is input into the dynamic multi-scale spatial block visual classification network. The backbone network extracts features from the image to obtain an initial feature map. The dynamic multi-scale spatial module processes the initial feature map to obtain an enhanced feature map. The dynamic multi-scale spatial module includes a dynamic Tanh attention module and a multi-functional feature enhancement module. The dynamic Tanh attention module performs dynamic nonlinear preprocessing on the initial feature map to obtain an intermediate feature map, and the multi-functional feature enhancement module enhances the intermediate feature map to obtain the enhanced feature map. The enhanced feature map is input into the classification head, and the visual classification result is output.

2. The method according to claim 1, characterized in that, The dynamic Tanh attention module performs dynamic nonlinear preprocessing on the initial feature map to obtain an intermediate feature map, including: The initial feature map is input into the first dynamic Tanh normalization layer, and an adaptive nonlinear transformation is performed on the initial feature map through a learnable scaling parameter to obtain the first calibration feature map. The first calibration feature map is input to a self-attention mechanism to model the global context relationship, resulting in an attention feature map. The attention feature map is input into the second dynamic Tanh normalization layer for secondary enhancement to obtain the second calibration feature map; The second calibration feature map is input into the feedforward network for local feature transformation to obtain the intermediate feature map.

3. The method according to claim 2, characterized in that, The step of performing an adaptive nonlinear transformation on the initial feature map using learnable scaling parameters to obtain a first calibrated feature map includes: The initial feature map is multiplied by the learnable scaling parameter and then input into the hyperbolic tangent activation function. The output of the hyperbolic tangent activation function is multiplied by the learnable scaling coefficient and then added to the learnable translation parameter to obtain the first calibration feature map.

4. The method according to claim 1, characterized in that, The multifunctional feature enhancement module enhances the intermediate feature map to obtain the enhanced feature map, including: The intermediate feature map is input into the temperature scaling spatial attention module for global context information aggregation and modulation to obtain a global modulated feature map. The global modulation feature map is input into the multi-scale visual adapter module for multi-scale local spatial feature extraction to obtain a multi-scale enhanced feature map. The multi-scale enhanced feature map and the initial feature map are input into the spatial-channel enhancement feedforward network module for spatial-channel deep fusion to obtain the enhanced feature map.

5. The method according to claim 4, characterized in that, The multifunctional feature enhancement module includes a temperature-scaling spatial attention module. The intermediate feature map is input into the temperature-scaling spatial attention module for global context information aggregation and modulation to obtain a global modulated feature map, including: The intermediate feature map is projected into a query matrix, a key matrix, and a value matrix through a linear transformation. Calculate the eigenvector of each eigenvector in the key matrix. The norm squared value, the said The norm squared value is multiplied by the learnable temperature parameter and then input into the Softmax function to generate the location importance weights; The positional importance weights are weighted and aggregated with the square of the value matrix to obtain global contextual features; The attention weights are obtained by calculating the difference between each feature vector and the global context features through a reciprocal nonlinear transformation. The global modulation feature map is obtained by multiplying the attention weight by the product of the query matrix and the position importance weight.

6. The method according to claim 5, characterized in that, The multi-functional feature enhancement module includes a multi-scale visual adapter module. The step of inputting the global modulation feature map into the multi-scale visual adapter module for multi-scale local spatial feature extraction to obtain a multi-scale enhanced feature map includes: The global modulation feature map is projected onto a low-dimensional space through a 1×1 convolution to obtain the projected feature map; The projected feature map is convolved by parallel multi-branch depthwise separable convolution, where the first branch uses a 3×3 convolution kernel, the second branch uses a 5×5 convolution kernel, and the third branch uses a 7×7 convolution kernel, resulting in three branch feature maps with different receptive fields. The three branch feature maps are arithmetically averaged and then residually concatenated with the input feature to obtain a fused feature map. The fused feature map is processed by the GELU activation function and the Dropout regularization layer, and then channel information is exchanged through 1×1 convolution to obtain the multi-scale enhanced feature map.

7. The method according to claim 6, characterized in that, The multi-functional feature enhancement module includes a spatial-channel enhancement feedforward network module. The step of inputting the multi-scale enhanced feature map and the initial feature map into the spatial-channel enhancement feedforward network module for spatial-channel deep fusion to obtain the enhanced feature map includes: The initial feature map is compressed in the spatial dimension by global average pooling to obtain the channel descriptor; The channel descriptor is input into a multilayer perceptron to generate channel attention weights. The channel attention weights are then weighted with the multi-scale enhanced feature map to obtain channel enhanced features. The multi-scale enhanced feature map is processed by average pooling and a convolutional encoder-decoder structure to extract multi-scale spatial context information, resulting in spatial enhanced features. The channel enhancement features and the spatial enhancement features are concatenated along the channel dimension and then fused using a 1×1 convolution to obtain the enhancement feature map.

8. A visual classification system based on dynamic multi-scale spatial blocks, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Low-quality image-oriented method for detecting graspable target based on EMSDH-YOLO network

    CN120259847A

  • Complex underwater side-scan sonar exploration detection method and device based on multi-dimensional attention collaborative lightweight anti-noise detection framework

    CN120871150A