Artificial intelligence-based sketch robot system and working method thereof

By using a multi-algorithm cascade architecture that integrates edge and cloud, the problems of low face detection accuracy and awkward style fusion in offline scenarios are solved, enabling real-time response to generate high-quality sketches and meeting the service needs of high-traffic offline scenarios.

CN122415787APending Publication Date: 2026-07-17WOMEN & CHILDRENS MEDICAL CENTER AFFILIATED WITH GUANGZHOU MEDICAL UNIVERSITY +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WOMEN & CHILDRENS MEDICAL CENTER AFFILIATED WITH GUANGZHOU MEDICAL UNIVERSITY
Filing Date
2026-04-22
Publication Date
2026-07-17

Smart Images

  • Figure CN122415787A_ABST
    Figure CN122415787A_ABST
Patent Text Reader

Abstract

This invention relates to the field of artificial intelligence technology and discloses an AI-based sketching robot system and its working method. The system includes a client and a server. The client is deployed on a hardware carrier with a camera for capturing facial images. The server includes an AI-specific service module, whose built-in multi-algorithm cascaded model comprises sequentially connected pre-localization, feature representation, core generation, and effect optimization networks, respectively performing face detection and pose correction, facial feature extraction, style fusion based on generative adversarial networks, line optimization, and resolution enhancement. The pre-localization network's pre-computation unit is deployed on the client to generate a guiding frame in real time, while the core computation unit is deployed on the server to perform pose correction. This invention, through multi-algorithm cascade and edge-cloud collaborative architecture, achieves high-fidelity, low-latency sketch generation in complex shooting environments, and is adaptable to offline real-time service scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to an artificial intelligence-based sketching robot system and its working method. Background Technology

[0002] Traditional hand-drawn sketching services rely on professional artists creating sketches on-site, which is time-consuming, costly, and lacks standardization, making it difficult to meet the real-time, large-scale service needs of offline scenarios such as shopping malls and scenic spots. Existing technologies include image processing-based sketching generation software, but these are mostly limited to online applications, have high user barriers, and lack physical delivery capabilities, failing to form a complete service loop. For sketching generation terminals in offline scenarios, their core algorithms often use a single generation model. When dealing with complex shooting conditions such as non-frontal faces and uneven lighting, face detection accuracy is low, feature reproduction is poor, and the generated sketches suffer from stiff style integration, obvious line jaggedness, and insufficient resolution, resulting in a significant gap in artistic quality compared to professional hand-drawn sketches. Furthermore, existing solutions often employ a single deployment mode of purely local or purely cloud computing. Local computing is limited by hardware performance, leading to low generation efficiency, while cloud computing suffers from network transmission latency, making it difficult to meet the real-time response requirements of high-traffic offline scenarios. Therefore, there is an urgent need for an intelligent sketching solution that can achieve low-latency response while ensuring generation quality. Summary of the Invention

[0003] The purpose of this invention is to provide an artificial intelligence-based sketching robot system and its working method to solve the technical problems mentioned in the background art.

[0004] To achieve the above objectives, the present invention discloses the following technical solutions: In a first aspect, the present invention discloses an artificial intelligence-based sketching robot system, comprising: a client and a server; The client is deployed on a hardware carrier equipped with a camera to capture raw images containing human faces; The server includes an artificial intelligence-specific service module, which has a built-in artificial intelligence sketching generation model with multiple cascaded algorithms. The AI ​​sketch generation model includes a pre-localization network, a feature representation network, a core generation network, and an effect optimization network connected in sequence. The pre-positioning network is configured to perform face detection and pose correction on the original image based on a multi-task convolutional neural network, and output a normalized face image; The feature representation network is configured to perform facial feature extraction on the normalized face image based on a convolutional neural network and output a facial feature vector; The core generative network is configured to fuse the facial feature vector with the style feature vector corresponding to the selected template based on the generative adversarial network to generate a basic sketch image; the generator of the generative adversarial network is configured to concatenate the facial feature vector with the style feature vector in the intermediate layer; and the discriminator of the generative adversarial network is configured to include a realism discrimination branch and a style similarity discrimination branch. The effect optimization network is configured to perform line optimization and resolution enhancement on the base sketch image to generate a digital sketch artwork; The pre-positioning network includes a pre-computation unit and a core computing unit. The pre-computation unit is deployed on the client and is used to generate a face guide box in real time during the image acquisition stage. The core computing unit is deployed on the server and is used to perform pose correction on the acquired raw images.

[0005] In one embodiment, the multi-task convolutional neural network in the pre-localization network includes a candidate box generation subnetwork, a candidate box filtering subnetwork, and a precise localization subnetwork; wherein the candidate box generation subnetwork is configured to include face anchor boxes corresponding to at least two preset pose angles; The multi-task convolutional neural network is further configured to perform adaptive gamma correction on the original image before inputting the original image into the candidate box generation sub-network to generate an image after illumination equalization; and after the candidate box filtering sub-network outputs a feature map, generate background feature suppression weights, and multiply the background feature suppression weights element-wise with the feature map output by the candidate box filtering sub-network to obtain a background-suppressed feature map.

[0006] In one embodiment, the convolutional neural network in the feature representation network includes a plurality of sequentially connected convolutional blocks; The feature representation network is further configured to extract feature maps output by at least two convolutional blocks of different depths, perform global average pooling on each feature map to obtain multiple intermediate vectors, concatenate the multiple intermediate vectors, perform L2 normalization on the concatenated vectors, and output a 512-dimensional face feature vector.

[0007] In one embodiment, the generative adversarial network is trained using a weighted sum of a gradient penalty loss function and a style similarity loss function as the total loss function, wherein the gradient penalty loss function is constructed based on the Earth's transport distance. The generative adversarial network is further configured to obtain the authenticity probability value and style matching degree value output by the discriminator. When the authenticity probability value is lower than a first preset threshold or the style matching degree value is lower than a second preset threshold, the loss gradient is backpropagated to the generator, and the generator is controlled to update the parameters based on the loss gradient and regenerate the basic sketch image until the authenticity probability value and the style matching degree value both reach the preset requirements or the maximum number of iterations is reached.

[0008] In one embodiment, the performance optimization network includes: The line optimization unit is configured to perform spur removal processing on the basic sketch image through morphological opening operation to obtain an image after spur removal, and to perform line smoothing processing on the image after spur removal through adaptive median filtering to obtain an image after line optimization. The brightness adjustment unit is configured to perform brightness and contrast adjustment on the line-optimized image by limiting contrast adaptive histogram equalization to obtain the brightness-adjusted image. The super-resolution magnification unit is configured to perform resolution magnification processing on the brightness-adjusted image through a lightweight super-resolution network to generate a digital sketch with a resolution that meets the preset output specifications.

[0009] In one embodiment, the performance optimization network further includes: The enhancement unit is configured to construct the Laplacian pyramid of the basic sketch image to obtain multiple high-frequency layer images and one low-frequency layer image. The pixel values ​​corresponding to the facial features in the multiple high-frequency layer images are multiplied by a first enhancement coefficient, and the pixel values ​​corresponding to the background area are multiplied by a second enhancement coefficient. The first enhancement coefficient is greater than the second enhancement coefficient. The enhanced high-frequency layer images and the low-frequency layer images are then used for pyramid reconstruction to obtain an image with enhanced details. The style adaptive unit is configured to read the corresponding post-processing parameter set from a pre-stored parameter mapping table according to the style identifier of the selected template, and send the post-processing parameter set to the line optimization unit, the brightness adjustment unit and the detail enhancement unit respectively, so as to control the processing intensity of each unit.

[0010] In one embodiment, the pre-computation unit includes an image preprocessing module and a candidate box generation module in the multi-task convolutional neural network; the image preprocessing module is used to perform size scaling and pixel normalization processing on the original image, and the candidate box generation module is used to generate at least one face candidate box based on the preprocessed image, and display the face guide box corresponding to the face candidate box on the touch screen in real time; The core computing unit includes a candidate box filtering module, a key point detection module, and a pose correction module in the multi-task convolutional neural network. The candidate box filtering module is used to perform confidence filtering and non-maximum suppression processing on the face candidate boxes. The key point detection module is used to detect the coordinates of face key points. The pose correction module is used to calculate the pose angle based on the coordinates of the face key points, correct the image to the frontal direction through affine transformation, and crop and scale it to a preset size. The client and the server interact via an asynchronous communication protocol. After the client sends the original image, it releases user interface resources. After the server generates the digital sketch, it pushes the result to the client via a callback interface.

[0011] In one embodiment, the hardware carrier is further equipped with a touch screen and a professional sketch printer; The client is also used to display the digital sketch on the touch screen, generate a payment QR code, and after detecting a payment completion instruction, drive the professional sketch printer to perform physical printing output on the digital sketch, while generating a temporary download QR code associated with the digital sketch.

[0012] In one embodiment, the hardware carrier is further configured with a solid-state drive, which has a dedicated cache partition; the dedicated cache partition is used to cache the style feature vector of the selected template, the model parameters of the front-end computing unit, and temporary data during the user session.

[0013] Secondly, the present invention provides a method for operating an artificial intelligence-based sketching robot system as described above, the method comprising: Step S1: The client captures a raw image containing a human face through a camera; Step S2: The client sends the original image to the server; Step S3: The server processes the original image using a multi-algorithm cascaded AI sketching generation model built into the AI-specific service module, including: Step S31: Use the pre-localization network based on a multi-task convolutional neural network to perform face detection and pose correction on the original image, and output the normalized face image; Step S32: Use a feature representation network based on a convolutional neural network to extract facial features from the normalized face image and output a facial feature vector; Step S33: Using the core generative network based on the generative adversarial network, the face feature vector is fused with the style feature vector corresponding to the selected template to generate a basic sketch image; wherein, the generator of the generative adversarial network concatenates the face feature vector with the style feature vector in the intermediate layer, and the discriminator of the generative adversarial network includes a realism discrimination branch and a style similarity discrimination branch; Step S34: Use an effects optimization network to perform line optimization and resolution enhancement on the base sketch image to generate a digital sketch artwork; Step S4: The server sends the digital sketch to the client; Step S5: The client displays the digital sketch on the touch screen.

[0014] Compared with the prior art, the artificial intelligence-based sketching robot system and its working method of the present invention have at least the following beneficial effects: By constructing a multi-algorithm cascade architecture that includes a pre-localization network, a feature representation network, a core generation network, and an effect optimization network, and dividing the pre-localization network into a pre-computation unit deployed on the client and a core computation unit deployed on the server, an edge-cloud collaborative deployment architecture is formed. This solves the technical problems of low detection accuracy and poor feature restoration of single algorithm models in the existing technology when dealing with complex shooting conditions such as non-frontal faces and uneven lighting, as well as the difficulty of balancing generation quality and response latency in a single deployment mode of pure local computing or pure cloud computing.

[0015] Specifically, the multi-task convolutional neural network in the pre-localization network performs face detection and pose correction on the original image, outputting a normalized face image, overcoming the problem of distorted face feature extraction caused by shooting pose deviations in existing technologies; the convolutional neural network in the feature representation network performs face feature extraction on the normalized face image, outputting a face feature vector, ensuring the complete preservation of face features in the subsequent style fusion process; the generative adversarial network in the core generative network concatenates the face feature vector and style feature vector in the intermediate layer, and the discriminator includes a realism discrimination branch and a style similarity discrimination branch, solving the problems of stiff style fusion and homogeneous generated images in existing technologies, while ensuring face recognition. While improving the accuracy of the process, the system also enhances the style matching and artistic quality of the sketches. The effect optimization network performs line optimization and resolution enhancement on the basic sketch images, eliminating line jaggedness in the generated images and improving the output resolution, thus overcoming the shortcomings of insufficient artistic quality in the generated works in existing technologies. The client-side pre-processing unit is responsible for low-latency pre-processing such as real-time generation of face guide boxes, while the server-side core processing unit is responsible for computationally intensive tasks such as pose correction, feature extraction, style fusion, and post-processing optimization. This reduces the response latency of a single service while ensuring the quality of the generated images, enabling the system to adapt to the real-time service needs of offline high-traffic scenarios and achieving fully automated service from image acquisition to artwork generation. Attached Figure Description

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

[0017] Figure 1 A structural block diagram of an artificial intelligence-based sketching robot system provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a method for periodic health management of personnel based on an intelligent engine, as provided in an embodiment of the present invention. Detailed Implementation

[0018] To facilitate understanding of the technical solutions provided in the embodiments of this application, the background technology involved in the embodiments of this application will be described below.

[0019] Traditional hand-drawn sketching services rely on professional artists creating artwork on-site. Users need to make an appointment and wait for the artist to draw, with each piece typically taking several tens of minutes or more. Furthermore, the varying skill levels of artists make it difficult to standardize the quality of the artwork. This service model is costly and difficult to scale up in high-traffic offline locations such as shopping malls, scenic spots, and cultural and creative districts, thus failing to meet the demand of the general public for instant access to sketch artwork.

[0020] With the development of artificial intelligence technology, image processing-based sketch generation software has emerged. This type of software converts user-uploaded photos into sketch-style images through pre-built algorithm models. However, it is mostly limited to online applications. Users need to take, upload, and download the photos themselves, which has a high barrier to entry. In addition, it lacks physical delivery capabilities. Users only receive electronic images and cannot directly obtain physical sketch works that can be stored and displayed, resulting in an incomplete service loop.

[0021] For offline scenarios, some self-service sketching terminals have emerged in the market. These terminals typically employ a single generative adversarial network (GAN) model to complete the entire process from image acquisition to sketch generation on a local device. However, the following prominent issues exist in practical applications: First, offline shooting environments are complex, with users exhibiting diverse postures, including non-frontal views, side views, and heads tilted down. Furthermore, lighting conditions vary greatly, with frequent occurrences of backlighting, low light, and strong light. Existing facial detection algorithms used in terminals are poorly adapted to these complex scenarios, exhibiting low detection accuracy and a high false detection rate. This results in poor facial feature reproduction in the generated images, leading to insufficient similarity between the final product and the actual user.

[0022] Secondly, existing sketch style generation networks suffer from pattern collapse, resulting in generated works with a single style and severe homogenization. Furthermore, the style transfer process easily masks original facial features, leading to generated works that, while possessing a sketch style, have reduced facial recognizability and a significant gap in artistic quality compared to professional hand-drawn sketches. In addition, the generated images generally suffer from jagged lines, uneven brightness, and insufficient resolution, failing to meet the requirements for high-definition printing output.

[0023] Third, in terms of deployment architecture, existing solutions mostly adopt a single mode of pure local computing or pure cloud computing. Pure local computing is limited by the performance of terminal hardware, making it difficult to run large-scale, high-precision deep learning models, thus limiting the quality of the generated data. While pure cloud computing can utilize the high computing power of servers to ensure the quality of the generated data, the entire process of image transmission, model inference, and result return is time-consuming, and the latency is even higher when the network fluctuates, making it difficult to meet the needs of users in offline scenarios for immediate access to services. In other words, existing solutions cannot achieve a balance between generation quality and service response speed, which restricts large-scale offline applications.

[0024] In summary, existing technologies lack an intelligent sketching solution that can guarantee face detection accuracy and feature restoration under complex shooting conditions, maintain face recognition and artistic quality during style fusion, and simultaneously balance generation quality and response latency.

[0025] In view of this, embodiments of this application provide an artificial intelligence-based sketching robot system and its working method.

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.

[0027] Before proceeding with the detailed description, it should be noted that the implementation of this invention involves the collection and processing of user facial images. In the actual deployment and application of this technical solution, within the framework of laws and regulations, the purpose and scope of data collection and use should be clearly communicated to the user, and the user's explicit authorization should be obtained. The system should store the collected original images, generated facial feature vectors, and digital sketches using encryption technologies such as AES-256, and enable encryption protocols such as HTTPS / TCP during transmission between the client and server to ensure the security of user data and the full protection of user privacy rights.

[0028] Existing sketch generation systems, whether purely local or purely cloud-based, struggle to meet the low-latency response requirements of offline scenarios while maintaining high generation quality. Local computing is limited by hardware performance, making it impossible to run high-precision generation models; while cloud computing can leverage the high computing power of servers to ensure quality, network transmission latency degrades the user experience. To address this technical problem, this invention provides an AI-based sketching robot system. Its core lies in its edge-cloud collaborative deployment architecture and multi-algorithm cascading model design, achieving a balance between generation quality and response speed.

[0029] Therefore, in one embodiment, an artificial intelligence-based sketching robot system is provided, such as Figure 1 As shown, it includes: client and server.

[0030] The client is deployed on a hardware device equipped with a camera to capture raw images containing human faces.

[0031] The server side includes an AI-specific service module, which contains a multi-algorithm cascaded AI sketch generation model.

[0032] The AI ​​sketching generation model consists of a pre-localization network, a feature representation network, a core generation network, and an effect optimization network connected in sequence.

[0033] The front-end localization network is configured to perform face detection and pose correction on the original image based on a multi-task convolutional neural network, and output a normalized face image.

[0034] The feature representation network is configured to perform facial feature extraction on normalized face images based on a convolutional neural network, and output a facial feature vector.

[0035] The core generative network is configured to fuse facial feature vectors with style feature vectors corresponding to selected templates based on generative adversarial networks to generate basic sketch images; the generator of the generative adversarial network is configured to concatenate facial feature vectors with style feature vectors in the intermediate layer; and the discriminator of the generative adversarial network is configured to include a realism discrimination branch and a style similarity discrimination branch.

[0036] The optimized network configuration performs line optimization and resolution enhancement on the base sketch image to generate a digital sketch artwork.

[0037] The front-end positioning network includes a front-end computing unit and a core computing unit. The front-end computing unit is deployed on the client side and is used to generate face guide boxes in real time during the image acquisition stage. The core computing unit is deployed on the server side and is used to perform pose correction on the acquired raw images.

[0038] In this embodiment, the client and server constitute an edge-cloud collaborative computing system. The hardware platform deployed on the client can be a smart all-in-one machine for offline scenarios such as shopping malls and scenic spots. This all-in-one machine integrates a high-resolution camera to capture raw images of the user. The client's main responsibilities include real-time image acquisition, local lightweight computing, and data interaction with the server. The server side typically consists of a high-performance server cluster, hosting the core artificial intelligence-specific service modules.

[0039] The AI-specific service module incorporates a multi-algorithm cascaded AI sketch generation model. This model is not a single algorithm, but rather consists of four functionally defined, sequentially connected networks: a pre-localization network, a feature representation network, a core generation network, and an effect optimization network. This cascaded design ensures that each step of processing, from the original image to the final sketch, is performed by the most suitable algorithm module, progressing layer by layer and gradually optimizing.

[0040] The pre-localization network is responsible for solving the face detection problem in complex shooting environments. Built on a multi-task convolutional neural network, it can simultaneously perform face detection, key point localization, and pose correction. Its input image may contain non-frontal faces, uneven lighting, complex backgrounds, etc., while the output is a normalized, properly posed face image. The quality of this network's output directly determines the success or failure of subsequent feature extraction and style fusion.

[0041] The core task of the feature representation network is to extract unique identity features from a normalized face image. It employs a lightweight convolutional neural network to map the face image into a high-dimensional feature vector. This feature vector needs to have sufficient discriminative power to ensure that the vector distances between different faces are large, while the vector distances between the same face under different conditions are small, thus providing a reliable basis for face identification in subsequent style fusion.

[0042] The core generative network is based on a generative adversarial network (GAN) architecture, deeply fusing facial feature vectors with user-selected style feature vectors. The generator's intermediate layers use facial feature vectors as guiding input, ensuring that the generation process always prioritizes maintaining facial recognizability. The discriminator goes beyond simply judging image authenticity; it adds a style similarity branch, constraining the generator from both realism and style matching dimensions, effectively solving the problems of abrupt style fusion and pattern collapse in traditional generative networks. The network's input is the fused feature vector, and its output is a low-resolution basic sketch image with a specific sketch style.

[0043] The effects optimization network is crucial for enhancing the final quality of the artwork. It receives the base sketch image from the core generator network and refines it through a series of post-processing algorithms. Line optimization eliminates common line jaggedness and discontinuities in the generated image, making the lines smoother and more natural. Resolution enhancement uses super-resolution technology to enlarge the low-resolution base image to a high resolution, meeting the requirements for professional printing output. The final result is a digital sketch artwork that can be directly used for display or printing.

[0044] Based on the above, through edge-cloud collaborative deployment of the front-end positioning network, the network is logically divided into a front-end computing unit and a core computing unit. The front-end computing unit is deployed on the resource-constrained client, running only the least computationally intensive and most real-time-critical part of the multi-task convolutional neural network: generating face candidate boxes and displaying a face guidance box on the client's screen in real time to guide the user in adjusting their pose to complete the capture. This process is completed locally, with no network latency, ensuring smooth interaction. The computationally intensive core computing units, such as face candidate box selection, key point detection, and precise pose correction, are deployed on the server. After the client acquires the user-confirmed raw image, it sends it to the server, where the high-performance computing unit performs precise processing. This deployment method utilizes both the low-latency interaction capabilities of the client and the powerful computing capabilities of the server, achieving a balance between smooth interaction and high-quality generation, solving the technical problem of balancing quality and speed in existing technologies.

[0045] Based on the aforementioned technical solution, in order to further improve the detection accuracy of the front-end localization network in complex environments, this embodiment makes specific improvements to the multi-task convolutional neural network.

[0046] Specifically, the multi-task convolutional neural network in the pre-localization network includes a candidate box generation subnetwork, a candidate box filtering subnetwork, and a precise localization subnetwork; wherein the candidate box generation subnetwork is configured to contain face anchor boxes corresponding to at least two preset pose angles; The multi-task convolutional neural network is also configured to perform adaptive gamma correction on the original image before inputting the original image into the candidate box generation sub-network to generate an image after illumination equalization; and after the candidate box selection sub-network outputs the feature map, generate background feature suppression weights and multiply the background feature suppression weights element-wise with the feature map output by the candidate box selection sub-network to obtain a background-suppressed feature map.

[0047] In this embodiment, the multi-task convolutional neural network adopts the classic cascaded structure, with three sub-networks connected sequentially. The candidate box generation sub-network corresponds to the P-Net (Proposal Network) in Multi-task Cascaded Convolutional Networks (MTCNN), a shallow fully convolutional network used to quickly scan the entire image and generate a large number of candidate boxes that may contain faces. To address the issue of varying user poses in offline scenarios, the anchor box design of this sub-network has been specially improved. Traditional anchor boxes typically only consider frontal faces, while this embodiment adds parameters corresponding to at least two preset pose angles to the anchor boxes, such as ±15° and ±30° for side faces. This allows the network to better recall non-frontal face regions in the initial stage, laying a good foundation for subsequent accurate filtering.

[0048] Before feeding the original image into the candidate box generation subnetwork, this embodiment performs illumination normalization processing, specifically employing an adaptive gamma correction algorithm. This algorithm first analyzes the brightness distribution histogram of the original image to calculate the overall brightness level of the current image. Then, based on a preset target brightness range, it adaptively determines a gamma value γ. For example, for an overall dark image, a gamma value less than 1 is selected. Use a value (e.g., 0.6) to brighten dark areas; for images that are generally too bright, choose a value greater than 1. Values ​​(such as 1.4) are used to darken highlights. This is achieved through pixel-level transformations. This generates an image with equalized illumination. After gamma correction, facial features become clearer in backlit or low-light environments, effectively reducing the interference of lighting conditions on subsequent detection.

[0049] The candidate box filtering sub-network corresponds to R-Net (Refine Network) in multi-task convolutional neural networks. It receives the candidate boxes output by the candidate box generation sub-network and performs more refined binary classification and bounding box regression to eliminate a large number of false background boxes that do not contain faces. After feature extraction by the convolutional layers of R-Net, a feature map is obtained. To further enhance the network's focus on face regions, this embodiment sets a lightweight attention mechanism module, such as a convolutional block attention module, after this feature map. This module can simultaneously focus on information in both channel and spatial dimensions, generating a set of background feature suppression weights. This set of weights is a matrix of the same size as the input feature map, where each element represents the importance of the corresponding pixel belonging to the face region. Finally, by multiplying the feature map output by R-Net with these background feature suppression weights element-wise (i.e., weighting each channel at each position on the feature map), features representing face regions are preserved and enhanced, while features representing background regions are suppressed. This process allows the subsequent precise localization subnetwork to operate based on a clean feature map, reducing the false detection rate caused by complex backgrounds (such as trees and building lines) and making the final detected face bounding boxes more accurate.

[0050] To ensure that the features extracted from face images contain rich identity information and have a compact dimension for subsequent fusion, this embodiment designs a lightweight feature representation network with multi-scale feature fusion.

[0051] Specifically, the convolutional neural network in the feature representation network includes multiple sequentially connected convolutional blocks; The feature representation network is also configured to extract feature maps from the outputs of at least two convolutional blocks of different depths, perform global average pooling on each feature map to obtain multiple intermediate vectors, concatenate the multiple intermediate vectors, perform L2 normalization on the concatenated vectors, and output a 512-dimensional face feature vector.

[0052] In this embodiment, the feature representation network is designed as a lightweight convolutional neural network. The network consists of multiple convolutional blocks stacked sequentially. Each convolutional block typically contains a convolutional layer, a batch normalization layer, a ReLU activation layer, and a max-pooling layer. For example, the network may contain four convolutional blocks. Shallow convolutional blocks (such as the first and second) have smaller receptive fields, extracting low-level features such as image edges and textures, which are crucial for capturing the contours and facial features of a face. Deeper convolutional blocks (such as the third and fourth) have larger receptive fields, enabling the extraction of high-level semantic features such as the shape and structure of the face.

[0053] To comprehensively utilize features from different levels, this embodiment employs a multi-scale feature fusion strategy. Specifically, during network inference, instead of using the feature map output from the last convolutional block, feature maps output from at least two convolutional blocks of different depths (e.g., the second, third, and fourth convolutional blocks) are extracted after pooling. For each extracted feature map, a global average pooling operation is performed. Global average pooling compresses the entire feature map (e.g., 14x14x256) into a vector (e.g., 256-dimensional), which represents the global information of the feature map at that layer. Thus, an intermediate vector representing local texture features can be obtained from the second convolutional block, an intermediate vector representing facial contour features can be obtained from the third convolutional block, and an intermediate vector representing the overall geometric structure can be obtained from the fourth convolutional block.

[0054] Then, these intermediate vectors extracted from different depths are concatenated along their feature dimensions to form a higher-dimensional feature vector. For example, if the dimensions of the three intermediate vectors are 128, 256, and 128 respectively, the concatenated vector will be 512-dimensional. This concatenated vector integrates multi-scale facial information from the bottom to the top. Finally, to facilitate subsequent comparison and fusion, L2 normalization is performed on this 512-dimensional concatenated vector, constraining its magnitude to 1, and the final facial feature vector is output. This design ensures that the output facial feature vector has both rich discriminative information and a uniform scale, providing high-quality input for subsequent fusion with style feature vectors.

[0055] To address the issues of unstable training, pattern collapse, and abrupt style fusion in traditional generative adversarial networks, this embodiment features a targeted optimization design for the core generative network.

[0056] Specifically, the generative adversarial network is trained using a weighted sum of the gradient penalty loss function and the style similarity loss function as the total loss function, with the gradient penalty loss function constructed based on the Earth's transport distance; The generative adversarial network is also configured to obtain the authenticity probability value and style matching degree value output by the discriminator. When the authenticity probability value is lower than the first preset threshold or the style matching degree value is lower than the second preset threshold, the loss gradient is backpropagated to the generator. The generator is then controlled to update its parameters based on the loss gradient and regenerate the basic sketch image until both the authenticity probability value and the style matching degree value reach the preset requirements or the maximum number of iterations is reached.

[0057] In this embodiment, the training and inference processes of the core generative network have been carefully designed. First, during the training phase, to address the difficulty of training traditional generative adversarial networks, a Wasserstein loss based on Earth's transport distance is employed, combined with gradient penalty techniques to enforce Lipshitz constraints. Its total loss function... Defined as gradient penalty loss and style similarity loss The weighted sum, i.e. .in, Used to constrain the discriminator, making it more stable during training and avoiding gradient vanishing or exploding. To measure the style difference between the generated image and the target style template, it can be calculated based on the mean squared error of the Gram matrix of the feature maps of the generated image and the style template in a pre-trained network (such as VGG). and These are hyperparameters that balance the two losses; for example, they can be set to 10 and 1 respectively. Through this loss function design, the training process can simultaneously optimize the realism and style matching of the generated images.

[0058] During the inference (i.e., actual generation) phase, this embodiment employs an iterative optimization mechanism. After the generator initially generates the basic sketch image, it is sent to the discriminator for evaluation. At this point, the discriminator's two branches each output two values: a probability value of realism. (A value between 0 and 1, representing the probability that the image looks like a realistic sketch) and style matching score. (A value between 0 and 1, indicating the degree of matching between the image style and the target template style).

[0059] Based on two preset thresholds: the first preset threshold Second preset threshold For example, they can be set to 0.8 and 0.92 respectively. If or This indicates that the current generated result does not meet the quality standard. At this point, the result is not discarded directly; instead, the calculated loss gradient is backpropagated to the generator. Based on this feedback gradient information, the generator fine-tunes its network parameters (i.e., performs a gradient descent update) and then generates a new base sketch image based on the same input feature vector. This process is repeated until the generated image meets the quality standard. and Or it reaches the preset maximum number of iterations (e.g., 3 times). This iterative optimization mechanism is equivalent to giving the generator the opportunity to self-correct the initial result before the official output, effectively improving the quality and stability of the final output and solving the problem of possible failure in a single generation.

[0060] In order to improve the low-resolution, flawed basic sketch images output by the core generation network into high-quality digital works, this embodiment limits the specific composition of the effect optimization network.

[0061] Specifically, the performance optimization network includes: The line optimization unit is configured to perform spur removal processing on the basic sketch image through morphological opening operation to obtain the image after spur removal, and then perform line smoothing processing on the image after spur removal through adaptive median filtering to obtain the image after line optimization. The brightness adjustment unit is configured to perform brightness and contrast adjustment on the line-optimized image by limiting contrast adaptive histogram equalization to obtain the brightness-adjusted image. The super-resolution upscaling unit is configured to perform resolution upscaling on the image after brightness and darkness adjustment through a lightweight super-resolution network, generating a digital sketch with a resolution that meets the preset output specifications.

[0062] In this embodiment, the effect optimization network is a pipeline consisting of multiple image processing units connected in series. Its input is a 256x256 resolution base sketch image output by the core generator network.

[0063] First, the line optimization unit handles line imperfections in the image. It first performs a morphological opening operation, i.e., erosion followed by dilation. The opening operation uses a small structuring element (such as a 3x3 matrix) to effectively break narrow connections and eliminate fine glitch and isolated noise, resulting in a glitch-reduced image. Then, adaptive median filtering is performed on the image. Unlike traditional median filtering which uses a fixed window, adaptive median filtering dynamically adjusts the size of the filtering window based on the noise density of local areas (e.g., increasing from 3x3 to 5x5 or 7x7), thus better preserving the edge details of the lines while smoothing them and eliminating jagged edges, avoiding excessive blurring, and ultimately obtaining a line-optimized image.

[0064] Secondly, the brightness adjustment unit is responsible for adjusting the global contrast and local lighting of the image. It employs a contrast-limited adaptive histogram equalization algorithm. This algorithm divides the image into multiple small blocks (e.g., 8x8 sub-blocks) and performs histogram equalization independently within each block to enhance local contrast. Simultaneously, it sets a contrast limit (e.g., gain ≤ 2) to suppress excessive noise amplification. After this processing, the image's brightness and darkness levels become more distinct. For sketches, to better conform to the lighting logic of hand-drawn art, after equalization, the results of previous facial landmark detection can be combined to fine-tune areas such as facial features, making shadows and highlights more natural, ultimately resulting in a brightness-adjusted image.

[0065] Finally, the super-resolution upscaling unit is responsible for enlarging the image to the required print size. Since sketch printers typically require a resolution of 3000x4000 or higher, directly upscaling a 256x256 image would result in severe blurring. Therefore, this embodiment employs a lightweight super-resolution generative adversarial network (GAN), such as a lightweight modification of an enhanced super-resolution GAN, with its parameter count controlled to within 2 million, preserving the core residual dense blocks to learn high-frequency details of the image. This network takes the shading-adjusted image as input and, through the learned mapping relationships, generates a high-resolution digital sketch with a preset output specification (e.g., 3000x4000). This lightweight design ensures that the upscaling process can be efficiently completed on the server side without becoming a performance bottleneck.

[0066] To further enhance the detail of sketches and enable post-processing parameters to adaptively match different sketch styles, this embodiment further supplements the effect optimization network.

[0067] Specifically, the performance optimization network also includes: The enhancement unit is configured to construct a Laplacian pyramid of the basic sketch image, resulting in multiple high-frequency layer images and one low-frequency layer image. The pixel values ​​corresponding to the facial features in the multiple high-frequency layer images are multiplied by a first enhancement coefficient, and the pixel values ​​corresponding to the background area are multiplied by a second enhancement coefficient. The first enhancement coefficient is greater than the second enhancement coefficient. The enhanced high-frequency layer images and the low-frequency layer images are then used for pyramid reconstruction to obtain the image with enhanced details. The style adaptive unit is configured to read the corresponding post-processing parameter set from the pre-stored parameter mapping table according to the style identifier of the selected template, and send the post-processing parameter set to the line optimization unit, the brightness adjustment unit and the detail enhancement unit respectively to control the processing intensity of each unit.

[0068] In this embodiment, the detail enhancement unit is used to refine the details of the image before or after brightness adjustment. First, it constructs a Laplacian pyramid of the input image. The Laplacian pyramid is a series of bandpass images containing detailed information of the image at different scales. High-frequency layer images (such as the upper layer of the pyramid) mainly contain fine details such as edges and textures, while low-frequency layer images (such as the bottom layer of the pyramid) mainly contain the image's outline and general structure. Next, using the coordinates of facial key points detected in the preceding localization network, a mask map of the facial features is generated. This mask map can accurately distinguish between facial features (such as eyes, eyebrows, nose, and lips) and background areas (such as cheeks, forehead, clothing, and background) in the image. Then, for each high-frequency layer image, differential enhancement is performed based on the mask map: for pixels corresponding to facial features, their values ​​are multiplied by a first enhancement coefficient greater than 1, for example, 1.5; for pixels corresponding to background areas, their values ​​are multiplied by a second enhancement coefficient close to 1 or slightly less than 1, for example, 1.0 or 0.9. This process highlights the details of facial features (such as pupil reflection and eyebrow texture), while background details remain unchanged or are slightly weakened, thereby enhancing the sense of hierarchy and artistic expression in the image. Finally, the enhanced high-frequency images from each layer are combined with the unmodified low-frequency images using a pyramid reconstruction to merge them back into a complete image with enhanced details.

[0069] The style adaptive unit is key to achieving personalized post-processing. Before running, the system pre-establishes a parameter mapping table. This table records the post-processing parameter set corresponding to each template (or each type of template) in the sketch style feature library. This parameter set includes the line thickness value and filter window size of the line optimization unit, the gamma value and contrast gain of the shading unit, and the first and second enhancement coefficients of the detail enhancement unit. When a user selects a template on the client side, the system transmits the template's "style identifier" to the server. Upon receiving this identifier, the style adaptive unit uses it as an index to read the corresponding complete post-processing parameter set from the parameter mapping table and sends these parameters to the line optimization unit, shading unit, and detail enhancement unit in the effect optimization network, respectively. In this way, different sketch styles (such as the bold lines of charcoal, the fine lines of pen, the delicate light and shadow of realism, and the flat coloring effect of cartoons) can automatically match the most suitable post-processing parameters, achieving true matching of needs and improving the style reproduction of the final work.

[0070] To further clarify the specific division of labor in the front-end cloud collaboration within the front-end positioning network and the communication methods between the client and the server, this embodiment provides detailed definitions.

[0071] Specifically, the front-end computing unit includes an image preprocessing module and a candidate box generation module in a multi-task convolutional neural network; the image preprocessing module is used to perform size scaling and pixel normalization processing on the original image, and the candidate box generation module is used to generate at least one face candidate box based on the preprocessed image and display the face guide box of the corresponding face candidate box on the touch screen in real time. The core computing unit includes a candidate box filtering module, a key point detection module, and a pose correction module in a multi-task convolutional neural network. The candidate box filtering module is used to perform confidence filtering and non-maximum suppression processing on face candidate boxes. The key point detection module is used to detect the coordinates of face key points. The pose correction module is used to calculate the pose angle based on the coordinates of face key points, correct the image to the frontal direction through affine transformation, and crop and scale it to a preset size. The client and server interact via an asynchronous communication protocol. After the client sends the original image, it releases the user interface resources. After the server generates the digital sketch, it pushes the result to the client through a callback interface.

[0072] In this embodiment, on the client side (smart all-in-one device), when the user starts taking pictures, the real-time video stream captured by the camera is sent to the front-end computing unit. First, the image preprocessing module performs necessary preprocessing on each frame of the image, such as scaling the high-resolution image to a smaller size suitable for network input (e.g., 800x450) and normalizing the pixel values ​​(e.g., mapping to the [0,1] range). Next, the candidate box generation module runs a lightweight candidate box generation sub-network (P-Net) to quickly generate a large number of candidate boxes that may contain faces on each preprocessed frame of the image. Once a candidate box with sufficiently high confidence is detected, the client will draw the corresponding face guide box (e.g., a rectangle or a facial contour) in real time on the viewfinder of the touch screen, guiding the user to place the face within the box. This process is completed entirely locally in real time, ensuring smooth interaction. When the user presses the shutter or the countdown ends, the client will capture a high-resolution original image and send it to the server.

[0073] On the server side, the core computing unit begins operation upon receiving the original image. The candidate bounding box filtering module first runs the candidate bounding box filtering sub-network (R-Net) to precisely filter the candidate bounding boxes returned by the client (or extracted from the original image), eliminating false positives. Then, the keypoint detection module runs the precise localization sub-network (O-Net) to accurately regress the coordinates of facial keypoints from the filtered candidate bounding boxes; for example, this may include 106 keypoints. Next, the pose correction module uses these keypoint coordinates to calculate the face's pose angles in 3D space (including pitch, yaw, and roll angles). Based on the calculated pose angles, an affine transformation matrix is ​​generated. This matrix is ​​used to perform an affine transformation on the face region in the original image, correcting rotated or laterally tilted face images to a standard frontal orientation. Finally, the corrected face region is cropped and scaled to the preset size (e.g., 224x224) required by the feature representation network, outputting a normalized face image.

[0074] Throughout the process, the client and server interact using an asynchronous communication protocol. This means that after the client sends the original image to the server, it does not block and wait but immediately releases user interface resources, allowing the user to immediately perform other operations, such as previewing templates or viewing previously generated works. After completing all computational tasks, including feature extraction, style fusion, and post-processing, and generating the final digital sketch, the server proactively pushes the results to the corresponding client through a pre-registered callback interface. This asynchronous, non-blocking communication mode improves the system's concurrent processing capabilities and user experience.

[0075] In order to achieve a complete offline service loop, this embodiment limits the client's delivery function after the work is generated.

[0076] Specifically, the hardware also includes a touchscreen and a professional sketch printer; The client is also used to display digital sketches on a touchscreen, generate payment QR codes, and drive a professional sketch printer to print the digital sketches after detecting a payment completion instruction, while generating a temporary download QR code associated with the digital sketches.

[0077] In this embodiment, the hardware carrier is a smart all-in-one machine that integrates a touch screen and a professional sketch printer. The touch screen is the core interface for user interaction with the system, used to display templates, captured images, previews of generated artwork, and various operation buttons.

[0078] Once the server generates the digital sketch and sends it back to the client, the client immediately displays the artwork as a large, clear image on the touchscreen. Users can carefully examine the details and, if unsatisfied, choose to re-generate the sketch. If satisfied, they can add it to their cart and proceed to checkout. After the user confirms payment through the client interface, the client calls a payment interface (such as WeChat Pay V3 API) to generate a payment QR code, which is then displayed on the touchscreen. The client's built-in payment detection module polls or listens for payment status via callbacks. Once payment completion is detected (i.e., the user successfully scans the code to pay), the client first activates its built-in professional sketch printer. The printer prints the digital sketch on dedicated sketch paper according to the preset 6-inch (102×152mm) high-definition output specifications of 4800dpi, providing the user with an immediate physical artwork. Simultaneously, the client generates a unique, time-limited temporary download QR code for this digital artwork, which is displayed on the screen or printed on a receipt. Users can scan this QR code with their mobile phones to download the digital sketch (usually in JPG or PNG format) via a secure link. Through a dual delivery approach of physical printing and digital distribution, the system perfectly meets the needs of users in different scenarios, forming a complete service loop from image acquisition to artwork acquisition.

[0079] To optimize system performance, especially data access efficiency during template switching and user sessions, this embodiment optimizes the storage configuration of the hardware carrier.

[0080] Specifically, the hardware carrier is also equipped with a solid-state drive (SSD), which has a dedicated cache partition. The dedicated cache partition is used to cache the style feature vector of the selected template, the model parameters of the front-end computing unit, and temporary data during the user session.

[0081] In this embodiment, the smart all-in-one machine is equipped with a high-performance solid-state drive (SSD) to provide fast data read and write capabilities. To further improve the access speed of critical data and reduce reliance on the network or main storage, the system has specially partitioned a logical partition on the SSD, called a dedicated cache partition.

[0082] This partition primarily handles three caching tasks. First, it caches style feature vectors. When the system starts or the template library is updated, the 512-dimensional style feature vectors corresponding to all templates are pre-loaded from the database and stored in the dedicated cache partition. When a user selects a template, the client can directly read its style feature vectors from the local cache partition without requesting them from the server, thus shortening the feature vector retrieval time. Second, it caches model parameters for pre-processing units. Lightweight models deployed on the client (such as model parameters for image preprocessing and candidate box generation modules) are also stored here. This allows the client program to quickly load models upon startup or restart, without needing to download them remotely each time. Third, it caches temporary data during user sessions. Temporary data generated during a complete user service session, such as the original captured images, intermediate processing results, and generated preview images, can be written to the dedicated cache partition. This not only reduces memory usage but also provides the possibility of data recovery in case of unexpected interruptions or allows for quick retrieval of previously generated work when the user needs to reprint. After the session ends, this temporary data can be cleaned up according to a preset strategy (such as after 30 minutes) to free up cache space. Through this tiered storage and caching strategy, the system effectively reduces network I / O and disk I / O bottlenecks, improving overall response speed and concurrent processing capabilities.

[0083] In one embodiment, such as Figure 2 As shown, a working method for the artificial intelligence-based sketching robot system described above is provided, the method comprising: Step S1: The client captures a raw image containing a human face using its camera; Step S2: The client sends the original image to the server; Step S3: The server processes the original image using a multi-algorithm cascaded AI sketching generation model built into the AI-specific service module, including: Step S31: Use the pre-localization network based on a multi-task convolutional neural network to perform face detection and pose correction on the original image, and output the normalized face image; Step S32: Use a feature representation network based on a convolutional neural network to extract facial features from the normalized face image and output a facial feature vector; Step S33: The core generative network is used to fuse the face feature vector with the style feature vector corresponding to the selected template based on the generative adversarial network to generate a basic sketch image; wherein, the generator of the generative adversarial network concatenates the face feature vector with the style feature vector in the intermediate layer, and the discriminator of the generative adversarial network includes a realism discrimination branch and a style similarity discrimination branch. Step S34: Use an effects optimization network to perform line optimization and resolution enhancement on the basic sketch image to generate a digital sketch artwork; Step S4: The server sends the digital sketch to the client; Step S5: The client displays the digital sketch on the touchscreen.

[0084] It should be noted that this method corresponds to the aforementioned AI-based sketching robot system. Therefore, any parts of this method that are not specifically described (including but not limited to specific technical means and effects) can be referred to the relevant descriptions in the aforementioned AI-based sketching robot system, and will not be repeated here.

[0085] In the embodiments provided by this invention, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code, or any suitable combination thereof. For hardware implementation, the processor can be implemented in one or more of the following: application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, other electronic units designed to implement the functions described herein, or combinations thereof. For software implementation, some or all of the processes of the embodiments can be performed by a computer program instructing the associated hardware. During implementation, the program can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a computer. Computer-readable storage media can include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible to a computer.

[0086] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A sketching robot system based on artificial intelligence, characterized in that, include: Client and server; The client is deployed on a hardware carrier equipped with a camera to capture raw images containing human faces; The server includes an artificial intelligence-specific service module, which has a built-in artificial intelligence sketching generation model with multiple cascaded algorithms. The AI ​​sketch generation model includes a pre-localization network, a feature representation network, a core generation network, and an effect optimization network connected in sequence. The pre-positioning network is configured to perform face detection and pose correction on the original image based on a multi-task convolutional neural network, and output a normalized face image; The feature representation network is configured to perform facial feature extraction on the normalized face image based on a convolutional neural network and output a facial feature vector; The core generative network is configured to fuse the facial feature vector with the style feature vector corresponding to the selected template based on the generative adversarial network to generate a basic sketch image; the generator of the generative adversarial network is configured to concatenate the facial feature vector with the style feature vector in the intermediate layer; and the discriminator of the generative adversarial network is configured to include a realism discrimination branch and a style similarity discrimination branch. The effect optimization network is configured to perform line optimization and resolution enhancement on the base sketch image to generate a digital sketch artwork; The front-end positioning network includes a front-end computing unit and a core computing unit. The front-end computing unit is deployed on the client and is used to generate face guidance boxes in real time during the image acquisition stage. The core computing unit is deployed on the server and is used to perform pose correction on the acquired raw images.

2. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The multi-task convolutional neural network in the pre-localization network includes a candidate box generation sub-network, a candidate box filtering sub-network, and a precise localization sub-network; wherein the candidate box generation sub-network is configured to include face anchor boxes corresponding to at least two preset pose angles. The multi-task convolutional neural network is further configured to perform adaptive gamma correction on the original image before inputting the original image into the candidate box generation sub-network to generate an image after illumination equalization; and after the candidate box filtering sub-network outputs a feature map, generate background feature suppression weights, and multiply the background feature suppression weights element-wise with the feature map output by the candidate box filtering sub-network to obtain a background-suppressed feature map.

3. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The convolutional neural network in the feature representation network includes multiple sequentially connected convolutional blocks; The feature representation network is further configured to extract feature maps output by at least two convolutional blocks of different depths, perform global average pooling on each feature map to obtain multiple intermediate vectors, concatenate the multiple intermediate vectors, perform L2 normalization on the concatenated vectors, and output a 512-dimensional face feature vector.

4. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The generative adversarial network is trained using a weighted sum of a gradient penalty loss function and a style similarity loss function as the total loss function, wherein the gradient penalty loss function is constructed based on the Earth's transport distance. The generative adversarial network is further configured to obtain the authenticity probability value and style matching degree value output by the discriminator. When the authenticity probability value is lower than a first preset threshold or the style matching degree value is lower than a second preset threshold, the loss gradient is backpropagated to the generator, and the generator is controlled to update the parameters based on the loss gradient and regenerate the basic sketch image until the authenticity probability value and the style matching degree value both reach the preset requirements or the maximum number of iterations is reached.

5. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The performance optimization network includes: The line optimization unit is configured to perform spur removal processing on the basic sketch image through morphological opening operation to obtain an image after spur removal, and to perform line smoothing processing on the image after spur removal through adaptive median filtering to obtain an image after line optimization. The brightness adjustment unit is configured to perform brightness and contrast adjustment on the line-optimized image by limiting contrast adaptive histogram equalization to obtain the brightness-adjusted image. The super-resolution magnification unit is configured to perform resolution magnification processing on the brightness-adjusted image through a lightweight super-resolution network to generate a digital sketch with a resolution that meets the preset output specifications.

6. The artificial intelligence-based sketching robot system according to claim 5, characterized in that, The performance optimization network also includes: The enhancement unit is configured to construct the Laplacian pyramid of the basic sketch image to obtain multiple high-frequency layer images and one low-frequency layer image. The pixel values ​​corresponding to the facial features in the multiple high-frequency layer images are multiplied by a first enhancement coefficient, and the pixel values ​​corresponding to the background area are multiplied by a second enhancement coefficient. The first enhancement coefficient is greater than the second enhancement coefficient. The enhanced high-frequency layer images and the low-frequency layer images are then used for pyramid reconstruction to obtain an image with enhanced details. The style adaptive unit is configured to read the corresponding post-processing parameter set from a pre-stored parameter mapping table according to the style identifier of the selected template, and send the post-processing parameter set to the line optimization unit, the brightness adjustment unit and the detail enhancement unit respectively, so as to control the processing intensity of each unit.

7. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The pre-processing unit includes an image preprocessing module and a candidate box generation module in the multi-task convolutional neural network; the image preprocessing module is used to perform size scaling and pixel normalization processing on the original image, and the candidate box generation module is used to generate at least one face candidate box based on the preprocessed image, and to display the face guide box corresponding to the face candidate box on the touch screen in real time. The core computing unit includes a candidate box filtering module, a key point detection module, and a pose correction module in the multi-task convolutional neural network. The candidate box filtering module is used to perform confidence filtering and non-maximum suppression processing on the face candidate boxes. The key point detection module is used to detect the coordinates of face key points. The pose correction module is used to calculate the pose angle based on the coordinates of the face key points, correct the image to the frontal direction through affine transformation, and crop and scale it to a preset size. The client and the server interact via an asynchronous communication protocol. After the client sends the original image, it releases user interface resources. After the server generates the digital sketch, it pushes the result to the client via a callback interface.

8. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The hardware carrier is also equipped with a touch screen and a professional sketch printer; The client is also used to display the digital sketch on the touch screen, generate a payment QR code, and after detecting a payment completion instruction, drive the professional sketch printer to perform physical printing output on the digital sketch, while generating a temporary download QR code associated with the digital sketch.

9. The artificial intelligence-based sketching robot system according to claim 1, characterized in that, The hardware carrier is also equipped with a solid-state drive, which has a dedicated cache partition. The dedicated cache partition is used to cache the style feature vector of the selected template, the model parameters of the front-end computing unit, and temporary data during the user session.

10. A method for operating an artificial intelligence-based sketching robot system as described in any one of claims 1-9, characterized in that, The method includes: Step S1: The client captures a raw image containing a human face through a camera; Step S2: The client sends the original image to the server; Step S3: The server processes the original image using a multi-algorithm cascaded AI sketching generation model built into the AI-specific service module, including: Step S31: Use the pre-localization network based on a multi-task convolutional neural network to perform face detection and pose correction on the original image, and output the normalized face image; Step S32: Use a feature representation network based on a convolutional neural network to extract facial features from the normalized face image and output a facial feature vector; Step S33: Using the core generative network based on the generative adversarial network, the face feature vector is fused with the style feature vector corresponding to the selected template to generate a basic sketch image; wherein, the generator of the generative adversarial network concatenates the face feature vector with the style feature vector in the intermediate layer, and the discriminator of the generative adversarial network includes a realism discrimination branch and a style similarity discrimination branch; Step S34: Use an effects optimization network to perform line optimization and resolution enhancement on the base sketch image to generate a digital sketch artwork; Step S4: The server sends the digital sketch to the client; Step S5: The client displays the digital sketch on the touch screen.