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

By employing a collaborative structure of dynamic Tanh attention module and multifunctional feature enhancement module, the problem of insufficient detection accuracy and generalization ability of existing models in complex natural scenes is solved, achieving efficient visual classification and detection results, and making it suitable for edge computing devices and complex natural scenes.

CN121600330BActive Publication Date: 2026-04-07GUANGDONG OCEAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-28
Publication Date
2026-04-07

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, making it difficult to simultaneously meet the requirements of lightweight deployment and high-precision recognition.

Method used

A dynamic multi-scale spatial block visual classification method is constructed. By introducing a dynamic Tanh attention module and a multi-functional feature enhancement module, the feature processing flow is optimized and reconstructed, including dynamic nonlinear preprocessing, global context relationship modeling, multi-scale local spatial feature extraction, and spatial-channel deep fusion.

Benefits of technology

It significantly improves the classification accuracy and robustness of the model in complex visual scenes, meeting the dual requirements of lightweight and high accuracy for edge computing and real-time coastal monitoring, and is suitable for target detection in edge devices and complex natural scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600330B_ABST
    Figure CN121600330B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer vision, in particular to a visual classification method and system based on a dynamic multi-scale space block; 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 image to be classified into the dynamic multi-scale space block visual classification network, performing feature extraction on the image to be classified through a main network to obtain an initial feature map, and processing the initial feature map through a dynamic multi-scale space module to obtain an enhanced feature map; inputting the enhanced feature map into a classification head, and outputting a visual classification result; the application effectively improves the precision and robustness of beach state recognition and other complex scenes, and is suitable for edge computing and real-time monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision, in particular to a visual classification method and system based on dynamic multi-scale spatial blocks. BACKGROUND

[0002] Target detection is a basic task in the field of 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, and YOLOv11 improves feature extraction capability by introducing a C2PSA module. However, when dealing with real-world complex natural scenes (such as remote sensing images and environmental monitoring videos), existing models still face challenges such as large differences in target size, dramatic changes in lighting conditions, similar textures between targets and backgrounds, irregular and blurred object boundaries, and complex long-distance spatial dependencies, resulting in decreased detection accuracy and insufficient generalization ability.

[0003] Existing models mainly use linear normalization methods, which lack the ability to adaptively adjust 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 complex spatial structure targets. Some studies use models with large parameters and complex calculations, which are difficult to deploy on resource-constrained edge devices; while lightweight models significantly decrease accuracy in complex scenes. Traditional feedforward networks and some attention mechanisms separate or simplify the modeling of spatial structure information and inter-channel dependencies, failing to achieve deep collaborative modulation of spatial context and channel features.

[0004] For beach state recognition, existing technologies are mostly based on improvements of older frameworks such as YOLO-V3, adding residual connections to improve gradient flow and training stability, or using Argus images and convolutional neural networks to classify single-barrier beach states. These methods have limitations in feature expression ability, multi-scale information fusion, and adaptive processing, making it difficult to meet the dual needs of lightweight deployment and high-precision recognition. SUMMARY

[0005] To solve the above technical problems, the present application provides a visual classification method and system based on dynamic multi-scale spatial blocks, which optimizes and restructures the feature processing flow by constructing a dual-module collaborative structure of dynamic Tanh attention modules and multi-functional feature enhancement modules, significantly improving the classification accuracy, robustness, and computational efficiency of the model in complex visual scenes.

[0006] In one aspect, the present application provides a visual classification method based on dynamic multi-scale spatial blocks, comprising the following steps:

[0007] obtaining an image to be classified and a trained dynamic multi-scale spatial block visual classification network; wherein the dynamic multi-scale spatial block visual classification network comprises a backbone network, a dynamic multi-scale spatial module and a classification head;

[0008] inputting the image to be classified into the dynamic multi-scale spatial block visual classification network, performing feature extraction on the image to be classified by the backbone network to obtain an initial feature map, and processing the initial feature map by the dynamic multi-scale spatial module to obtain an enhanced feature map; wherein the dynamic multi-scale spatial module comprises 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 performs feature enhancement on the intermediate feature map to obtain the enhanced feature map;

[0009] inputting the enhanced feature map into the classification head to output a visual classification result.

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

[0011] inputting the initial feature map into a first dynamic Tanh normalization layer, performing adaptive nonlinear transformation on the initial feature map by a learnable scaling parameter to obtain a first calibrated feature map;

[0012] inputting the first calibrated feature map into a partial self-attention mechanism to model global context relationships and obtain an attention feature map;

[0013] inputting the attention feature map into a second dynamic Tanh normalization layer for secondary enhancement to obtain a second calibrated feature map;

[0014] inputting the second calibrated feature map into a feedforward network for local feature transformation to obtain the intermediate feature map.

[0015] Optionally, the adaptive nonlinear transformation on the initial feature map by the learnable scaling parameter to obtain the first calibrated feature map comprises:

[0016] multiplying the initial feature map by a learnable scaling parameter and inputting it into a hyperbolic tangent activation function, multiplying the output result of the hyperbolic tangent activation function by a learnable scaling coefficient, and adding a learnable translation parameter to obtain the first calibrated feature map.

[0017] Optionally, the multi-functional feature enhancement module performs feature enhancement on the intermediate feature map to obtain the enhanced feature map, comprising:

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

[0019] input the globally modulated feature map into a multi-scale visual adapter module for multi-scale local spatial feature extraction to obtain a multi-scale enhanced feature map;

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

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

[0022] projecting the intermediate feature map into a query matrix, a key matrix and a value matrix through linear transformation;

[0023] calculating the norm square value of each feature vector in the key matrix, multiplying the norm square value with a learnable temperature parameter, and inputting the result into a Softmax function to generate a position importance weight;

[0024] performing weighted aggregation on the position importance weight and the square of the value matrix to obtain a global context feature;

[0025] calculating the difference between each feature vector and the global context feature through an inverse nonlinear transformation to obtain an attention weight;

[0026] multiplying the attention weight with the product of the query matrix and the position importance weight to obtain the globally modulated feature map.

[0027] Optionally, the multi-functional feature enhancement module includes a multi-scale visual adapter module, and the inputting of the globally modulated 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] projecting the globally modulated feature map into a low-dimensional space through 1x1 convolution to obtain a projected feature map;

[0029] performing convolution operation on the projected feature map through parallel multi-branch deep separable convolution, wherein a first branch uses a 3x3 convolution kernel, a second branch uses a 5x5 convolution kernel, and a third branch uses a 7x7 convolution kernel to obtain branch feature maps of three different receptive fields;

[0030] ​​The three branch feature maps are arithmetically averaged and connected with the input feature in residual connection to obtain a fusion feature map;

[0031] The fusion feature map is processed through a GELU activation function and a Dropout regularization layer, and then is processed through 1x1 convolution to interact channel information to obtain the multi-scale enhanced feature map.

[0032] Optionally, the multi-functional feature enhancement module comprises a space-channel enhancement feedforward network module, and the multi-scale enhanced feature map and the initial feature map are input into the space-channel enhancement feedforward network module to perform space-channel deep fusion to obtain the enhanced feature map, including:

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

[0034] The channel descriptor is input into a multi-layer perception to generate a channel attention weight, and the channel attention weight is weighted with the multi-scale enhanced feature map to obtain a channel enhanced feature;

[0035] The multi-scale enhanced feature map is extracted through average pooling and a convolutional encoder-decoder structure to obtain a spatial enhanced feature;

[0036] The channel enhanced feature and the spatial enhanced feature are spliced in a channel dimension and then are fused through 1x1 convolution to obtain the enhanced feature map.

[0037] In another aspect, an embodiment of the present application provides a visual classification system based on dynamic multi-scale spatial blocks, comprising:

[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 implements the method according to any one of the above.

[0041] In another aspect, an embodiment of the present application provides a computer readable storage medium, which stores a program executable by a processor, and the program executable by the processor is used to execute the method according to any one of the above when executed by the processor.

[0042] Embodiments of the present application include the following beneficial effects:

[0043] The application introduces a dynamic Tanh attention module by introducing a dynamic Tanh normalization, adopts a learnable scaling parameter to adaptively adjust a nonlinear mapping saturation interval, replaces a traditional linear normalization with a dynamic nonlinear transformation, effectively enhances the discriminability and stability of feature expression, and solves the problem of insufficient adaptive adjustment capability of feature distribution in a complex scene. By constructing a multifunctional feature enhancement module including a temperature scaling spatial attention module, a multi-scale visual adapter module and a spatial-channel enhanced feedforward network module, a complete optimization link from global context filtering, multi-scale local detail mining to spatial-channel information intelligent fusion is formed, and the perception ability of the model to multi-scale targets and complex spatial structures is significantly improved. By creating a double-module cooperative structure of the dynamic Tanh attention module and the multifunctional feature enhancement module in series, the feature processing process is decoupled into two stages of dynamic preprocessing and composite enhancement, efficient cooperation of front-end calibration and back-end refinement is realized, and the recognition accuracy is broken through on the premise of keeping low computational complexity. The application meets the dual requirements of lightweight and high precision for edge computing and real-time coastal monitoring, and provides a new technical path for lightweight target detection in complex natural scenes. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

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

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

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

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

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

[0050] Figure 6 is a structure diagram of a multi-scale visual adapter module in an embodiment of the present application;

[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 enhancement feedforward network module 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 a visual classification result is output. 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. 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 squared L2 norm of each eigenvector in the key matrix, multiply the squared L2 norm by the learnable temperature parameter, and input the result into the Softmax function to generate position 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.

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 the initial feature map is subjected to an adaptive nonlinear transformation 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 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 to 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.

5. The method according to claim 4, 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 multiscale 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.

6. 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 5.

7. 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 5.