Face sketch generation method and system based on Mama and wavelet convolution

By combining the Mamba-Transformer encoder and wavelet convolution module, the shortcomings of existing face sketching generation methods in terms of global structure modeling and detail preservation are addressed, achieving high-quality face sketching image generation and improving image clarity and artistic appeal.

CN120997036AActive Publication Date: 2025-11-21JIANGXI UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511530029.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2025-11-21
Estimated Expiration
2045-10-24

AI Technical Summary

Technical Problem

Existing face sketching generation methods have limitations in handling complex backgrounds and maintaining edge continuity and detail preservation, especially convolutional neural networks, which are insufficient in global structure modeling.

Method used

A face sketching generation method based on Mamba and wavelet convolution is adopted. Through the Mamba-Transformer encoder, style-enhanced wavelet convolution and decoder modules, the joint modeling of global dependencies and local details is achieved. Combined with the parallel setting of the visual Mamba module and the simplified variable-size window attention module, multi-directional difference features and multi-frequency domain wavelet features are captured, and cross-modal feature fusion and layer-by-layer spatial reconstruction are performed.

Benefits of technology

It significantly improves the clarity, detail reproduction, and realism of the generated sketch images, ensuring the matching of global style and structure while preserving detailed features, generating high-resolution, structurally accurate, and naturally styled facial sketch images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997036A_ABST
    Figure CN120997036A_ABST
Patent Text Reader

Abstract

The invention provides a face sketch generation method and system based on Mama and wavelet convolution, and the method comprises the steps: carrying out the processing through an image processing module, and obtaining a preliminary content feature and a preliminary style feature; adding position information to the preliminary content features to obtain the preliminary content features after the position information is added; inputting the initial content features after the position information is added into a Mamba-Transform encoder module for processing, and obtaining depth content features; inputting the preliminary style features into a style enhanced wavelet convolution module for processing to obtain style enhanced style features; the style features with the enhanced styles are input into a Mamba-Transform encoder module to be processed, and deep style features are obtained; and inputting the depth content features and the depth style features into a decoder module for processing to obtain a face sketch image. According to the invention, the face sketch image with high resolution, accurate structure and natural style can be generated.
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 face sketch generation method and system based on Mamba and wavelet convolution. BACKGROUND

[0002] Face sketch image generation technology converts face photos into structured sketch images, which has important application value in digital entertainment, judicial criminal investigation and medical diagnosis. In digital entertainment, this technology can quickly generate personalized artistic images, reducing the user creation threshold; in judicial criminal investigation, it can solve the matching problem of low-quality monitoring images and database photos through cross-modal matching, improving the efficiency of suspect identification; in medical diagnosis, sketch form can strengthen the visual expression of pathological features to assist doctors in accurate analysis.

[0003] Existing face sketch generation methods mainly include two categories: one is traditional methods, such as filter-based edge detection technology; the other is deep learning methods, including methods based on convolutional neural networks and Transformers. Traditional methods rely on hand-designed feature extraction and edge detection algorithms, which are simple to implement and computationally efficient, but have obvious limitations in handling complex backgrounds, maintaining edge continuity and preserving details.

[0004] With the development of deep learning, convolutional neural networks have been widely used due to their strong local feature extraction capabilities. Although some progress has been made in detail restoration, convolutional neural networks still have limitations in global structure modeling due to their limited receptive fields. SUMMARY

[0005] In view of the above situation, the main purpose of the present application is to propose a face sketch generation method based on Mamba and wavelet convolution to solve the above technical problems.

[0006] The present application proposes a face sketch generation method based on Mamba and wavelet convolution, which comprises the following steps: Step 1, input the content image and the style image into the image processing module, and crop the content image and the style image respectively to obtain the cropped content image and the cropped style image; flatten the cropped content image and the cropped style image respectively and process them through linear mapping to obtain preliminary content features and preliminary style features; add position information to the preliminary content features to obtain the preliminary content features with position information; Step 2, input the preliminary content features with position information into the Mamba-Transformer encoder module for processing to obtain deep content features; Step 3, input the preliminary style feature into the style-enhanced wavelet convolution module for processing to obtain a style-enhanced style feature; Step 4, input the style-enhanced style feature into the Mamba-Transformer encoder module for processing to obtain a deep style feature; Step 5, input the deep content feature and the deep style feature into the decoder module for processing to obtain a face sketch image.

[0007] The application also provides a face sketch generation system based on Mamba and wavelet convolution, which comprises: An image processing module, configured to: cut the content image and the style image respectively to obtain a cut content image and a cut style image; flatten the cut content image and the cut style image respectively and process them through linear mapping to obtain a preliminary content feature and a preliminary style feature; and add position information to the preliminary content feature to obtain a preliminary content feature with position information; A Mamba-Transformer encoder module, configured to: process the preliminary content feature with position information to obtain a deep content feature; process the preliminary style feature to obtain a style-enhanced style feature; A style-enhanced wavelet convolution module, configured to: process the preliminary style feature to obtain a style-enhanced style feature; A decoder module, configured to: process the deep content feature and the deep style feature to obtain a face sketch image.

[0008] Compared with the prior art, the application has the following beneficial effects: 1. By fusing the Mamba-Transformer encoder, the style-enhanced wavelet convolution and the decoder module, the application systematically solves the problems of structural distortion and texture blur in traditional cross-modal image generation, and significantly improves the clarity, detail restoration and realism of the generated sketch image.

[0009] 2. By parallelly arranging the visual Mamba module and the simplified variable-size window attention module, the application realizes the joint modeling of global dependence and local details, improves the expression ability of structural information and semantic features while ensuring the modeling efficiency.

[0010] 3、The application can capture multi-directional differential features and multi-frequency domain wavelet features at the same time by setting style enhancement convolution modules and wavelet convolution modules in parallel, thereby enhancing texture expression and style consistency, and significantly improving artistic feeling and detail level of generated images.

[0011] 4、The application realizes efficient fusion and layer-by-layer spatial reconstruction of cross-modal features by setting a Transformer decoder module and a convolution decoder module in parallel, which not only ensures the matching of global style and structure, but also preserves detail features in the gradual upsampling process, and finally generates high-resolution, structure-accurate and natural style face sketch images. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 A flowchart of the face sketch generation method based on Mamba and wavelet convolution proposed by the application is shown in the figure. Figure 2 A Mamba-Transformer encoder module diagram of the face sketch generation method based on Mamba and wavelet convolution proposed by the application is shown in the figure. Figure 3 A style enhancement wavelet convolution module diagram of the face sketch generation method based on Mamba and wavelet convolution proposed by the application is shown in the figure. Figure 4 A data diagram of quantitative comparison experiments of the application with different models on four different data sets is shown in the figure. Figure 5 A framework diagram of the face sketch generation system based on Mamba and wavelet convolution proposed by the application is shown in the figure. DETAILED DESCRIPTION

[0013] The embodiments of the application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the application, and cannot be understood as a limitation of the application.

[0014] These and other aspects of embodiments of the application will become clear from the following description and drawings. In these descriptions and drawings, some specific implementations of embodiments of the application are specifically disclosed to represent some ways of implementing the principles of embodiments of the application, but it should be understood that the scope of embodiments of the application is not limited thereto.

[0015] Please refer to Figure 1 The face sketch generation method based on Mamba and wavelet convolution proposed by the embodiments of the application includes the following steps: Step 1, input the content image and the style image into the image processing module, and respectively crop the content image and the style image to obtain the cropped content image and the cropped style image; flatten the cropped content image and the cropped style image respectively and process them through linear mapping to obtain the preliminary content feature and the preliminary style feature; add position information to the preliminary content feature to obtain the preliminary content feature after adding position information In step 1, the position information is added to the preliminary content feature to obtain the preliminary content feature after adding the position information, and the relationship formula corresponding to the process is: ; Among them, The preliminary content feature after adding the position information is represented by The preliminary content feature is represented by The position encoding is represented by The feature map is added element by element.

[0016] Step 2, input the preliminary content feature after adding the position information into the Mamba-Transformer encoder module for processing to obtain the deep content feature; Please refer to Figure 3 In step 2, the preliminary content feature after adding the position information is input into the Mamba-Transformer encoder module for processing to obtain the deep content feature, and the specific steps are as follows: The Mamba-Transformer encoder module is composed of a visual Mamba module and a simplified variable size window attention module in parallel; The preliminary content feature after adding the position information is processed by the state space model branch in the visual Mamba module to obtain the output feature after state space branch processing; The preliminary content feature after adding the position information is processed by the symmetric convolution branch in the visual Mamba module to obtain the output feature after symmetric convolution branch processing; The output feature after state space branch processing and the output feature after symmetric convolution branch processing are fused to obtain the output feature after processing by the visual Mamba module; The preliminary content feature after adding the position information is input into the simplified variable size window attention module for processing to obtain the predicted window size and the predicted window offset; The predicted window size, the predicted window offset and the preliminary content feature after adding the position information are used to obtain the dynamic window feature, the key matrix and the value matrix; The dynamic window feature, the key matrix and the value matrix are used to obtain the output feature after processing by the simplified variable size window attention module; The output features processed by the visual Mamba module and the output features processed by the simplified variable-size window attention module are weighted and fused, and then are processed by convolution to obtain fused features; The fused features are sequentially processed by a feedforward neural network and layer normalization to obtain deep content features; In the process of obtaining the fused features through the preliminary content features, the following relationship can be expressed: ; Among them, indicates processing by stacking three Mamba-Transformer modules in succession; In the process of processing the preliminary content features with added position information through the state space model branch in the visual Mamba module to obtain the output features processed by the state space branch, there is the following relationship: ; Among them, indicates the output features processed by the state space branch, indicates processing by the state space model, indicates processing by the SiLU activation function, indicates processing by the one-dimensional convolution layer, indicates processing by linear mapping; In this process, the state space model branch is used to capture global features with long-range dependencies; In the process of processing the preliminary content features with added position information through the symmetric convolution branch in the visual Mamba module to obtain the output features processed by the symmetric convolution branch, there is the following relationship: ; Among them, indicates the output features processed by the symmetric convolution branch; In this process, the symmetric convolution branch is used to alleviate the information loss caused by the order restriction to supplement local features; In the process of fusing the output features processed by the state space branch and the output features processed by the symmetric convolution branch to obtain the output features processed by the visual Mamba module, there is the following relationship: ; Among them, indicates the output features processed by the visual Mamba module, indicates channel dimension concatenation processing; In the process of inputting the preliminary content features with the added position information into the simplified variable size window attention module for processing to obtain the predicted window size and the predicted window offset, there are the following relationships: ; wherein, represents the predicted window size, represents the predicted window offset, represents the convolution operation, represents the activation function processing with a negative slope, represents the global average pooling processing; In this process, the simplified variable size window attention module is used to capture the local detailed features of the features; In the process of obtaining the dynamic window features, the key matrix and the value matrix by using the predicted window size, the predicted window offset and the preliminary content features with the added position information, there are the following relationships: ; wherein, represents the dynamic window features, represents the spatial Transformer operation, represents the key matrix, represents the value matrix, represents the reshaping operation of flattening the feature map into a sequence; In the process of obtaining the output features processed by the simplified variable size window attention module by using the dynamic window features, the key matrix and the value matrix, there are the following relationships: ; wherein, represents the local key matrix obtained by window sampling, represents the local value matrix obtained by window sampling, represents the local attention calculation, represents the output features processed by the simplified variable size window attention module, represents the linear window attention processing; In the process of weighting and fusing the output features processed by the visual Mamba module and the output features processed by the simplified variable size window attention module, and then processing by convolution to obtain the fusion features, there are the following relationships: ; wherein, represents the fusion features, and both represent trainable weights, denotes multiplication of corresponding position elements; In the process, the Mamba-Transformer module fuses the global and local features extracted by the visual Mamba module and the simplified variable size window attention module through trainable weights, and then integrates the channels through a convolution kernel with a size of 1x1 to obtain the fused features. In the process of sequentially performing feedforward neural network processing and layer normalization processing on the fused features to obtain the deep content features, the following relationships are included: ; wherein, denotes the deep content features, denotes layer normalization processing, denotes feedforward neural network processing; In the process, the fused features are enhanced through the feedforward network, and the layer normalization is combined to further extract structural and semantic information and obtain the deep content features.

[0017] Step 3, input the preliminary style features into the style enhancement wavelet convolution module for processing to obtain style-enhanced style features; Please refer to Figure 2 In step 3, the preliminary style features are input into the style enhancement wavelet convolution module for processing to obtain style-enhanced style features, and the specific steps are as follows: The style enhancement wavelet convolution module is composed of a style enhancement convolution module and a wavelet convolution module in parallel; The five difference convolutions in the style enhancement wavelet convolution module are used to perform multi-directional feature extraction processing on the preliminary style features to obtain output features of the sum path and output features of the concatenation path; The output features of the sum path and the output features of the concatenation path are used to obtain the gating weight, and the output features of the style enhancement convolution module are obtained using the gating weight; The preliminary style features are split using the wavelet convolution module to obtain a first layer low frequency component and a first layer high frequency component; The first layer low frequency component is decomposed by wavelet to obtain a second layer low frequency component and a second layer high frequency component; The second layer low frequency component and the second layer high frequency component are subjected to first layer inverse wavelet reconstruction processing to obtain an enhanced and recovered low frequency component; Based on the enhanced and recovered low frequency component, the first layer high frequency component and the first layer low frequency component, the second layer inverse wavelet reconstruction processing is performed to obtain the output features of the wavelet convolution module; The output features of the style enhancement convolution module and the output features of the wavelet convolution module are subjected to channel attention processing and spatial attention weighted fusion processing to obtain enhanced style features; linearly transforming the preliminary style feature to obtain a query vector of a matrix; stacking the preliminary style feature and the enhanced style feature and then linearly transforming to obtain a key vector of a matrix and a value vector of the matrix; processing through an attention mechanism according to the query vector of the matrix, the key vector of the matrix and the value vector of the matrix to obtain an attention weight; performing weighted summation on the preliminary style feature and the enhanced style feature by using the attention weight to obtain a weighted summation result, and then performing tensor dimension compression processing on the weighted summation result to obtain a style-enhanced style feature; In the process of using the five difference convolutions in the style-enhanced wavelet convolution module to perform multi-directional feature extraction processing on the preliminary style feature to obtain the output feature of the addition path and the output feature of the concatenation path, the following relationship exists: ; wherein, represents the output feature of the addition path, represents the preliminary style feature, represents a convolution index, represents the output feature of the concatenation path, represents a second layer convolution processing, represents an output feature of a normal convolution, represents an output feature of a center difference convolution, represents an output feature of an angle difference convolution, represents an output feature of a horizontal difference convolution, represents an output feature of a vertical difference convolution; In the process of obtaining the gating weight by using the output feature of the addition path and the output feature of the concatenation path, and then obtaining the output feature of the style-enhanced convolution module by using the gating weight, the following relationship exists: ; wherein, represents the gating weight, represents an element-wise Sigmoid function processing, represents the output feature of the style-enhanced convolution module; In the process of splitting the preliminary style feature by using the wavelet convolution module to obtain a first layer low-frequency component and a first layer high-frequency component, the following relationship exists: ; wherein, represents the first layer low-frequency component, , and all represent first layer high frequency components, representing a convolution processing through a corresponding wavelet filter; In this process, the preliminary style features are decomposed into low frequency and high frequency components through wavelet decomposition to extract global information and local information respectively, and first layer low frequency components and first layer high frequency components are obtained; In the process of wavelet decomposition of the first layer low frequency components to obtain the second layer low frequency components and the second layer high frequency components, there are the following relationships: ; wherein, representing the second layer low frequency components, , and all represent second layer high frequency components, representing a second layer wavelet decomposition processing; In this process, the low frequency components obtained by the first layer decomposition are wavelet decomposed again to obtain smaller scale low frequency and high frequency components, so as to obtain the second layer low frequency components and the second layer high frequency components; In the process of first layer inverse wavelet reconstruction processing of the second layer low frequency components and the second layer high frequency components to obtain the enhanced and recovered low frequency components, there are the following relationships: ; wherein, representing the enhanced and recovered low frequency components, representing a convolution operation on the four components after wavelet decomposition, representing a first layer inverse wavelet reconstruction processing; In this process, the four components decomposed by the second layer are convolved to extract features, and are recovered into low frequency features using the first layer inverse wavelet reconstruction to obtain the enhanced and recovered low frequency components; In the process of second layer inverse wavelet reconstruction processing based on the enhanced and recovered low frequency components, the first layer high frequency components and the first layer low frequency components, to obtain the output features of the wavelet convolution module, there are the following relationships: ; wherein, representing the output features of the wavelet convolution module, representing a second layer inverse wavelet reconstruction processing; In this process, the low frequency features reconstructed by twice wavelet reconstruction are fused with the first layer low frequency features , and combined with the first layer high frequency features, to generate complete, multi-scale and multi-directional enhanced style features through the second layer inverse wavelet reconstruction; In the process of linear transformation of the preliminary style feature to obtain the query vector of the matrix, there is a corresponding relationship as follows: ; Wherein, represents the query vector of the matrix; In the process of stacking the preliminary style feature and the enhanced style feature and then performing linear transformation to obtain the key vector of the matrix and the value vector of the matrix, there is a corresponding relationship as follows: ; Wherein, represents the key vector of the matrix, represents the value vector of the matrix, represents the merging of the two features along the newly added dimension, represents the enhanced style feature; In the process of processing by the attention mechanism according to the query vector of the matrix, the key vector of the matrix and the value vector of the matrix to obtain the attention weight, there is a corresponding relationship as follows: ; Wherein, and both represent the attention weight, represents the attention calculation; In this process, according to the query vector of the matrix , the key vector of the matrix and the value vector of the matrix , the attention mechanism is used to obtain the preference of each spatial position between the preliminary style feature and the enhanced style feature , so as to dynamically adjust the fusion ratio of the two types of features; In the process of weighted sum of the preliminary style feature and the enhanced style feature by using the attention weight to obtain the weighted sum result, and then performing tensor dimension compression processing on the weighted sum result to obtain the style enhanced style feature, there is a corresponding relationship as follows: ; Wherein, represents the style enhanced style feature, represents the tensor dimension compression processing.

[0018] Step 4, input the style enhanced style feature into the Mamba-Transformer encoder module for processing to obtain the deep style feature; In step 4, the style enhanced style feature is input into the Mamba-Transformer encoder module for processing to obtain the deep style feature, and the specific steps are as follows: The style-enhanced style feature is input into a Mamba-Transformer encoder module and sequentially processed by three stacked Mamba-Transformer modules to obtain global information and local information of the style-enhanced style feature; The global information and the local information of the style-enhanced style feature are sequentially processed by a feedforward network and layer normalization to obtain a deep style feature.

[0019] Step 5, input the deep content feature and the deep style feature into a decoder module for processing to obtain a face sketch image; In step 5, the deep content feature and the deep style feature are input into a decoder module for processing to obtain a face sketch image, which includes the following sub-steps: The decoder module is composed of three Transformer decoder modules and three convolutional decoder modules; Each Transformer decoder module is composed of three Transformer models; The deep content feature and the deep style feature are input into the first Transformer decoder module, the deep style feature is taken as the key vector and the value vector for attention calculation, and the deep content feature is taken as the query vector for attention calculation, and the first layer Transformer output feature is obtained by processing through the first Transformer model; the deep style feature is taken as the key vector and the value vector for attention calculation, and the first layer Transformer output feature is taken as the query vector for attention calculation, and the second layer Transformer output feature is obtained by processing through the second Transformer model; the deep style feature is taken as the key vector and the value vector for attention calculation, and the second layer Transformer output feature is taken as the query for attention calculation, and the third layer Transformer output feature is obtained by processing through the third Transformer model, and the third layer Transformer output feature is taken as the first layer fusion feature; The first layer fusion feature is input into the second Transformer decoder module for processing to obtain the second layer fusion feature; The second layer fusion feature is further input into the third Transformer decoder module for processing to obtain the third layer fusion feature, and the third layer fusion feature is taken as the final fusion feature; The final fusion feature is processed by three convolutional decoder modules to obtain a face sketch image; wherein the working process of the convolutional decoder module is 3x3 convolution operation and up-sampling operation.

[0020] Please refer to Figure 5The embodiment of the present application also provides a face sketch generation system based on Mamba and wavelet convolution, the system comprises: An image processing module is configured to: cut the content image and the style image respectively to obtain the cut content image and the cut style image, flatten the cut content image and the cut style image respectively, and perform linear mapping processing to obtain a preliminary content feature and a preliminary style feature; a Mamba-Transformer encoder module is configured to: process the preliminary content feature to obtain a deep content feature; process the preliminary style feature to obtain a style-enhanced style feature; a style-enhanced wavelet convolution module is configured to: process the preliminary style feature to obtain a style-enhanced style feature; a decoder module is configured to: process the deep content feature and the deep style feature to obtain a face sketch image.

[0021] Further, please refer to Figure 4 The present application also performs quantitative experiments on four data sets (CUHK, AR, XM2VTS and CUFSF), and adopts peak signal-to-noise ratio (PSNR), root mean square error (RMSE), learning perceptual image block similarity (LPIPS) and Fréchet Inception distance (FID) and other indicators for evaluation. The quantitative experimental results are shown in Figure 4 , wherein the best result is marked in bold, and the suboptimal result is marked in underlined. It can be seen from Figure 4 that the indicators of the method in this paper on the four data sets all achieve the best results, fully demonstrating that the method performs well in detail preservation, visual similarity and overall realism. The indicator results further verify the effectiveness of the method in this paper.

[0022] It should be understood that the parts of the present application can be realized by hardware, software, firmware or their combination. In the above-mentioned embodiments, a plurality of steps or methods can be realized by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if realized by hardware, and as in another embodiment, it can be realized by any one or their combination of the following technologies known in the art: discrete logic circuit with logic gate circuit for implementing logic function on data signal, application specific integrated circuit with suitable combination logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) and the like.

[0023] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0024] The above-described embodiments only express several implementation manners of the present application, which are described in a more specific and detailed manner, but cannot be understood as a limitation on the patent scope of the present application. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, which are all within the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A face sketching generation method based on Mamba and wavelet convolution, characterized in that, The method is implemented using a face sketching generation model, which consists of an image processing module, a Mamba-Transformer encoder module, a style-enhanced wavelet convolution module, and a decoder module. The specific steps for generating face sketches using the face sketching generation model are as follows: Step 1: Input the content image and style image into the image processing module, crop the content image and style image respectively to obtain cropped content image and style image; flatten the cropped content image and style image respectively and process them through linear mapping to obtain preliminary content features and preliminary style features; Location information is added to the preliminary content features to obtain the preliminary content features with the added location information; Step 2: Input the preliminary content features after adding location information into the Mamba-Transformer encoder module for processing to obtain deep content features; Step 3: Input the preliminary style features into the style-enhanced wavelet convolution module for processing to obtain style-enhanced style features; Step 4: Input the style-enhanced style features into the Mamba-Transformer encoder module for processing to obtain deep style features; Step 5: Input the depth content features and depth style features into the decoder module for processing to obtain a face sketch image.

2. The face sketching generation method based on Mamba and wavelet convolution according to claim 1, characterized in that, In step 1, location information is added to the preliminary content features to obtain the preliminary content features with added location information. The corresponding relationship in this process is as follows: ; in, This indicates the initial content characteristics after adding location information. Indicates preliminary content characteristics, Indicates position code, This indicates that the feature maps are added element by element.

3. The face sketching generation method based on Mamba and wavelet convolution according to claim 2, characterized in that, In step 2, the preliminary content features after incorporating location information are input into the Mamba-Transformer encoder module for processing to obtain depth content features. The specific steps are as follows: The Mamba-Transformer encoder module consists of a visual Mamba module and a simplified variable-size window attention module in parallel; The initial content features after adding location information are processed through the state space model branch in the visual Mamba module to obtain the output features after state space branch processing. The initial content features after adding location information are processed by the symmetric convolution branch in the visual Mamba module to obtain the output features after the symmetric convolution branch processing. The output features processed by the state space branch are fused with the output features processed by the symmetric convolution branch to obtain the output features processed by the visual Mamba module. The preliminary content features, after incorporating location information, are input into a simplified variable-size window attention module for processing to obtain the predicted window size and the predicted window offset. The dynamic window features, key matrix, and value matrix are obtained by using the predicted window size, predicted window offset, and preliminary content features after adding position information; The simplified variable-size window output features are obtained by utilizing dynamic window features, the key matrix, and the value matrix after processing by the attention module. The output features processed by the visual Mamba module and the output features processed by the simplified variable-size window attention module are weighted and fused, and then processed by convolution to obtain the fused features. The fused features are sequentially processed by a feedforward neural network and then by layer normalization to obtain deep content features.

4. The face sketching generation method based on Mamba and wavelet convolution according to claim 3, characterized in that, In the process of processing the initial content features after adding location information through the state space model branch in the visual Mamba module to obtain the output features after state space branch processing, the following relationship exists: ; in, This represents the output feature after state-space branching. This indicates that it is processed through a state-space model. This indicates that the process is performed using the SiLU activation function. This indicates processing via a one-dimensional convolutional layer. This indicates that the process has undergone linear mapping. In the process of processing the initial content features after adding location information through the symmetric convolution branch in the visual Mamba module to obtain the output features after symmetric convolution branch processing, the following relationship exists: ; in, This represents the output features after processing by symmetric convolution branches; In the process of fusing the output features after state space branch processing with the output features after symmetric convolution branch processing to obtain the output features after visual Mamba module processing, the following relationship exists: ; in, This represents the output features after processing by the visual Mamba module. This indicates splicing along the channel dimension; In the process of inputting the preliminary content features after incorporating location information into a simplified variable-size window attention module for processing to obtain the predicted window size and predicted window offset, the following relationship exists: ; in, Indicates the size of the prediction window. This represents the predicted window offset. This indicates that a convolution operation has been performed. This indicates that the device has been processed using an activation function with a negative slope. This indicates that global average pooling has been applied. In the process of obtaining dynamic window features, key matrix, and value matrix using the predicted window size, predicted window offset, and preliminary content features after adding positional information, the following relationships exist: ; in, Indicates dynamic window characteristics, This indicates that a spatial Transformer operation has been performed. Represents the key matrix, Represents a value matrix, This represents a reshaping operation that flattens a feature map into a sequence. In the process of obtaining the simplified variable-size window attention module output features using dynamic window features, key matrix, and value matrix, the following relationship exists: ; in, This represents the local key matrix obtained by window sampling. This represents the local value matrix obtained by window sampling. This indicates local attention computation. This represents the simplified output characteristics after processing by the variable-size window attention module. This indicates that the linear window attention process has been applied. In the process of weightedly fusing the output features processed by the visual Mamba module and the output features processed by the simplified variable-size window attention module, and then performing convolution to obtain the fused features, the following relationship exists: ; in, Indicates fusion features, and All of these represent trainable weights. This indicates that elements at corresponding positions are multiplied. The process of sequentially processing the fused features using a feedforward neural network and then performing layer normalization to obtain deep content features involves the following relationship: ; in, Indicates depth content characteristics, Presentation layer normalization processing, This indicates that the data has been processed by a feedforward neural network.

5. The face sketching generation method based on Mamba and wavelet convolution according to claim 4, characterized in that, In step 3, the preliminary style features are input into the style-enhanced wavelet convolution module for processing to obtain style-enhanced style features. The specific steps are as follows: The style-enhanced wavelet convolution module consists of a style-enhanced convolution module and a wavelet convolution module in parallel. Five differential convolutions in the style-enhanced wavelet convolution module are used to perform multi-directional feature extraction on the initial style features to obtain the output features of the summation path and the output features of the concatenation path. The gating weights are obtained by using the output features of the summation path and the output features of the concatenation path, and then the output features of the style enhancement convolutional module are obtained by using the gating weights. The initial style features are decomposed using a wavelet convolution module to obtain the first layer of low-frequency components and the first layer of high-frequency components. The first low-frequency component is decomposed into wavelet components to obtain the second low-frequency component and the second high-frequency component. The second-layer low-frequency component and the second-layer high-frequency component are subjected to the first-layer inverse wavelet reconstruction process to obtain the enhanced and recovered low-frequency component. Based on the enhanced recovery of low-frequency components, first-layer high-frequency components, and first-layer low-frequency components, the output features of the wavelet convolution module are obtained through second-layer inverse wavelet reconstruction. The output features of the style enhancement convolutional module and the output features of the wavelet convolutional module are subjected to channel attention processing and spatial attention weighted fusion processing to obtain enhanced style features; The initial style features are linearly transformed to obtain the query vector of the matrix; The initial style features and the enhanced style features are stacked and then a linear transformation is performed to obtain the key vector and value vector of the matrix. Based on the query vector, key vector, and value vector of the matrix, attention weights are obtained through an attention mechanism. The initial style features and the enhanced style features are weighted and summed using attention weights to obtain a weighted sum result. Then, the weighted sum result is subjected to tensor dimension compression to obtain the style-enhanced style features.

6. The face sketching generation method based on Mamba and wavelet convolution according to claim 5, characterized in that, In the process of using five differentiable convolutions in the style-enhanced wavelet convolution module to perform multi-directional feature extraction on the initial style features to obtain the output features of the summation path and the output features of the concatenation path, the following relationship is included: ; in, This indicates the output characteristics of the summation path. Indicates initial stylistic characteristics, Represents convolution and indexing. The output features represent the concatenation path. This indicates that the process has undergone a second convolutional layer. This represents the output features of a regular convolution. This represents the output feature of the central difference convolution. This represents the output features of the angular difference convolution. This represents the output features of the horizontal difference convolution. This represents the output features of vertical difference convolution; In the process of obtaining gating weights by utilizing the output features of the summation path and the concatenation path, and then using the gating weights to obtain the output features of the style enhancement convolutional module, the following relationship exists: ; in, Indicates the gating weight, This indicates that the element-wise sigmoid function has been applied. Representation style enhancement of the output features of the convolutional module; In the process of using wavelet convolution modules to decompose the initial style features to obtain the first layer of low-frequency components and the first layer of high-frequency components, the following relationship exists: ; in, This represents the first layer of low-frequency components. , and Both represent the first layer of high-frequency components. This indicates that the signal has undergone convolution processing using the corresponding wavelet filter. The process of performing wavelet decomposition on the first-level low-frequency components to obtain the second-level low-frequency components and the second-level high-frequency components can be summarized as follows: ; in, This indicates the low-frequency components of the second layer. , and Both represent the high-frequency components of the second layer. This indicates that the process has undergone a second wavelet decomposition. In the process of performing first-level inverse wavelet reconstruction on the second-level low-frequency components and the second-level high-frequency components to obtain the enhanced and recovered low-frequency components, the following relationship exists: ; in, This indicates enhanced recovery of low-frequency components. This represents the convolution operation performed on the four components after wavelet decomposition. This indicates that the process is performed through the first-level inverse wavelet reconstruction. In the process of obtaining the output features of the wavelet convolution module through the second-layer inverse wavelet reconstruction of the low-frequency components, the first-layer high-frequency components, and the first-layer low-frequency components based on enhanced recovery, the following relationship exists: ; in, This represents the output features of the wavelet convolution module. This indicates that the process has undergone a second-level inverse wavelet reconstruction.

7. The face sketching generation method based on Mamba and wavelet convolution according to claim 6, characterized in that, In the process of performing a linear transformation on the initial style features to obtain the query vector of the matrix, the following relationship exists: ; in, A query vector representing a matrix; In the process of stacking the initial style features and the enhanced style features and then performing a linear transformation to obtain the key vector and value vector of the matrix, the following relationship exists: ; in, Represents the key vector of a matrix. Represents the value vector of a matrix. This indicates that the two features will be merged along the newly added dimension. Indicates enhanced stylistic features; In the process of obtaining attention weights by processing the query vector, key vector, and value vector of the matrix through an attention mechanism, the following relationship exists: ; in, and Both represent attention weights. This indicates that attention has been paid to the calculation; In the process of using attention weights to perform weighted summation on the initial style features and the enhanced style features to obtain the weighted sum result, and then performing tensor dimension compression on the weighted sum result to obtain the style-enhanced style features, the following relationship exists: ; in, Stylistic features that indicate enhanced style. This indicates that the tensor dimension has been compressed.

8. The face sketching generation method based on Mamba and wavelet convolution according to claim 7, characterized in that, In step 4, the style-enhanced style features are input into the Mamba-Transformer encoder module for processing to obtain deep style features. The specific steps are as follows: The style-enhanced style features are input into the Mamba-Transformer encoder module and processed sequentially through three stacked Mamba-Transformer modules to obtain the global and local information of the style-enhanced style features. The global and local information of the style features after style enhancement are processed sequentially through a feedforward network and layer normalization to obtain deep style features.

9. The face sketching generation method based on Mamba and wavelet convolution according to claim 8, characterized in that, In step 5, the depth content features and depth style features are input into the decoder module for processing to obtain a facial sketch image, specifically including the following sub-steps: The decoder module consists of three Transformer decoder modules and three convolutional decoder modules; Each Transformer decoder module consists of three Transformer models; The deep content features and deep style features are input into the first Transformer decoder module. The deep style features are used as the key vector and value vector for attention calculation, and the deep content features are used as the query vector for attention calculation. The first Transformer model is used to process the first layer of Transformer output features. The deep style features are used as the key and value vectors for attention calculation, and the output features of the first layer Transformer are used as the query vector for attention calculation. The second layer Transformer output features are obtained by processing the second Transformer model. The deep style features are used as the key and value vectors for attention calculation, the output features of the second layer Transformer are used as the query for attention calculation, the third layer Transformer output features are obtained by processing through the third Transformer model, and the output features of the third layer Transformer are used as the first layer fusion features. The first layer of fused features is input into the second Transformer decoder module for processing to obtain the second layer of fused features; The second layer of fused features is then input into the third Transformer decoder module for processing to obtain the third layer of fused features, which are then used as the final fused features. The final fused features are processed through three convolutional decoder modules to obtain a face sketch image; the workflow of the convolutional decoder module is 3×3 convolution operation and upsampling operation.

10. A face sketching generation system based on Mamba and wavelet convolution, characterized in that, The system employs any one of the face sketching methods based on Mamba and wavelet convolution as described in claims 1 to 9, and the system comprises: Image processing module, used for: The content image and style image are cropped separately to obtain cropped content images and style images; the cropped content images and style images are flattened and then processed by linear mapping to obtain preliminary content features and preliminary style features; position information is added to the preliminary content features to obtain preliminary content features with added position information. The Mamba-Transformer encoder module is used for: The initial content features after incorporating location information are processed to obtain deep content features; The initial stylistic features are processed to obtain enhanced stylistic features; Style-enhanced wavelet convolution module, used for: The initial stylistic features are processed to obtain enhanced stylistic features; Decoder module, used for: Deep content features and deep style features are processed to obtain a facial sketch image.

Citation Information

Patent Citations

  • Multi-scale semantic guidance image compression method and system and storage medium

    CN120640000A

  • Highly-frequent transaction-adaptive intelligence system

    JP2025098093A