Image classification method based on frequency domain features and related equipment
By combining a two-dimensional discrete cosine transform module and a depth-separable MLP module, the problem of global semantic and local detail representation in computer vision models under limited resources is solved, a lightweight vision model is constructed to meet the low latency and low power consumption requirements of mobile terminals and other applications, and efficient image classification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-27
AI Technical Summary
Existing computer vision models, under the constraints of limited computing resources and energy consumption, struggle to balance global semantic modeling capabilities with local detail representation capabilities, resulting in a three-way contradiction between efficiency, accuracy, and detail. This makes it difficult to meet the low latency and low power consumption requirements of application scenarios such as mobile terminals, drones, and autonomous driving.
By employing a cascaded two-dimensional discrete cosine transform module and a depth-separable MLP module, global structural features and local detail features of the image are extracted through frequency domain transformation, and a mapping process that decouples channel and spatial features is performed to construct a lightweight visual model.
While maintaining high accuracy, it significantly reduces computational complexity and storage footprint, adapting to the low latency and low power consumption requirements of application scenarios such as mobile terminals, drones, and autonomous driving, achieving a good balance between model expressive power and computational cost.
Smart Images

Figure CN121746776A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of computer vision and artificial intelligence, and particularly relates to an image classification method based on frequency domain features and related equipment. BACKGROUND
[0002] With the continuous evolution of computer vision tasks from static recognition to dynamic understanding and from single-modal perception to multi-modal cognition, the complexity of model structure and the demand for computing power are showing a continuous upward trend. Although deep learning frameworks have improved the performance of image recognition and semantic understanding, under the constraints of limited computing resources and energy consumption, how to balance the global semantic modeling ability and the local detail representation ability, and build a lightweight visual model with high precision and high efficiency, has become a long-standing core scientific problem in this field. Specifically, mobile terminals, unmanned aerial vehicles, intelligent driving and edge computing applications generally require models to have low latency, low power consumption and fast response characteristics; while multi-scale object recognition and fine-grained classification in complex scenarios require models to capture long-range dependencies and local texture changes at the same time, maintaining global consistency while accurately depicting edges and details. However, these two types of requirements are often difficult to achieve in existing architectures: Convolutional Neural Networks (CNN) rely on local receptive fields to achieve feature extraction, although they are computationally efficient, but their hierarchical stacking method limits the model's ability to perceive global structures; Visual Transformer (ViT) establishes global dependencies between image blocks through multi-head self-attention mechanism, which performs well in capturing long-range semantics, but its computational and storage complexity grows quadratically with the length of the input sequence, and it is not good at capturing local texture. The "efficiency-precision-detail" three-way contradiction that arises from this is the most prominent structural dilemma in visual model design. Improving the expression ability will inevitably bring a computational burden, while reducing the complexity will often compromise the accuracy and detail fidelity of the features. This contradiction has become a common problem that needs to be solved in the process of making computer vision models deployable.
[0003] To address these challenges, the academic community has proposed various structural improvements and lightweight strategies to achieve a balance between model expressive power and computational cost. In convolutional neural networks, researchers have reduced redundant parameters through methods such as pruning, quantization, and knowledge distillation to achieve a trade-off between performance and efficiency. However, excessive compression can lead to feature degradation and loss of fine-grained information, limiting the model's discriminative ability. On the other hand, while efficient operators such as depthwise separable convolution and pointwise convolution can reduce complexity, their limited local receptive fields make it difficult to capture global semantic dependencies. In contrast, the Visual Transformer (ViT) achieves global modeling through a multi-head self-attention mechanism. Variants such as the Swin Transformer, CSWin Transformer, and PoolFormer alleviate the computational burden through window partitioning and attention approximation, but they still struggle to balance high-frequency detail fidelity with computational resource constraints, failing to fundamentally resolve the contradiction between computational overhead and feature representation in the Transformer structure. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides an image classification method and related equipment based on frequency domain features. Its purpose is to construct a lightweight visual model with both high accuracy and high efficiency, while taking into account global semantic modeling capabilities and local detail representation capabilities under the constraints of limited computing resources and energy consumption. This effectively solves the three-way contradiction of "efficiency-accuracy-detail" and achieves a good balance between model expressive power and computational cost. It meets the needs of mobile terminals, drones, intelligent driving and edge computing applications for low latency, low power consumption, fast response and multi-scale object recognition and fine-grained classification in complex scenarios.
[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: According to a first aspect of the present invention, an image classification method based on frequency domain features is provided, comprising: Obtain the image to be classified; The image to be classified is input into a pre-trained image classification model, and the classification result of the image to be classified is output. The pre-trained image classification model includes a cascaded two-dimensional discrete cosine transform module and a depthwise separable MLP module. The two-dimensional discrete cosine transform module is used to perform frequency domain transformation on the input image features to simultaneously extract global structural features and local detail features of the image, and output a fused frequency domain feature that integrates the global structural features and local detail features. The depthwise separable MLP module is used to perform channel and spatial feature decoupling mapping on the fused frequency domain feature, and output the final feature representation for classification.
[0006] In one possible implementation of the first aspect, the two-dimensional discrete cosine transform module performs a frequency domain transform on the input image features, including: The input image features are segmented into multiple feature parts along the channel dimension; A two-dimensional discrete cosine transform is performed on each of the aforementioned feature parts to obtain a corresponding two-dimensional spectral representation, wherein the element values in the two-dimensional spectral representation represent the amplitude of the corresponding frequency component; Assign a corresponding frequency component identifier to the two-dimensional spectral representation of each feature portion; Multiple two-dimensional spectral representations, each assigned a frequency component identifier, are spliced along the channel dimension to form a fused frequency domain feature containing different frequency components.
[0007] In one possible implementation of the first aspect, assigning a corresponding frequency component identifier to the two-dimensional spectral representation of each of the feature portions includes: For the first The two-dimensional spectral representation of each feature part is assigned an index pair. As a frequency component identifier, where and They represent the first The horizontal and vertical frequency indices corresponding to each feature part in the two-dimensional frequency domain.
[0008] In one possible implementation of the first aspect, the two-dimensional discrete cosine transform module further adds the input image features to the output fused frequency domain features via residual connection to obtain the input features passed to the depth-separable MLP module.
[0009] In one possible implementation of the first aspect, the depth-separable MLP module performs a mapping process to decouple the channel and spatial features of the fused frequency domain features, including the following operations performed sequentially: The first pointwise convolution operation is used to reduce the dimensionality and linearly combine the fused frequency domain features of the input; Depthwise separable convolution operations are used to extract the local correlations and spatial information of the reduced-dimensional features; Apply a nonlinear activation function to the features output by depthwise separable convolution operations; The second pointwise convolution operation is used to perform nonlinear transformation and encoding on the activated features to generate the final feature representation.
[0010] In one possible implementation of the first aspect, the depthwise separable convolution operation includes: Channel-wise convolution: Using independent convolution kernels, spatial convolution is performed on each channel of the dimensionality-reduced features to extract spatial features within each channel. Pointwise convolution is performed, using a 1×1 convolution kernel to fuse the spatial features within each channel of the output of the channel-wise convolution.
[0011] In one possible implementation of the first aspect, the pre-trained image classification model is formed by sequentially cascading at least one processing unit consisting of the two-dimensional discrete cosine transform module and the depth separable MLP module.
[0012] According to a second aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the aforementioned image classification method based on frequency domain features.
[0013] According to a third aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned image classification method based on frequency domain features.
[0014] According to a fourth aspect of the present invention, a computer program product is provided that, when executed by a processor, implements the aforementioned image classification method based on frequency domain features.
[0015] Compared with the prior art, the present invention has at least the following beneficial effects: This invention provides an image classification method based on frequency domain features. By combining a parameterless 2D Discrete Cosine Transform (DCT) module with a lightweight Deep Separable Microprocessor (MLP) module, it effectively solves the triadic contradiction of "efficiency-accuracy-detail". Specifically, firstly, the DCT is used to directly and efficiently separate and fuse low-frequency global information and high-frequency local details of an image in the frequency domain. This allows the model to capture long-range structural dependencies and fine texture variations simultaneously in a single transformation, overcoming the shortcomings of weak global perception in convolutional neural networks and insufficient local detail representation in visual Transformers. Secondly, since the DCT itself is a fixed, parameterless mathematical transformation, feature extraction can be achieved without training, which fundamentally reduces a large number of learnable parameters and corresponding computational overhead. Furthermore, the Deep Separable MLP module significantly reduces the overall number of parameters and floating-point operations of the model through a channel-space decoupling mapping method. Therefore, while maintaining competitive image classification accuracy, this invention reduces the computational complexity, storage footprint, and inference energy consumption of the model, thereby enabling the constructed lightweight visual model to better adapt to application scenarios with strict requirements for low latency, low power consumption, and fast response, such as mobile terminals, drones, autonomous driving, and edge computing, achieving a good balance between model expressive power and computational cost. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the specific embodiments of the present invention, the drawings used in the description of the specific embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a flowchart of an image classification method based on frequency domain features according to the present invention; Figure 2 This invention relates to a network architecture for an image classification model in an image classification method based on frequency domain features. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] like Figure 1 As shown, this invention provides an image classification method based on frequency domain features, specifically including the following steps: Step S1: Obtain the image to be classified.
[0020] Specifically, digital images that need to be classified and recognized can be acquired through image sensors, cameras, storage devices, or network transmission. These images can be RGB images, grayscale images, or other multi-channel images. It should be understood that before inputting the image into the model, a series of preprocessing operations are usually required, such as adjusting the size to the model's preset input resolution and normalizing pixel values, to meet the model's input requirements.
[0021] Step S2: Input the image to be classified into a pre-trained image classification model and output the classification result of the image to be classified.
[0022] Combination Figure 2 As shown, the pre-trained image classification model includes a cascaded two-dimensional discrete cosine transform module and a depth-separable MLP module.
[0023] In this embodiment, the pre-trained image classification model is formed by cascading at least one processing unit consisting of the two-dimensional discrete cosine transform module and the depthwise separable MLP module. For example, the model may contain N such cascaded processing units (N is an integer greater than or equal to 1).
[0024] Specifically, the two-dimensional discrete cosine transform module is used to perform frequency domain transformation on the input image features to simultaneously extract the global structural features (corresponding to low-frequency components) and local detail features (corresponding to high-frequency components) of the image, and outputs a fused frequency domain feature that integrates the global structural features and local detail features. Its specific workflow is as follows: First, the input image features are segmented into multiple feature parts along the channel dimension. Assume the shape of the input feature map is [ H, W, C ], H For height, W For width, C Given the number of channels, it can be evenly divided into... n Group, n The number of channels in each feature group is an integer greater than 1. C / n Segmentation does not change the spatial dimensions of the feature map.
[0025] Next, a two-dimensional discrete cosine transform (2D-DCT) is performed on each of the aforementioned feature portions to obtain a corresponding two-dimensional spectral representation, wherein the element values in the two-dimensional spectral representation represent the amplitude of the corresponding frequency component. Specifically, for each shape [ H, W, C / n The feature portion of the input is transformed independently on each channel using 2D-DCT. The resulting two-dimensional spectral representation has the same spatial dimensions as the input feature portion. H, W ], where each position ( u , v The element value in ) represents the frequency component of that feature in that channel. u , v ) range.
[0026] Then, a corresponding frequency component identifier is assigned to the two-dimensional spectral representation of each feature portion. In one specific implementation, this can be the first... indivual( =1, 2, …, n The two-dimensional spectral representation of the feature part is assigned to index pairs. As a frequency component identifier, and They represent the first The horizontal and vertical frequency indices corresponding to each feature part in the two-dimensional frequency domain.
[0027] Finally, the multiple two-dimensional spectral representations, each assigned a frequency component identifier, are spliced along the channel dimension to form a fused frequency domain feature containing different frequency components.
[0028] In one implementation, to facilitate gradient flow and preserve original information, the two-dimensional discrete cosine transform module further adds the input image features and the output fused frequency domain features element-wise through residual connections to obtain the input features passed to the subsequent depth-separable MLP module.
[0029] Specifically, the depth-separable MLP module is used to perform channel-spatial feature decoupling mapping on the fused frequency domain features, outputting a final feature representation for classification. That is, this module performs channel-spatial feature decoupling mapping on the features from the two-dimensional discrete cosine transform module that incorporate frequency domain information, outputting a final feature representation for classification. Its operations are executed sequentially: The first step, the first pointwise convolution operation, is used to reduce the dimensionality and linearly combine the input fused frequency domain features. This operation uses a 1×1 convolution kernel to linearly project the input fused frequency domain features, mainly for dimensionality reduction and cross-channel linear combination, reducing the computational overhead of subsequent steps.
[0030] The second step, depthwise separable convolution, is used to extract the local correlations and spatial information of the dimensionality-reduced features. This operation, aimed at extracting the local correlations and spatial context information of the dimensionality-reduced features, comprises two sub-steps: Channel-wise convolution is performed using independent convolution kernels to spatially convolve each channel of the dimensionality-reduced features, extracting spatial features within each channel. Specifically, multiple independent two-dimensional convolution kernels with a spatial size of K×K (e.g., 3×3) are used to perform convolution operations on each channel of the input features, extracting spatial features within each channel. This step has the same number of input and output channels, and the number of parameters is linearly related to the number of channels, making it computationally efficient.
[0031] Pointwise convolution is performed, using a 1×1 convolution kernel to fuse the spatial features within each channel of the output from the channel-wise convolution. In other words, after channel-wise convolution, a 1×1 convolution kernel is used to perform cross-channel fusion and linear combination of the spatial features output from the previous step to integrate information from different channels.
[0032] The third step is to apply a non-linear activation function, such as the GELU activation function, to the features output by the depthwise separable convolution operation to introduce non-linear transformation capabilities.
[0033] The fourth step, the second pointwise convolution operation, is used to perform non-linear transformation and encoding on the activated features to generate the final feature representation. Specifically, this operation again uses a 1×1 convolution kernel to perform non-linear transformation and encoding on the activated features, typically restoring or mapping the number of channels to the same dimension C as the module input, thereby generating the final feature representation.
[0034] Through the cascaded collaboration of the aforementioned two-dimensional discrete cosine transform module and the deep separable MLP module, the model can explicitly model the global structure (low frequency) and local details (high frequency) in the frequency domain, and utilize the efficient deep separable structure for feature mapping, thereby achieving high-precision and detail-preserving image classification with limited computing power.
[0035] Combination Figure 2 As shown below, the working process of the two core modules that constitute the processing unit will be described in detail.
[0036] The processing unit comprises two modules: a 2D Discrete Cosine Transform (DCT) module and a Deep Separable Multi-Level Processing (MLP) module. The DCT module decomposes the image signal into high-frequency and low-frequency components by performing a frequency domain transformation on the input features, thereby extracting edge details and global structural information to achieve efficient multi-frequency feature modeling. The DCT module leverages the parity symmetry and energy aggregation characteristics of DCT to reduce computational cost and enhance feature representation capabilities without increasing learnable parameters. The Deep Separable MLP module employs a combination of channel-wise and point-wise convolutions to decouple channel and spatial features, significantly reducing the number of model parameters and FLOPs, further improving the network's lightweight nature and deployability.
[0037] The following is a detailed explanation of the two-dimensional discrete cosine module. First, to reduce covariance shift between features and make the feature distribution more stable, the embedding vectors are processed by a normalization layer. Second, to preserve the overall structure and low-frequency information while capturing high-frequency detail features and obtaining richer spatial and spectral features to further enhance information representation, the DCT module utilizes the duality in 2D DCT to achieve information fusion. By stacking multiple blocks and performing 2D DCT transformation, the input is transformed between the frequency and time domains of the DCT layer, thereby fully fusing the information between each block.
[0038] The specific implementation process of the two-dimensional discrete cosine module is as follows: First, the normalized features are fed into the two-dimensional discrete cosine module, and the features are... Divided along the channel dimension into multiple feature parts, each part is .in , , ,and It can be Divide the array to form a series of multidimensional arrays with the same number of channels to obtain the frequency domain representation of each feature. Use 2D DCT to convert each feature into a two-dimensional array, where each element represents the importance of a specific frequency component in the overall signal. Simultaneously, assign frequency components to the 2D DCT results, distributing the 2D DCT results for each feature to the corresponding frequency components, thus achieving feature extraction of the input signal in the frequency domain.
[0039]
[0040] in, As a corresponding 2D DCT frequency component index, As compressed Dimensional vector.
[0041] Then, the concat operation is used to concatenate the 2D DCT results of each feature part along the channels, obtaining a long vector containing different frequency components of the original signal. By integrating different frequency components, the model can better understand and utilize the frequency domain features of the input sequence, thereby obtaining more comprehensive frequency domain information and improving the model's feature representation capability.
[0042]
[0043] Finally, the original input features are added to the features transformed by DCT via residual connections. This not only alleviates the vanishing gradient problem but also promotes efficient information transfer, allowing the model to fully utilize both the low-level features of the original input and the high-level features obtained through DCT transformation, while also enabling it to better learn the representation of the input sequence. The expression is:
[0044] in, Layer Normalization; This is a DCT operation used to mix information from all terms in multiple frequency components.
[0045] The following is a detailed description of the depth-separable MLP module: By utilizing residual connections, the input features are added to the features processed by a depthwise separable MLP module and a Layer Norm layer, thereby achieving feature reuse and smooth information flow. This invention effectively avoids the problems of vanishing and exploding gradients, enabling more comprehensive and effective encoding of image features, thus achieving better performance and generalization capabilities.
[0046] Spatial MLPs introduce fully connected operations when processing images, resulting in high computational complexity and limiting their application in resource-constrained environments. Furthermore, fully connected operations violate the translation invariance of traditional convolutional neural networks because the parameters of fully connected layers are learned independently for each location, rather than being shared. This can lead to inconsistent feature extraction at different locations in the image and poor robustness to inputs involving geometric transformations such as translation.
[0047] To address the aforementioned issues, the depthwise separable MLP module introduces depthwise separable convolution, projecting the location embeddings into a high-dimensional space and generating location-aware vectors. This helps the network better understand the local structure and global information of the image. By interacting with global information, more context-related information is obtained, thereby better capturing features at different locations in the image and improving the network's robustness to geometric transformations such as translation.
[0048] First, the input image features are reduced in dimensionality using 1×1 convolution, which adapts the linear combination of features to the dimensionality and reduces the number of parameters, making the network more lightweight.
[0049] Secondly, a 3×3 depthwise separable convolution is employed to extract local correlations of image features without increasing the number of parameters. To capture detailed information and spatial correlations in the image, the depthwise convolution independently performs a 3×3 convolution operation on each input channel. Since there are no shared parameters between convolution kernels, the number of parameters in the model can be significantly reduced, achieving model lightweighting. To obtain information projected from different channels to specific locations, pointwise convolution performs a 1×1 convolution operation on the output of the depthwise convolution, fusing information between channels to generate the final output feature map. This significantly reduces the number of parameters while improving model efficiency and inference speed. Simultaneously, the GELU activation function performs a non-linear transformation on the output of the depthwise separable convolution layer, effectively capturing complex relationships between features and enhancing the network's expressive power.
[0050] Finally, 1×1 convolutions are used instead of fully connected layers to perform non-linear transformations and encoding of features. Compared to fully connected layers, which require establishing connections between each input neuron and each output neuron, resulting in a quadratic increase in the number of parameters, 1×1 convolutions can more effectively learn more abstract and expressive feature representations. This improves the network's performance and generalization ability while avoiding the quadratic increase in the number of parameters, further enhancing the model's performance.
[0051]
[0052]
[0053]
[0054] in, and These represent convolution operations and depthwise separable convolution operations, respectively. It is a non-linear activation function GELU.
[0055] It should be noted that image classification models require supervised end-to-end pre-training on large image datasets (such as ImageNet-1K) to optimize learnable parameters in the deep separable MLP module, such as convolutional kernel weights, while the DCT operation in the 2D discrete cosine transform module itself does not require training. The training process includes forward propagation to calculate the loss and backpropagation to update the model parameters until the model converges.
[0056] The performance of the model is evaluated using the following metrics: Classification accuracy (Accuracy, Acc): Acc represents the proportion of correctly classified samples out of the total number of samples. It is one of the most important evaluation metrics for measuring the accuracy of a classification model. The calculation formula is as follows:
[0057] in, For true class, True negative class False positives False negative class.
[0058] Floating-point operations (FLOPs): FLOPs represent the number of floating-point operations performed by the model during forward propagation. It is one of the most important metrics for evaluating the computational complexity of a neural network model. The calculation formula is as follows:
[0059] in, , and These represent the height, width, and number of channels of the input feature map, respectively. As the kernel size The number of output channels.
[0060] Parameters: Parameters represent the total number of learnable variables within the model. They are one of the most important metrics for measuring the size and complexity of the model. The calculation formula is as follows:
[0061] in, and These are the number of channels used for input and output, respectively. This indicates the kernel size.
[0062] To verify that the network model proposed in this invention has good classification performance, experiments were conducted on the ImageNet-1K dataset and compared with existing methods. The results are shown in Table 1.
[0063] Table 1 Comparison of classification performance on the ImageNet-1K dataset
[0064] Table 1 shows that our invention requires only 12M parameters and 1.8G FLOPs, achieving a Top-1 accuracy of 78.5% on ImageNet-1K. Compared to CSWin-T (23M parameters), the number of parameters is reduced by 47.83%; compared to CViT-15 (5.6G FLOPs), the number of FLOPs is reduced by 67.86%. Experimental results demonstrate that by replacing the traditional self-attention module with 2D DCT operations, our invention significantly reduces the number of parameters and computational cost while maintaining performance. For example, compared to the 29M parameters and 4.5G FLOPs of the Swin-T network, our invention uses only 12M parameters and 1.8G FLOPs, resulting in a substantial reduction in parameters and computational cost, thus greatly saving on storage and computational resources.
[0065] Furthermore, with the same number of parameters (12M) and FLOPs (1.8G), the accuracy of this invention is 1.3% higher than PoolFormer-S12. By introducing a DCT module, the network can effectively capture more detailed features of high-frequency components in the input signal while preserving global average information. 2D DCT consists of a DC component and other frequency components. The DC component contains overall structure and low-frequency information, while the other frequency components contain higher-frequency detailed information, avoiding the loss of other frequency information. Therefore, the method of this invention can more accurately capture the local spatial and frequency information of the target object, providing a more detailed and richer feature representation. Meanwhile, experimental results show that the network proposed in this invention achieves highly competitive performance with very few parameters and FLOPs.
[0066] Experiments show that by combining the characteristics of the DCT module, the model can better extract high-frequency component information from the input data. This information is fully utilized in subsequent layers, thereby reducing the computational cost and parameter requirements of those layers. Because some high-frequency details have already been captured and encoded by the DCT module, subsequent layers can focus more on processing complex low-frequency information. This approach significantly reduces the burden on the entire network and improves the model's performance and efficiency. Therefore, this invention is competitive in both performance and efficiency, providing an effective and efficient deep learning model.
[0067] To balance the efficiency of convolutional neural networks in local feature extraction with the superiority of visual Transformers in global semantic modeling, this invention takes a different approach. It utilizes a two-dimensional discrete cosine transform (DCT) method to convert image information into the frequency domain, treating spectral features as a compression process to effectively capture the image's frequency domain characteristics. Secondly, recognizing that different frequency regions represent different types of features, it extracts local features such as edges and textures in high-frequency regions and global features in low-frequency regions. This invention employs zero-learning-parameter 2D DCT operations to directly extract features from the frequency domain, eliminating the need for additional training and significantly reducing the number of trainable parameters. The depthwise separable MLP module replaces the traditional fully connected mapping layer with depthwise separable convolutions, significantly reducing the model's parameter count and computational complexity. The synergistic effect of these two approaches allows the model to maintain global semantic consistency while enhancing local detail representation, achieving a balance between lightweight structure, computational efficiency, and feature representation capabilities.
[0068] This invention improves the global-local feature representation capability and computational efficiency in image classification tasks through frequency domain modeling. This method fully utilizes the mathematical properties of Directional Transformation (DCT) in terms of energy concentration and frequency decomposition, extending the traditional feature extraction process, which relies on spatial convolution or self-attention, to the frequency domain, thereby achieving more efficient and discriminative feature learning. Specifically, the model first performs frequency domain mapping on the image embedding sequence using DCT and divides the input sequence into several independent token blocks. This block-based strategy ensures relative independence of features within each block, reducing the model's sensitivity to the input order. Simultaneously, by calculating the spectral similarity between blocks, cross-regional contextual dependencies can be explicitly modeled, thereby strengthening global semantic consistency and local feature synergy. This design not only effectively alleviates the problem of excessive computational complexity in long sequence modeling using traditional Transformers but also enhances the model's understanding of image structure and content hierarchy. At the feature representation level, DCT decomposes the original image signal into a linear combination of a set of orthogonal cosine bases, achieving a transformation from the spatial domain to the frequency domain. By analyzing coefficients at different frequencies, the model can capture semantic information at different levels: low-frequency coefficients reflect the overall contour and structural features of the image, reflecting global distribution patterns; high-frequency coefficients describe the texture details and edge information of the image, reflecting local change patterns. Based on this multi-frequency collaborative modeling mechanism, the model can maintain computational efficiency while taking into account both global structure and local detail features, thereby improving the completeness of feature representation and classification discriminative power. Furthermore, the parity and periodicity of DCT provide significant computational advantages for spectral calculation. Utilizing its fast transformation characteristics, spectral coefficients can be efficiently obtained without relying on complex learnable parameters, thus avoiding a large number of repetitive matrix multiplications and convolution operations, significantly reducing the computational load and storage overhead of the model. Compared with the traditional Transformer structure based on self-attention, this method effectively alleviates problems such as computational complexity, memory usage, and training instability while ensuring accuracy, achieving a balance between high performance, low complexity, and detail fidelity.
[0069] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of an image classification method based on frequency domain features.
[0070] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be Random Access Memory (RAM) or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the image classification method based on frequency domain features in the above embodiments.
[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.
[0072] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0075] This invention also provides a computer program product, which is used to execute any of the above-described image classification methods based on frequency domain features. Since the computer program product provided by this invention belongs to the same inventive concept as the image classification method based on frequency domain features described above, it possesses all the advantages of the aforementioned image classification method based on frequency domain features. Therefore, the beneficial effects of the computer program product provided by this invention will not be elaborated upon here.
[0076] In this invention, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0077] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention.
Claims
1. An image classification method based on frequency domain features, characterized in that, include: Obtain the image to be classified; The image to be classified is input into a pre-trained image classification model, and the classification result of the image to be classified is output. The pre-trained image classification model includes a cascaded two-dimensional discrete cosine transform module and a depthwise separable MLP module. The two-dimensional discrete cosine transform module is used to perform frequency domain transformation on the input image features to simultaneously extract global structural features and local detail features of the image, and output a fused frequency domain feature that integrates the global structural features and local detail features. The depthwise separable MLP module is used to perform channel and spatial feature decoupling mapping on the fused frequency domain feature, and output the final feature representation for classification.
2. The image classification method based on frequency domain features according to claim 1, characterized in that, The two-dimensional discrete cosine transform module performs frequency domain transformation on the input image features, including: The input image features are segmented into multiple feature parts along the channel dimension; A two-dimensional discrete cosine transform is performed on each of the aforementioned feature parts to obtain a corresponding two-dimensional spectral representation, wherein the element values in the two-dimensional spectral representation represent the amplitude of the corresponding frequency component; Assign a corresponding frequency component identifier to the two-dimensional spectral representation of each feature portion; Multiple two-dimensional spectral representations, each assigned a frequency component identifier, are spliced along the channel dimension to form a fused frequency domain feature containing different frequency components.
3. The image classification method based on frequency domain features according to claim 2, characterized in that, Assigning corresponding frequency component identifiers to the two-dimensional spectral representation of each feature portion includes: For the first The two-dimensional spectral representation of each feature part is assigned an index pair. As a frequency component identifier, where and They represent the first The horizontal and vertical frequency indices corresponding to each feature part in the two-dimensional frequency domain.
4. The image classification method based on frequency domain features according to claim 1, characterized in that, The two-dimensional discrete cosine transform module also adds the input image features to the output fused frequency domain features through residual connection to obtain the input features passed to the depth separable MLP module.
5. The image classification method based on frequency domain features according to claim 1, characterized in that, The depth-separable MLP module performs a mapping process to decouple the channel and spatial features of the fused frequency domain features, including the following operations performed sequentially: The first pointwise convolution operation is used to reduce the dimensionality and linearly combine the fused frequency domain features of the input; Depthwise separable convolution operations are used to extract local correlations and spatial information from dimensionality-reduced features; Apply a nonlinear activation function to the features output by depthwise separable convolution operations; The second pointwise convolution operation is used to perform nonlinear transformation and encoding on the activated features to generate the final feature representation.
6. The image classification method based on frequency domain features according to claim 5, characterized in that, The depthwise separable convolution operation includes: Channel-wise convolution: Using independent convolution kernels, spatial convolution is performed on each channel of the dimensionality-reduced features to extract spatial features within each channel. Pointwise convolution is performed, using a 1×1 convolution kernel to fuse the spatial features within each channel of the output of the channel-wise convolution.
7. The image classification method based on frequency domain features according to claim 1, characterized in that, The pre-trained image classification model is formed by sequentially cascading at least one processing unit consisting of the two-dimensional discrete cosine transform module and the depth separable MLP module.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements an image classification method based on frequency domain features as described in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements an image classification method based on frequency domain features as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, When the computer program product is executed by a processor, it implements an image classification method based on frequency domain features as described in any one of claims 1 to 7.