A woodcut new year picture image generation method, device, medium and equipment

By extracting semantic and stylistic features of woodblock New Year pictures using the DMECS-YOLOv10 model and edge detection technology, the problem of inaccurate woodblock New Year picture generation results in existing technologies is solved, and image generation that is more in line with the characteristics of traditional art is achieved, thus improving the application effect of cultural heritage digitization.

CN122289449APending Publication Date: 2026-06-26BEIJING INFORMATION SCI & TECH UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING INFORMATION SCI & TECH UNIV
Filing Date
2026-05-19
Publication Date
2026-06-26

Smart Images

  • Figure CN122289449A_ABST
    Figure CN122289449A_ABST
Patent Text Reader

Abstract

This invention relates to a method, apparatus, medium, and device for generating woodblock New Year picture images, comprising: using a DMECS-YOLOv10 element recognition model to identify and extract the constituent elements of the woodblock New Year picture, obtaining its semantic features; using edge detection technology to extract the line drawing structure features of the woodblock New Year picture as style features; and fusing the semantic features and style features to generate a target woodblock New Year picture image. By introducing a woodblock New Year picture element recognition model to detect and locate key elements and obtain structured semantic information, and combining this with an improved line drawing extraction method to extract representative line drawing structure features from the New Year picture image, a semantic-style jointly constrained image generation model is constructed. This allows the generation process to be controlled by both content structure and artistic style, thereby effectively improving the thematic expression, compositional rationality, and stylistic consistency of the generated image, demonstrating good practical value and promising prospects for wider application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of digital technology of intangible cultural heritage, specifically relating to a method, apparatus, medium and equipment for generating woodblock New Year picture images. Background Technology

[0002] Currently, in the field of intangible cultural heritage digitization, research on woodblock New Year pictures mainly focuses on digital acquisition, image archiving, database management, and digital display. While this work has achieved digital preservation of cultural resources to some extent, it remains largely at the resource management level, lacking in-depth analysis and systematic modeling of the semantic structure, artistic style, and compositional rules within the woodblock New Year picture images. Especially with the increasing application of artificial intelligence technology to cultural heritage protection and content generation, existing technologies have not yet developed effective generation methods for this specific art form, resulting in generated results that fail to reflect traditional artistic characteristics.

[0003] When using artificial intelligence to generate images of woodblock New Year pictures, existing methods generally have the following problems.

[0004] First, existing image generation models lack the ability to understand the cultural and semantic information contained in woodblock New Year pictures. Woodblock New Year pictures typically contain rich cultural elements, such as door gods, historical figures, mythological images, and auspicious animal and plant patterns. These elements not only have visual features but also carry specific cultural meanings. However, most generation models primarily learn based on image appearance features, lacking the ability to recognize and model the semantic structure of images. This results in inaccurate thematic expression in the generated images, easily leading to confusion of cultural elements or unclear content, thus affecting the cultural value of the generated works.

[0005] Secondly, woodblock New Year pictures possess distinct and stable artistic style characteristics, with their core features often manifested in the line structure formed by the woodblock printing, the way figures are depicted, and the overall composition. This line structure is not only a reflection of the woodblock carving technique but also a key distinguishing feature of woodblock New Year pictures from other forms of painting. However, in existing image generation technologies, models often focus more on color distribution, texture features, and overall style transfer, neglecting the accurate extraction and modeling of the line drawing structure. This results in generated images that, while close to traditional New Year pictures in color, differ significantly from authentic woodblock New Year pictures in overall shape and line expression, making it difficult to reflect the stylistic characteristics of traditional art.

[0006] Furthermore, woodblock New Year pictures often contain numerous decorative elements and complex patterns, resulting in a dense image structure and significant scale differences between elements, such as the main figures, background patterns, and border decorations. Traditional object detection algorithms are easily affected by complex backgrounds and patterns when processing these artistic images, leading to decreased recognition accuracy, target omissions, or inaccurate localization. Inaccurate semantic information extraction directly impacts the training quality of subsequent generative models, making it difficult for them to accurately learn the content structure of woodblock New Year pictures.

[0007] Furthermore, traditional cultural image data typically features a limited number of samples and significant stylistic variations, while existing generative models often rely on large amounts of high-quality data during training. Without effective feature extraction and model optimization mechanisms, it is difficult to achieve stable image generation results under limited data conditions, thus limiting the practical application of artificial intelligence technology in the field of traditional culture. Summary of the Invention

[0008] To overcome the problems existing in the prior art, the present invention provides a method, apparatus, medium and device for generating woodblock New Year picture images. By recognizing the semantic structure in the woodblock New Year picture image and modeling it in combination with artistic style features, the generation model can be improved in both content expression and artistic expression, thereby generating images that are more in line with the characteristics of traditional art.

[0009] A method for generating images of woodblock New Year pictures, the method comprising the following steps: S1. The DMECS-YOLOv10 element recognition model is used to identify and extract the constituent elements of woodblock New Year pictures to obtain the semantic features of woodblock New Year pictures; S2. Edge detection technology is used to extract the line drawing structure features of woodblock New Year pictures, which are then used as stylistic features; S3. A multimodal generative model is used to fuse semantic features and stylistic features to generate the target woodblock New Year picture image.

[0010] In addition to the aspects and any possible implementations described above, a further implementation is provided, wherein the semantic features include door gods, historical figures, mythological figures, and auspicious animal and plant patterns in the woodblock print; and the stylistic features include the line structure formed by woodblock printing, the way figures are depicted, and the overall composition layout in the woodblock print.

[0011] In addition to the aspects described above and any possible implementation, a further implementation is provided, wherein the DMECS-YOLOv10 element recognition model includes a connected backbone network, a neck structure, and a head structure, wherein the backbone network is provided with an initial convolutional module, a first DMECS convolutional module, a feature fusion module, a second DMECS convolutional module, a feature processing module, and a partially self-coordinating attention (PSCA) module that are connected in sequence.

[0012] In addition to the aspects and any possible implementations described above, an implementation is further provided, wherein S1 specifically includes: S11. Semantic annotation of woodblock New Year picture images to obtain a dataset; S12. Use the dataset to train the DMECS-YOLOv10 element recognition model to obtain the trained DMECS-YOLOv10 element recognition model; S13. The trained DMECS-YOLOv10 element recognition model is used to identify the constituent elements of woodblock New Year pictures and obtain prediction results; S14. Compare the predicted results with the actual results, and determine the semantic features based on the comparison results.

[0013] In addition to the aspects and any possible implementations described above, an implementation is further provided in which S2 includes: S21. Smooth the woodblock print image to obtain a smoothed image; S22. Perform convolution calculation with the smoothed image using the Sobel operator to obtain the woodblock New Year picture image after gradient calculation; S23. Apply non-maximum suppression processing to the woodblock New Year picture image after gradient calculation to obtain the woodblock New Year picture image after non-maximum suppression. S24. Apply the Otsu algorithm and edge processing to the woodblock New Year picture image obtained after non-maximum suppression to obtain the woodblock New Year picture image processed by Otsu; S25. Perform image dilation on the woodblock print image processed by Otsu to obtain the final woodblock print line drawing.

[0014] In addition to the aspects and any possible implementations described above, an implementation is further provided, wherein S13 specifically includes: S131. Inputting the woodblock New Year picture as the original image into the trained DMECS-YOLOv10 element recognition model, and processing it using the initial convolution module to obtain the original feature map of the woodblock New Year picture after initial convolution; S132. Output the original feature map of the woodblock New Year picture after the initial convolution to the first DMECS convolution module for processing to obtain the first DMECS convolution processed feature map; S133. Input the first DMECS convolutional feature map into the feature fusion module to obtain a fused feature map; S134. The fused feature map is processed by the feature processing module and then sent to the partial self-coordinating attention PSCA module for adjustment to obtain the woodblock New Year picture feature map after PSCA processing; S135. The feature map of the woodblock New Year picture processed by PSCA is output from the backbone network to the neck structure and head structure. The feature map is fused, identified and located to obtain the prediction result.

[0015] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the Shape-IoU function is used in S14 to calculate the loss between the prediction result and the actual result, and the prediction result with the smallest loss value is used as the semantic feature.

[0016] The present invention also provides a woodblock New Year picture image generation device, the device being used to implement the method, specifically including: The first extraction module is used to identify and extract the constituent elements of woodblock New Year pictures using the DMECS-YOLOv10 element recognition model, and obtain the semantic features of woodblock New Year pictures. The second extraction module is used to extract the line drawing structure features of woodblock New Year pictures using edge detection technology, and use these features as style characteristics; The fusion module is used to fuse semantic features and stylistic features using a multimodal generative model to generate the target woodblock print image.

[0017] The present invention also provides a computer storage medium storing a computer program, the computer program being executed by a processor to implement the method described.

[0018] The present invention also provides an electronic device, the electronic device comprising: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the method.

[0019] Beneficial effects of the present invention Compared with existing technologies, the woodblock New Year picture image generation method proposed in this invention, based on the fusion of semantic and stylistic features, detects and locates key elements such as figures, animals, flowers, and decorative patterns by introducing a woodblock New Year picture element recognition model to obtain structured semantic information. It also extracts representative line structure features from color New Year picture images by combining an improved line drawing extraction method. On this basis, a semantic-style jointly constrained image generation model is constructed, so that the generation process is controlled by both content structure and artistic style. This effectively improves the thematic expression, composition rationality, and stylistic consistency of the generated image, and has good practical value and promotion prospects in the fields of intelligent generation of traditional cultural images and digital application of intangible cultural heritage. Attached Figure Description

[0020] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the improved DMECS-YOLOv10 element recognition model structure of this invention; Figure 3 This is a structural diagram of the DMECS of the present invention; Figure 4 This is a structural diagram of the MECS of the present invention. Detailed Implementation

[0021] To better understand the technical solution of this invention, the content of this invention includes, but is not limited to, the specific embodiments described below. Similar technologies and methods should be considered within the scope of protection of this invention. To make the technical problems to be solved, the technical solutions, and advantages of this invention clearer, a detailed description will be provided below in conjunction with the accompanying drawings and specific embodiments.

[0022] It should be understood that the embodiments described in this invention are merely some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0023] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0024] like Figure 1 As shown, the present invention provides a method for generating woodblock New Year picture images, the method comprising the following steps: S1. The DMECS-YOLOv10 element recognition model is used to identify and extract the constituent elements of woodblock New Year pictures to obtain the semantic features of woodblock New Year pictures; S2. Edge detection technology is used to extract the line drawing structure features of woodblock New Year pictures, which are then used as stylistic features; S3. A multimodal generative model is used to fuse semantic features and stylistic features to generate the target woodblock New Year picture image.

[0025] Furthermore, the semantic features include door gods, historical figures, mythological figures, and auspicious animal and plant patterns in the woodblock prints; the stylistic features include the line structure formed by woodblock printing, the way figures are depicted, and the overall composition layout in the woodblock prints.

[0026] Furthermore, the DMECS-YOLOv10 element recognition model includes a connected backbone network, a neck structure, and a head structure. The backbone network is provided with an initial convolutional module, a first DMECS convolutional module, a feature fusion module, a second DMECS convolutional module, a feature processing module, and a partially self-coordinating attention (PSCA) module that are connected in sequence.

[0027] Furthermore, S1 specifically includes: S11. Semantic annotation of woodblock New Year picture images to obtain a dataset; S12. Use the dataset to train the DMECS-YOLOv10 element recognition model to obtain the trained DMECS-YOLOv10 element recognition model; S13. The trained DMECS-YOLOv10 element recognition model is used to identify the constituent elements of woodblock New Year pictures and obtain prediction results; S14. Compare the predicted results with the actual results, and determine the semantic features based on the comparison results.

[0028] Further, S2 includes: S21. Smooth the woodblock print image to obtain a smoothed image; S22. Perform convolution calculation with the smoothed image using the Sobel operator to obtain the woodblock New Year picture image after gradient calculation; S23. Apply non-maximum suppression processing to the woodblock New Year picture image after gradient calculation to obtain the woodblock New Year picture image after non-maximum suppression. S24. Apply the Otsu algorithm and edge processing to the woodblock New Year picture image obtained after non-maximum suppression to obtain the woodblock New Year picture image processed by Otsu; S25. Perform image dilation on the woodblock print image processed by Otsu to obtain the final woodblock print line drawing.

[0029] Further, S13 specifically includes: S131. Inputting the woodblock New Year picture as the original image into the trained DMECS-YOLOv10 element recognition model, and processing it using the initial convolution module to obtain the original feature map of the woodblock New Year picture after initial convolution; S132. Output the original feature map of the woodblock New Year picture after the initial convolution to the first DMECS convolution module for processing to obtain the first DMECS convolution processed feature map; S133. Input the first DMECS convolutional feature map into the feature fusion module to obtain a fused feature map; S134. The fused feature map is processed by the feature processing module and then sent to the partial self-coordinating attention PSCA module for adjustment to obtain the woodblock New Year picture feature map after PSCA processing; S135. The feature map of the woodblock New Year picture processed by PSCA is output from the backbone network to the neck structure and head structure. The feature map is fused, identified and located to obtain the prediction result.

[0030] Furthermore, in S14, the Shape-IoU function is used to calculate the loss between the predicted result and the actual result, and the predicted result with the smallest loss value is used as the semantic feature.

[0031] Specifically, the process of this invention is as follows: This invention integrates cutting-edge methods such as deep learning, computer vision, large-scale models, and multimodal technologies. Based on theories related to computer vision and multimodal information processing, it focuses on the digitization and revitalization of woodblock New Year paintings, exploring a method for generating woodblock New Year paintings based on the fusion of semantic and stylistic features. It includes: (I) First, multi-target recognition technology is used to identify and extract the constituent elements of woodblock New Year pictures, obtaining their semantic features, thereby alleviating the resource scarcity problem faced in the digital application of woodblock New Year pictures to a certain extent. Specifically, the process includes the following: Woodblock New Year Picture Data Annotation: Woodblock New Year pictures are typically composed of various visual elements, such as flowers, birds, fish, insects, mythological figures, opera characters, architectural landscapes, and objects symbolizing auspicious meanings. These different elements together create images with cultural connotations. Considering the complexity and diversity of elements in woodblock New Year pictures, this invention systematically classifies the collected woodblock New Year picture data from multiple dimensions, including image content, theme type, cultural connotation, and visual elements. It also performs feature analysis and annotation on key elements in the images, resulting in a standardized annotation dataset. This dataset is used to train the DMECS-YOLOv10 element recognition model. After training, the model performs multi-object detection on woodblock New Year pictures to obtain object detection results. This dataset enables the model to learn the visual features and semantic relationships between different elements, thereby improving its ability to recognize elements in woodblock New Year pictures. Semantic annotation can be performed using LabelMe; the specific annotation process is not detailed here.

[0032] The trained DMECS-YOLOv10 element recognition model is used to perform multi-element recognition on woodblock New Year pictures and obtain recognition results. The DMECS-YOLOv10 element recognition model of this invention includes a connected backbone network, a neck structure, and a head structure. The overall structure is similar to the existing YOLOv10 model. The difference is that in the backbone network, this invention sets up an initial convolutional module, a first dual-branch hybrid expansion-compression structure (DMECS) convolutional module (hereinafter referred to as the first DMECS module), a feature fusion module, a second DMECS convolutional module, a feature processing module, and a partially self-coordinating attention (PSCA) module, thereby forming an improved DMECS-YOLOv10 element recognition model. Figure 2 As shown, the specific working process of this model includes: Step 1: Input the woodblock print as the original image into the DMECS-YOLOv10 element recognition model. First, perform initial convolution module processing to obtain the original feature map x of the woodblock print after initial convolution. Then, process the original feature map of the woodblock print after convolution using the first DMECS convolution module.

[0033] The processing procedures of the two DMECS convolutional modules in this invention are completely identical. This invention describes the processing procedure of the first DMECS convolutional module in detail, and the processing procedure of the second DMECS convolutional module is the same as that of the first DMECS convolutional module. The processing procedure of the first DMECS convolutional module is as follows: Among them, such as Figure 3As shown, the left branch of the first DMECS convolutional module consists of a 1×1 convolution, used to perform lightweight feature transformation and shallow feature extraction on the original feature map of the woodblock print after convolution, resulting in a shallow feature map of the woodblock print. The right branch consists of a hybrid dilatation-compression structure MECS, a 3×3 convolution, and a max pooling layer MaxPool connected in series. This branch introduces a large receptive field convolution and a parallel attention mechanism, enabling the model to simultaneously acquire richer contextual and spatial structure information during feature extraction. The specific process is as follows: First, the original feature map of the woodblock print after convolution is processed by the MECS module with multi-scale dilatation convolution and channel compression to obtain detailed contextual information in the original feature map of the woodblock print after convolution, resulting in an intermediate feature map of the woodblock print. Then, the intermediate feature map is further processed by a 3×3 convolution to extract local spatial structure, resulting in a local spatial feature map of the woodblock print. Finally, the local spatial feature map is downsampled by the max pooling layer MaxPool to obtain detailed spatial structure information in the local spatial feature map, which serves as the MECS feature map of the woodblock print in the right branch. In addition, the shallow New Year picture feature map output from the left branch and the MECS woodblock New Year picture feature map output from the right branch are weighted and fused to obtain the fused DMECS woodblock New Year picture feature map.

[0034] MECS consists of two parts: Multi-scale Parallel Expansion-Compression Large Kernel (MPECLK) convolution and Enhanced Parallel Expansion-Compression (EPEC) attention mechanism. The overall process is as follows: Figure 4 As shown: MPECLK convolution enhances feature representation through dilation and compression, enabling feature fusion and recombination. It possesses the ability to acquire multi-scale features and a large receptive field. The specific processing steps are as follows: First, batch normalize the original feature map x of the convolved woodblock print to obtain... Subsequently, it is input into three different dilation-compression structures, each containing a different depthwise dilation convolution (DWDConv), thus obtaining three feature maps of woodblock New Year pictures: large, medium, and small. The DWDConv convolution contains dilation kernels K of different sizes (K=19, 13, 7). In a DWDConv convolution, the size of the dilation kernel K is shown in Equation (5), where k represents the size of the kernel, taking values ​​of k=3, 5, or 7, and d represents the dilation rate, taking a value of 3.

[0035] The convolutional kernel sizes of DWDConv19, DWDConv13, and DWDConv7 are 7×7, 5×5, and 3×3, respectively. Different kernel sizes have different receptive fields, thus extracting features at different scales. The expansion rate d is 3 for all kernels. These three different kernel sizes can locate different features in the feature map. Large and medium-sized kernels allow the model to focus on larger regions of the feature map, capturing broader contextual information; small kernels cover a smaller area, allowing the model to focus on local details and edge information in the feature map. Finally, the three woodblock print feature maps (large, medium, and small) are concatenated using Concat and input into the final dilation-compression structure. After processing with a 1×1 dilation convolution, GELU activation function, and 1×1 compression convolution, the dilated-compressed woodblock print feature map is obtained. This map is then concatenated with the original woodblock print feature map x to obtain the MPECLK woodblock print feature map y.

[0036] The EPEC attention mechanism also utilizes an expansion-compression approach to enhance the expressive power of the attention mechanism, providing the model with richer feature information.

[0037] First, similar to MPECLK, the characteristic image y of the MPECLK woodblock New Year picture is batch normalized to obtain... Subsequently, the data is input into three sets of expansion-compression structures that combine different attention mechanisms: Simple Pixel Attention (SPA), Channel Attention (CA), and Pixel Attention (PA). The feature map obtained after processing with Simple Pixel Attention (SPA) is the SPA feature map, which captures the importance weight of each pixel in the woodblock print. The feature map obtained after processing with Channel Attention (CA) is the CA feature map, which adaptively weights different feature channels in the woodblock print. The feature map obtained after processing with Pixel Attention (PA) is the PA feature map, which further enhances the response of key pixel regions in the woodblock print. This part not only enables the model to focus on pixel-level details and extract global information for information reorganization, but also extracts key positional information such as the position of figures, background patterns, and element outlines, capturing the feature differences of these positions in the image, allowing the model to more accurately identify and locate targets in the image. Finally, the model connects the three features mentioned above and inputs them into the final dilated-compressed activation structure, and then concatenates and adds them with the input MPECLK woodblock print feature map y to obtain the EPEC woodblock print feature map z.

[0038] Subsequently, the output z is input into the feature fusion module to obtain feature map r, thereby further improving the expressive power of the features. The output r is then input into the second DMECS convolution to obtain feature map r'. This process is the same as that of the first DMECS convolution and will not be described again here. The output r' is input into the feature processing module to obtain feature map t, thereby enhancing the learning ability of the feature map. This allows the semantic information in the existing feature map to be better expressed, further improving the recognition accuracy of the model. Feature map t here has a stronger expressive power than feature map z, and can better understand the relevant information in the feature map, which is more conducive to target recognition.

[0039] Step 2: Input the feature map t output from Step 1 into the Partial Self-Coordinate Attention (PSCA) module. Use Coordinate Attention (CA) as a component of PSCA to adjust the partial self-coordinate attention mechanism, thereby obtaining the woodblock New Year picture feature map t' after PSCA processing. The adjustment here uses existing mature technology and will not be described in detail.

[0040] Step 3: Input the output t' from Step 2 into the subsequent neck and head structures: The neck structure fuses the features output from each part, improving the expressive power of the feature maps in the model and further enhancing the model's recognition ability; The head structure is used to identify, locate, and output the target based on the input features, obtaining the prediction result. Then, the Shape-IoU function is used to calculate the loss between the prediction result and the actual result, thereby ensuring that the recognition box in the woodblock New Year picture element recognition can more accurately locate the target element, thus obtaining the final woodblock New Year picture element recognition result and constructing element semantic information. The Shape-IoU function calculation process is a mature calculation and will not be elaborated here.

[0041] This invention constructs an improved DMECS-YOLOv10 element recognition model to form a structured semantic information expression, thereby achieving a refined analysis of the content structure of woodblock New Year pictures and providing a reliable semantic constraint basis for subsequent image generation and style modeling.

[0042] This invention introduces a dual-branch hybrid dilatation-compression (DMECS) structure based on the YOLOv10 network architecture. By constructing a feature extraction module that combines a multi-scale dilatational convolutional structure with a parallel attention mechanism, the model can extract image feature information within different receptive fields and effectively fuse local detail information with global semantic information. Simultaneously, by introducing a partial self-coordinating attention mechanism (PSCA), the model's ability to express spatial location information and channel features is enhanced, thereby improving the model's ability to recognize complex patterns and overlapping elements. According to experimental results, compared with existing YOLOv10 models, the method of this invention significantly improves the mean accuracy (mAP) and multi-class detection performance on the woodblock New Year picture dataset. The improved model also shows significantly improved recognition stability in multi-class target detection tasks such as figures, flowers, animals, and decorative patterns. This demonstrates that this invention can effectively improve the accuracy and robustness of multi-element detection in complex artistic images, providing reliable technical support for the extraction of semantic information from woodblock New Year pictures.

[0043] To verify the effectiveness of the improved model in multi-element detection of woodblock New Year paintings, a comparative experiment was designed to compare the detection effects of different models. Several representative models were selected: YOLOv6, YOLOv7, YOLOv8 and YOLOv9, as well as the improved DMECS-YOLOv10 element recognition model proposed in this invention. The specific comparative experimental results are shown in Table 1.

[0044] Table 1 Comparative Experiment Results 1 In a comprehensive evaluation of performance metrics, the improved DMECS-YOLOv10 element recognition model of this invention outperforms other versions of the YOLO series in terms of recall, mean average precision (mAP50 and mAP50~95), and number of parameters, demonstrating significant optimization effects. Specifically, the improved DMECS-YOLOv10 element recognition model achieves a significant improvement in mAP50 value, increasing by 9.5% compared to the YOLOv6 model and by 2.0% compared to the YOLOv8 model. This indicates that it possesses higher accuracy and robustness in object detection tasks, especially in multi-element detection scenarios, effectively improving detection performance. Furthermore, the improved DMECS-YOLOv10 element recognition model outperforms other YOLO models in the same series in terms of P-value. Only the YOLOv8 model slightly surpasses the improved DMECS-YOLOv10 element recognition model in this metric. However, the YOLOv8 model has nearly 300,000 more parameters than the improved DMECS-YOLOv10 element recognition model, indicating that the improved DMECS-YOLOv10 element recognition model significantly reduces model complexity while maintaining high detection performance. In terms of computational complexity, the improved DMECS-YOLOv10 element recognition model achieves 16.3 GFLOPs. An increase in GFLOPs usually means increased computational cost, which may affect the model's efficiency in resource-constrained environments. However, this improvement in computational complexity is due to the optimization of the feature extraction module in the improved DMECS-YOLOv10 element recognition model structure, introducing more complex convolutional blocks to meet the requirements of high-precision detection. This improvement strategy enhances detection performance while also reflecting the trade-off between computational resources and detection accuracy in the model.

[0045] Meanwhile, in order to verify the effectiveness of the proposed module, the existing model was combined with YOLOv10, and the improved model of this invention was compared with the existing model. The results are shown in Table 2.

[0046] Table 2 Comparison of experimental results The experimental data shows that DMECS-YOLOv10 outperforms other models in the experiment in terms of R-value, mAP50 value, and parameter count. Other metrics also demonstrate superior results, showcasing good experimental performance. It is noteworthy that SKAttention's P-value and mAP50-95 values ​​exceed those of the proposed model, but its parameter count is more than three times that of the proposed model. This indicates higher model complexity, which is detrimental to lightweight deployment.

[0047] (II) Edge detection processing is performed on the original woodblock print image to extract the line drawing structure features, thereby obtaining a line drawing image that reflects the original woodblock print, which is then used as the style feature of the woodblock print. This step uses an improved Canny operator to perform edge detection on the woodblock print image, thereby generating the original line drawing image of the woodblock print. The specific detection process of the improved Canny operator is as follows: Step 1: Image smoothing: The first derivative of a two-dimensional Gaussian filter function is used to process the image. This is then used to perform a convolution operation on the original woodblock print image to reduce noise and obtain a smoothed image of the woodblock print.

[0048] Step 2: Perform eight-directional gradient calculation: Use the Sobel operator to perform a convolution operation with the woodblock print image after image smoothing to obtain the woodblock print image after gradient calculation. This part uses eight-directional gradient calculation to clearly define the direction and size of each pixel in the image, accurately representing the gradient direction of the lines. Eight-directional gradient calculation is a relatively mature technique and will not be elaborated further here.

[0049] Step 3: Non-maximum suppression: The non-maximum suppression method is used to select the direction and size of pixels in the woodblock print image after gradient calculation. It is determined whether the gradient of the selected pixel is a local maximum in the gradient direction of the neighborhood, so that each gradient has one and only one local maximum, and the rest of the gradients are suppressed to 0, further refining the edges. After suppression, the edges are compressed to the center line where the gradient change is most drastic, thereby improving the edge positioning accuracy and obtaining the woodblock print image after non-maximum suppression.

[0050] Step 4: Otsu algorithm and edge connection: First, the woodblock print image after nonmaximum suppression is divided into two parts, target and background, according to gray level. Then, a suitable threshold is found by calculating the variance to segment and generate the woodblock print image after Otsu processing. The Otsu algorithm is a mature existing algorithm and will not be described in detail here.

[0051] Step 5: Image dilation: The woodblock print image processed by Otsu is subjected to image dilation to make its edges more tightly connected, thereby obtaining the final woodblock print line drawing.

[0052] This invention obtains the line drawing of a woodblock New Year picture by performing feature enhancement, noise suppression, and edge structure extraction on traditional New Year picture images, thereby achieving an effective expression of the artistic style characteristics of woodblock New Year pictures. It can effectively learn the morphological characteristics, composition rules, and artistic expression methods of traditional woodblock carving lines.

[0053] To address the issues of existing edge detection methods easily generating noisy edges, broken lines, and missing structural information in complex pattern images, the line drawing generation method of this invention first improves the quality of the original image through preprocessing methods such as image denoising, smoothing, and structural enhancement. Then, it combines an improved edge detection algorithm to extract the line structure in the image, thereby obtaining a line drawing image with high integrity. Through these technical means, this invention can effectively extract representative carved line structures and image contour information from woodblock New Year paintings, and reduce the impact of complex backgrounds and pattern interference on the edge extraction results. Experimental results show that, compared with traditional edge detection methods, the line drawings generated by this invention perform better in terms of structural continuity, line clarity, and style preservation, and can more accurately reflect the artistic structural characteristics of woodblock New Year paintings. Therefore, this invention can effectively improve the stability and accuracy of traditional art image line drawing extraction, providing a reliable data foundation for subsequent style modeling and generation tasks.

[0054] To verify the effectiveness of the woodblock New Year picture line drawing generation algorithm based on the improved Canny operator proposed in this invention in the field of woodblock New Year picture line drawing generation, a comparative experiment on the detection effects of different models was designed. Several representative edge detection operators were selected: the traditional Canny operator, the Prewitt operator (divided into horizontal X and vertical Y directions), the Roberts operator, the Laplacian operator, and the Scharr operator, as well as the woodblock New Year picture line drawing generation algorithm based on the improved Canny operator proposed in this invention, to conduct experiments on the "God Tiger Guarding the House" woodblock New Year picture. The results of each evaluation index are shown in Table 3.

[0055] Table 3. Evaluation Indicators of Each Operator As shown in the table above, in terms of visual perception, the operator of the present invention exhibits better visual effects, with a clear distinction between the background and lines and less noise; the Scharr operator is second best, but has more background noise; the detection effects of the traditional Canny operator and the Prewitt operator are not significantly different, and the distinction between the background and lines is relatively clear; the Roberts operator and the Laplacian operator have poor visual perception and are more difficult to distinguish edges.

[0056] Regarding the evaluation metrics, the operator of this invention exhibits better results. Specifically: In terms of RMSE, the operator of this invention showed the best performance, followed by the Prewitt operator, and the Scharr operator was the worst. Compared with the Prewitt operator, it reduced the RMSE by 0.55%; compared with the Scharr operator, it reduced the RMSE by 57.55%; and compared with the traditional Canny operator, it reduced the RMSE by 1.22%. In terms of PSNR, the operator of this invention showed the best performance, followed by the Roberts operator, and the Scharr operator was the worst. Compared with the Roberts operator, it improved by 0.85%; compared with the Scharr operator, it improved by 13.88%; and compared with the traditional Canny operator, it improved by 1.7%. In terms of SSIM metrics, the operator of this invention showed the best performance, followed by the Roberts operator, and the Scharr operator was the worst. Compared with the Roberts operator, it improved by 0.38%; compared with the Scharr operator, it improved by 72.92%; and compared with the traditional Canny operator, it improved by 1.33%.

[0057] The results of the above evaluation indicators show that the edge detection of the "Godly Tiger Guarding the House" woodblock New Year picture using the operator of the present invention exhibits significant advantages in terms of accuracy improvement, image quality preservation, and structural similarity optimization, demonstrating superior performance. The present invention is not limited to its advantages in processing this type of New Year picture; it also has similar effects on all other New Year pictures. The specific process will not be elaborated upon in this invention.

[0058] (iii) Input the semantic information and style features from steps (i) and (ii) into the multimodal generation model simultaneously, and train or infer the model so that it can construct semantic-style joint features and further generate the target woodblock New Year picture image. The original text image model, Stable Diffusion, is fine-tuned using semantic information and style features to obtain a new woodblock print image with joint features. The specific steps are as follows: Step 1: Input the semantic information and style features obtained in Step (I) and Step (II) above into the Bootstrapping Language-Image Pre-training (BLIP) model to obtain the text-image pair training set for use in the subsequent large text-to-image model. Step 2: Input the acquired text-image pair training set into the original text-to-image large model Stable Diffusion for training; Step 3: During the training process, LoRA is used to fine-tune the model from Step 2, thereby obtaining the fine-tuned target woodblock print image based on the fusion of semantic features and style features. This fine-tuning process is a mature technology and will not be described in detail here.

[0059] This invention inputs multi-element semantic information and line drawing style structure into the bootstrap language-image pre-training model BLIP to generate a text-image pair training set. It also combines efficient parameter fine-tuning technology to adapt and train the original text-to-image large model, thereby realizing the generation of woodblock New Year picture images with consistency between traditional art style and cultural semantics, improving the authenticity, artistic expression and application value of digital revitalization of intangible cultural heritage in the generated results.

[0060] This invention utilizes a parameter-efficient fine-tuning technique to specifically train a multimodal generative model, enabling the model to be simultaneously constrained by both semantic structure and artistic style during the generation process. Experimental results show that, compared to generative models without domain fine-tuning, the target woodblock New Year picture images generated by the method of this invention are closer to the authentic original New Year picture works in terms of composition structure, line style, and expression of cultural elements, exhibiting higher stylistic consistency and artistic expressiveness. In summary, the experimental results demonstrate that LoRA fine-tuning significantly optimizes the vertical domain of the Stable Diffusion model. The fine-tuned Tianjin style model and Sichuan style model overcome the "generalization" limitations of the original model, achieving an upgrade from "image generation" to "cultural translation." Especially in traditional art fields such as woodblock New Year pictures, which rely on manual skills and regional symbols, the fine-tuned large model not only reproduces the details of the craft but also innovatively endows traditional art with new expressive possibilities, providing new revitalization ideas for the digital protection and innovative application of intangible cultural heritage.

[0061] Preferably, in multi-target detection for woodblock New Year paintings, the present invention can also use a target detection model based on the Transformer architecture to replace the YOLO structure; in the generation of woodblock New Year painting line drawings based on edge detection technology, a deep learning line drawing extraction network can be used to replace the traditional edge detection algorithm; in the multimodal text image of woodblock New Year paintings based on LoRA fine-tuning, generative adversarial networks or other diffusion models can be used to generate the target woodblock New Year painting image. These alternative solutions can all achieve similar technical effects to the present invention and are within the protection scope of the present invention.

[0062] As an embodiment of the present invention, the present invention also provides a woodblock New Year picture image generation device, the device being used to implement the method, specifically including: The first extraction module is used to identify and extract the constituent elements of woodblock New Year pictures using the DMECS-YOLOv10 element recognition model, and obtain the semantic features of woodblock New Year pictures. The second extraction module is used to extract the line drawing structure features of woodblock New Year pictures using edge detection technology, and use these features as style characteristics; The fusion module is used to fuse semantic features and stylistic features using a multimodal generation model to generate target woodblock New Year picture images. Experiments have shown that the target woodblock New Year picture images generated by this invention fully pay attention to cultural semantic information and line drawing features. Therefore, compared with the original woodblock New Year picture images, they fully reflect the characteristics of traditional art.

[0063] As an embodiment of the present invention, the present invention also provides a computer storage medium storing a computer program, the computer program being executed by a processor to implement the method described herein.

[0064] As an embodiment of the present invention, the present invention also provides an electronic device, the electronic device comprising: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the method.

[0065] The foregoing description illustrates and describes several preferred embodiments of the present invention. However, as mentioned above, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept described in this application, through the foregoing teachings or related technical or knowledge. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A method for generating woodblock New Year picture images, characterized in that, The method includes the following steps: S1. The DMECS-YOLOv10 element recognition model is used to identify and extract the constituent elements of woodblock New Year pictures to obtain the semantic features of woodblock New Year pictures; S2. Edge detection technology is used to extract the line drawing structure features of woodblock New Year pictures, which are then used as stylistic features; S3. A multimodal generative model is used to fuse semantic features and stylistic features to generate the target woodblock New Year picture image.

2. The method according to claim 1, characterized in that, The semantic features include door gods, historical figures, mythological figures, and auspicious animal and plant patterns in the woodblock prints; the stylistic features include the line structure formed by woodblock printing, the way figures are depicted, and the overall composition layout in the woodblock prints.

3. The method according to claim 1, characterized in that, The DMECS-YOLOv10 element recognition model includes a connected backbone network, a neck structure, and a head structure. The backbone network is provided with an initial convolutional module, a first DMECS convolutional module, a feature fusion module, a second DMECS convolutional module, a feature processing module, and a partially self-coordinating attention (PSCA) module that are connected in sequence.

4. The method according to claim 3, characterized in that, S1 specifically includes: S11. Semantic annotation of woodblock New Year picture images to obtain a dataset; S12. Use the dataset to train the DMECS-YOLOv10 element recognition model to obtain the trained DMECS-YOLOv10 element recognition model; S13. The trained DMECS-YOLOv10 element recognition model is used to identify the constituent elements of woodblock New Year pictures and obtain prediction results; S14. Compare the predicted results with the actual results, and determine the semantic features based on the comparison results.

5. The method according to claim 1, characterized in that, S2 includes: S21. Smooth the woodblock print image to obtain a smoothed image; S22. Perform convolution calculation with the smoothed image using the Sobel operator to obtain the woodblock New Year picture image after gradient calculation; S23. Apply non-maximum suppression processing to the woodblock New Year picture image after gradient calculation to obtain the woodblock New Year picture image after non-maximum suppression. S24. Apply the Otsu algorithm and edge processing to the woodblock New Year picture image obtained after non-maximum suppression to obtain the woodblock New Year picture image processed by Otsu; S25. Perform image dilation on the woodblock print image processed by Otsu to obtain the final woodblock print line drawing.

6. The method according to claim 4, characterized in that, S13 specifically includes: S131. Inputting the woodblock New Year picture as the original image into the trained DMECS-YOLOv10 element recognition model, and processing it using the initial convolution module to obtain the original feature map of the woodblock New Year picture after initial convolution. S132. Output the original feature map of the woodblock New Year picture after the initial convolution to the first DMECS convolution module for processing to obtain the first DMECS convolution processed feature map; S133. Input the first DMECS convolutional feature map into the feature fusion module to obtain a fused feature map; S134. The fused feature map is processed by the feature processing module and then sent to the partial self-coordinating attention PSCA module for adjustment to obtain the woodblock New Year picture feature map after PSCA processing; S135. The feature map of the woodblock New Year picture processed by PSCA is output from the backbone network to the neck structure and head structure. The feature map is fused, identified and located to obtain the prediction result.

7. The method according to claim 4, characterized in that, In step S14, the Shape-IoU function is used to calculate the loss between the predicted result and the actual result, and the predicted result with the smallest loss value is used as the semantic feature.

8. A woodblock New Year picture image generation device, characterized in that, The apparatus is used to implement the method according to any one of claims 1-7, specifically including: The first extraction module is used to identify and extract the constituent elements of woodblock New Year pictures using the DMECS-YOLOv10 element recognition model, and obtain the semantic features of woodblock New Year pictures. The second extraction module is used to extract the line drawing structure features of woodblock New Year pictures using edge detection technology, and use these features as style characteristics; The fusion module is used to fuse semantic features and stylistic features using a multimodal generative model to generate the target woodblock print image.

9. A computer storage medium, characterized in that, The medium stores a computer program, which is executed by a processor to implement the method according to any one of claims 1-7.

10. An electronic device, characterized in that, The electronic device includes: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the method of any one of claims 1-7.