An image recognition-based scalp micro-pigmentation scheme generation method, system, device and storage medium
By using convolutional neural networks and 3D digital modeling technology, a scalp coloring scheme is generated, which solves the problems of traditional scalp coloring techniques that rely on technician experience and have poor repeatability, and achieves personalized and scientific scalp coloring effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUZHOU YULANG INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-04-03
- Publication Date
- 2026-07-03
AI Technical Summary
Traditional scalp coloring techniques rely on the technician's experience, have poor repeatability, cannot simulate the color transmission attenuation under natural light, and ignore individual scalp characteristics, resulting in unnatural and inconsistent coloring effects.
A convolutional neural network is used to extract scalp region features, construct a three-dimensional digital model, divide the set of coloring partitions, generate coloring parameters, and combine the three-dimensional digital model to simulate the color transmission effect under lighting conditions to generate a scalp coloring scheme.
It achieves personalized and scientific scalp coloring solutions, improves the naturalness and safety of coloring results, and solves the problems of reliance on technician experience and poor repeatability in traditional methods.
Smart Images

Figure CN122336093A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of scalp coloring technology, and in particular relates to a method, system, device and storage medium for generating scalp micro-coloring schemes based on image recognition. Background Technology
[0002] With the development of medical aesthetics technology, scalp micropigmentation has gradually emerged as a hair color adjustment solution. This technology simulates the natural hair color distribution through pigment deposition, enabling personalized hairstyle design and hair loss coverage. However, traditional scalp micropigmentation solutions mainly rely on manual drawing by technicians or simple template matching based on two-dimensional images, which presents certain technical bottlenecks. In traditional methods, technicians need to rely on experience to judge physiological characteristics such as scalp curvature and hair follicle density, manually planning the coloring path and parameters. This results in coloring effects that are highly dependent on individual skill levels, with poor repeatability and difficulty in standardization. Existing solutions often ignore the influence of the scalp's three-dimensional morphology on light and shadow, failing to simulate the color transmission attenuation effect under natural lighting, making it easy for color differences to appear at the edges of the colored area, resulting in a harsh and unnatural overall visual effect. Traditional techniques lack the ability to conduct refined analysis of individual scalp characteristics, leading to unresolved issues such as uneven hair follicle distribution and the identification of scalp lesions, resulting in insufficient scientific rigor and safety of the coloring solution. These problems severely restrict the popularization and application of scalp micropigmentation technology, urgently requiring an intelligent solution based on multimodal data analysis and three-dimensional modeling. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, system, device, and storage medium for generating scalp micro-coloring schemes based on image recognition that can solve the above problems.
[0004] In a first aspect, this application provides a method for generating a scalp micro-coloring scheme based on image recognition, including:
[0005] Image data of the target scalp region is acquired, and features of the scalp region are extracted using a convolutional neural network based on the image data;
[0006] A three-dimensional digital model is constructed based on the features of the scalp region;
[0007] Based on a 3D digital model, a set of colored partitions is defined;
[0008] Based on the set of shading partitions and combined with preset shading rules, shading parameters are generated;
[0009] Based on the coloring parameters and combined with the three-dimensional digital model, a scalp coloring scheme is generated;
[0010] Based on the scalp coloring scheme and combined with a 3D digital model, the coloring effect is generated.
[0011] In one embodiment, the convolutional neural network includes a first parallel branch, a second parallel branch, and a third parallel branch;
[0012] Based on image data, a convolutional neural network is used to extract features of the scalp region, including:
[0013] Based on image data, spatial geometric features are extracted using the first parallel branch;
[0014] Based on image data, a second parallel branch is used to extract skin color distribution features through color histogram analysis;
[0015] Based on image data, the third parallel branch is used to extract hair follicle distribution features through wavelet transform;
[0016] By integrating skin color distribution features, hair follicle distribution features, and spatial geometric features, scalp region features are obtained.
[0017] In one embodiment, a three-dimensional digital model is constructed based on scalp region features, including:
[0018] Based on the geometric features of the scalp region, the Delaunay triangulation algorithm is used to construct the first three-dimensional mesh framework;
[0019] The mesh topology of the first three-dimensional mesh frame is optimized using the Poisson surface reconstruction algorithm to obtain the second three-dimensional mesh frame;
[0020] The skin color distribution features and hair follicle distribution features are concatenated to generate a composite feature tensor.
[0021] The composite feature tensor is mapped to the mesh nodes of the second three-dimensional mesh framework to generate a three-dimensional digital model.
[0022] In one embodiment, based on a three-dimensional digital model, a set of shading partitions is divided, including:
[0023] Clustering of composite feature tensors yields tensor clustering results;
[0024] Based on the grid nodes corresponding to the composite feature tensors in the tensor clustering results, the first set of colored partitions is divided from the three-dimensional digital model;
[0025] Based on the mesh topology of the 3D digital model, scalp curvature features are extracted.
[0026] Based on the scalp curvature characteristics, the first set of colored partitions is divided to obtain the second set of colored partitions;
[0027] Smooth the boundaries of the second colored partition set to obtain the third colored partition set;
[0028] Based on a preset area threshold, morphological closing operations are used to eliminate isolated partitions smaller than the preset area threshold in the third coloring partition set, resulting in the fourth coloring partition set.
[0029] Based on the fourth set of colored partitions, the topological connection relationship between each partition is established to obtain the set of colored partitions.
[0030] In one embodiment, a scalp coloring scheme is generated based on coloring parameters and a three-dimensional digital model, including:
[0031] Based on the topological connectivity of the set of shading partitions, and combined with the grid nodes of the 3D digital model, a graph search algorithm is used to generate the first shading path covering each shading partition.
[0032] Based on the shading parameters, the path density of the first shading path is adjusted to obtain the second shading path;
[0033] The Bézier curve fitting algorithm is used to optimize the path inflection points of the second coloring path to obtain the third coloring path;
[0034] Based on the third coloring path, identify cross-partition path segments;
[0035] Calculate the path density difference and path inflection point curvature difference of cross-partition path segments;
[0036] Transition paths are generated by interpolation based on path density differences and path inflection point curvature differences.
[0037] Based on the transition path and the third coloring path, a fourth coloring path is obtained by connecting and integrating them.
[0038] The coloring parameters are mapped to the fourth coloring path to generate a scalp coloring scheme.
[0039] In one embodiment, the formula for dividing the first set of colored partitions based on scalp curvature features is as follows:
[0040]
[0041] in, Let be the weighted similarity function between nodes i and j, used to divide the first colored partition based on the similarity threshold; This is the spatial distance attenuation coefficient; It is a curvature inhibition factor; Let i be the Gaussian curvature value of node i. Let be the Gaussian curvature value of node j; The adjacent area weighting coefficient; This is a parameter for adjusting area similarity; Let be the average area of the adjacent triangles of node i. Let be the average area of the adjacent triangles of node j; Let be the Euclidean distance between nodes i and j. This is the distance decay exponent.
[0042] In one embodiment, based on a scalp coloring scheme and combined with a three-dimensional digital model, a coloring effect is generated, including:
[0043] A physical model of the scalp is constructed based on a three-dimensional digital model using the finite element method.
[0044] The scalp coloring scheme is mapped to the scalp physical model to generate the first coloring distribution;
[0045] A second shading distribution is generated by simulating the shading transmission attenuation effect under illumination conditions using a ray tracing algorithm.
[0046] Based on the second coloring distribution, boundary optimization is performed to obtain the coloring performance.
[0047] Secondly, this application also provides a scalp micro-coloring scheme generation system based on image recognition, comprising:
[0048] The image feature extraction module is used to acquire image data of the target scalp area and extract scalp area features based on the image data using a convolutional neural network.
[0049] The 3D model building module is used to construct 3D digital models based on scalp region features.
[0050] The coloring partitioning module is used to divide a set of coloring partitions based on a 3D digital model;
[0051] The coloring parameter generation module is used to generate coloring parameters based on the coloring partition set and in combination with preset coloring rules;
[0052] The color scheme generation module is used to generate scalp color schemes based on color parameters and a 3D digital model.
[0053] The effect generation module is used to generate coloring effects based on the scalp coloring scheme and combined with a 3D digital model.
[0054] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method for generating a scalp micro-coloring scheme based on image recognition.
[0055] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method for generating a scalp micro-coloring scheme based on image recognition.
[0056] The aforementioned method, system, device, and storage medium for generating scalp micro-coloring schemes based on image recognition acquire image data of the target scalp area and extract scalp area features using a convolutional neural network. This allows for the identification of scalp physiological characteristics, eliminating reliance on technician experience. A three-dimensional digital model is constructed based on these scalp area features, fully restoring the scalp's three-dimensional morphology and providing a model foundation for refined coloring. The three-dimensional digital model is used to divide the scalp into coloring zones, enabling differentiated scalp area division and addressing the difficulty of fine analysis due to uneven hair follicle distribution. Coloring parameters are generated based on the coloring zone set and preset coloring rules, standardizing and adapting to individual needs. A scalp coloring scheme is generated based on these coloring parameters and the three-dimensional digital model, scientifically planning the coloring path and avoiding uneven coloring caused by manual planning. The coloring execution effect is generated based on the scalp coloring scheme and the three-dimensional digital model, simulating color decay under illumination, providing effect viewing, and improving the scientific rigor, safety, and visual appeal of scalp micro-coloring. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a flowchart of a scalp micro-coloring scheme generation method based on image recognition according to the present invention;
[0059] Figure 2 This is a structural diagram of a scalp micro-coloring scheme generation system based on image recognition according to the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0061] In one embodiment, such as Figure 1As shown, a method for generating scalp micro-coloring schemes based on image recognition is provided. This embodiment illustrates the application of this method to a scheme generation terminal. It is understood that this method can also be applied to a server, and can also be applied to an architecture including a terminal and a server, and implemented through the interaction between the terminal and the server. The hardware device of this application includes an image acquisition device, a local operation terminal, a server, and a coloring execution device. When there are needs such as hair loss area coverage, uneven scalp hair color correction, and sparse hair follicle simulation, the image acquisition device acquires high-definition image data of the target scalp area and transmits it to the local operation terminal. After the local operation terminal completes data preprocessing, it uploads the data to the server to generate the coloring scheme and sends the coloring scheme and simulation effect back to the local operation terminal for preview and reference, and synchronizes it to the coloring execution device to provide operation instructions.
[0062] In this embodiment, the method includes the following steps:
[0063] S01: Acquire image data of the target scalp region, and extract scalp region features based on the image data using a convolutional neural network.
[0064] Optionally, the solution generation terminal can acquire image data of the scalp region through image acquisition devices (such as high-resolution cameras or medical imaging instruments). This image data may include color, texture, and geometric information. A convolutional neural network (CNN) is a deep learning model that can automatically learn multi-level features in an image to achieve feature extraction (using components such as convolutional layers and pooling layers to perform non-linear transformations on the input image to output feature vectors representing the physiological characteristics of the scalp). In implementation, the solution generation terminal can input the image data into the CNN, which calculates scalp region features through forward propagation. These features may include spatial geometric distribution, skin color variations, and hair follicle density. Based on the trained CNN, feature recognition can be completed without manual intervention.
[0065] S02, based on the characteristics of the scalp region, constructs a three-dimensional digital model.
[0066] Optionally, the scheme generation terminal can create an initial three-dimensional framework based on the geometric information in the scalp region features using a mesh generation algorithm (such as triangulation), and optimize the mesh topology structure through a surface reconstruction algorithm to improve model accuracy and smoothness. The scheme generation terminal can also perform feature fusion on non-geometric features (such as skin color and hair follicle distribution) to generate a composite tensor, and map it to the mesh nodes of the initial three-dimensional framework to form a three-dimensional digital model integrating physiological characteristics, providing a model basis for computational analysis.
[0067] S03, based on a three-dimensional digital model, divides the set into colored partitions.
[0068] Optionally, the scheme generation terminal can divide the data based on the feature similarity of the nodes in the 3D digital model (e.g., using clustering algorithms to group composite feature tensors to identify uniform regions), curvature analysis (e.g., extracting Gaussian curvature to distinguish high curvature boundaries), or topology optimization (e.g., smoothing partition edges and eliminating isolated regions through morphological operations) to generate a set of colored partitions with continuity and differentiation. This is used to solve the problem of uneven coloring caused by scalp physiological characteristics (e.g., uneven hair follicle density or curvature changes) and to provide a structured basis for the subsequent generation of coloring parameters.
[0069] S04 generates coloring parameters based on the coloring partition set and in combination with preset coloring rules.
[0070] Optionally, the scheme generation terminal can utilize a set of divided coloring partitions to automatically calculate coloring parameters through predefined coloring rules (such as color matching criteria, pigment distribution specifications, operating parameters mapped to the coloring device, and optical attenuation models). The scheme generation terminal can apply a rule engine or optimization algorithm (such as parametric mapping or machine learning models) based on partition features (such as partition area, mean curvature, or skin tone consistency) to output a parameter set including pigment concentration, coloring depth, device pressure parameters, coloring path density, and color values, adapting to individual scalp differences and improving the accuracy and naturalness of the coloring scheme.
[0071] S05 generates a scalp coloring scheme based on coloring parameters and a three-dimensional digital model.
[0072] Optionally, the scheme generation terminal can automatically create specific coloring schemes based on a 3D digital model using path generation and optimization algorithms (such as path planning or curve fitting techniques based on graph search). The scheme generation terminal can map coloring parameters to physical paths based on the model's mesh nodes and partition topology (such as calculating the coloring trajectory covering each partition through algorithms and adjusting parameters such as path density to adapt to individual differences), while handling cross-partition transitions (such as smoothing path turning points through interpolation algorithms), so that the scheme maintains continuity and naturalness in 3D space, and transforms abstract parameters into executable coloring instructions.
[0073] S06, based on the scalp coloring scheme and combined with a 3D digital model, generates the coloring effect.
[0074] Optionally, the scheme generation terminal can use effect simulation technology (such as physical rendering, optical calculation or visualization algorithm) to generate shading effects: the scheme generation terminal can build a simulation model based on the mesh topology and physical properties of the three-dimensional digital model (such as using the finite element method to build a scalp physical model to simulate pigment deposition), map the shading scheme onto the surface of the simulation model, and then use ray tracing algorithm to simulate color transmission, attenuation effect and boundary transition under natural lighting, outputting a visual effect preview, making the shading scheme visual and available for user reference.
[0075] In one embodiment, the convolutional neural network includes a first parallel branch, a second parallel branch, and a third parallel branch;
[0076] Based on image data, a convolutional neural network is used to extract features of the scalp region, including:
[0077] S11, based on image data, uses the first parallel branch to extract spatial geometric features.
[0078] Optionally, the convolutional neural network used by the solution generation terminal to extract scalp region features is a multi-branch parallel architecture, configured with a first parallel branch, a second parallel branch, and a third parallel branch. Each branch can independently complete the extraction operation of features in its corresponding dimension, so as to efficiently extract multi-dimensional features from the image data of the target scalp region. The solution generation terminal can extract spatial geometric features based on the image data using the first parallel branch. This branch processes the input image through convolutional layers and pooling layers to learn the three-dimensional morphological information of the scalp, such as surface curvature, concavity and convexity, and other geometric attributes, and automatically captures the spatial distribution using a deep learning model.
[0079] S12, based on image data, uses a second parallel branch to extract skin color distribution features through color histogram analysis.
[0080] Optionally, the solution generation terminal can employ a second parallel branch to perform color histogram analysis on the image data, such as calculating the pixel color frequency distribution in the HSV or LAB color space, identifying uniform and variable areas of skin color, and further calculating color attributes such as scalp skin color gradient, color difference distribution, and color uniformity.
[0081] S13, based on image data, uses the third parallel branch to extract hair follicle distribution features through wavelet transform.
[0082] Optionally, the scheme generation terminal can employ a third parallel branch to perform multi-scale analysis of image texture information through wavelet transform (e.g., using multi-resolution analysis: Daubechies wavelet basis) to decompose image texture, detect texture density and spatial arrangement, and obtain hair follicle distribution features, such as hair follicle density, arrangement morphology and distribution regularity.
[0083] S14 integrates skin color distribution features, hair follicle distribution features, and spatial geometric features to obtain scalp region features.
[0084] For example, the solution generation terminal can integrate spatial geometric features, skin color distribution features, and hair follicle distribution features through feature splicing and normalization to generate composite scalp region features. This process can utilize fully connected layers or attention mechanisms to optimize feature interaction and achieve the output of feature tensors that integrate color, texture, and geometric information, providing a foundation for subsequent 3D modeling.
[0085] In one embodiment, a three-dimensional digital model is constructed based on scalp region features, including:
[0086] S21, based on the geometric features of the scalp region, uses the Delaunay triangulation algorithm to construct the first three-dimensional mesh framework.
[0087] Optionally, the solution generation terminal can obtain the three-dimensional contour points of the scalp based on the spatial geometric features in the scalp region, and use the Delaunay triangulation algorithm to generate a mesh based on the three-dimensional contour points of the scalp. At the same time, by constraining the angle and side length of the triangular units, a non-intersecting and non-overlapping triangular mesh structure can be constructed to obtain the initial first three-dimensional mesh framework, thus initially restoring the spatial geometric shape of the scalp.
[0088] S22, the mesh topology of the first three-dimensional mesh frame is optimized using the Poisson surface reconstruction algorithm to obtain the second three-dimensional mesh frame.
[0089] Optionally, the solution generation terminal can use the Poisson surface reconstruction algorithm to perform topology optimization on the first three-dimensional mesh frame. For example, by solving the Poisson equation, the connection relationship of the mesh can be corrected, defects such as voids and deformed units in the mesh can be removed, and the smoothness and regularity of the mesh can be improved to obtain a second three-dimensional mesh frame with a more accurate structure.
[0090] S23, combine the skin color distribution features and hair follicle distribution features to generate a composite feature tensor.
[0091] Optionally, the solution generation terminal can normalize the dimensions of skin color distribution features and hair follicle distribution features and splice the features, and fuse the information of the two types of features to generate a composite feature tensor. This composite feature tensor can simultaneously represent the scalp's color and hair follicle distribution attributes.
[0092] S24 maps the composite feature tensor to the mesh nodes of the second three-dimensional mesh frame to generate a three-dimensional digital model.
[0093] Specifically, the solution generation terminal can match the composite feature tensor to each grid node of the second three-dimensional mesh frame through coordinate association mapping, so that each grid node carries the corresponding skin color and hair follicle feature data, generating a three-dimensional digital model that integrates scalp geometry, skin color distribution and hair follicle distribution information, providing an accurate model foundation for digital processing.
[0094] In one embodiment, based on a three-dimensional digital model, a set of shading partitions is divided, including:
[0095] S31, cluster the composite feature tensors to obtain the tensor clustering results.
[0096] Optionally, the scheme generation terminal can use the K-Means clustering algorithm to perform clustering operations on the composite feature tensors corresponding to each grid node in the 3D digital model according to feature similarity, and obtain tensor clustering results.
[0097] S32, based on the grid nodes corresponding to the composite feature tensors in the tensor clustering results, divide the three-dimensional digital model into a first set of colored partitions.
[0098] Optionally, the scheme generation terminal can divide the 3D digital model into multiple sub-regions with similar feature distributions based on the grid node affiliation corresponding to the composite feature tensor in the clustering results, forming a first coloring partition set.
[0099] S33, based on the mesh topology of a three-dimensional digital model, extracts scalp curvature features.
[0100] Optionally, the solution generation terminal can calculate the Gaussian curvature and average curvature of each grid node based on the grid topology of the three-dimensional digital model, and extract scalp curvature features that can characterize the scalp's concavity and convexity.
[0101] S34. Based on the scalp curvature characteristics, the first set of colored partitions is divided to obtain the second set of colored partitions.
[0102] Optionally, the scheme generation terminal can, based on the scalp curvature features, use a preset weighted similarity function, combined with curvature values, adjacent areas and spatial distance, to perform a secondary division of the first colored partition set, thereby obtaining a second colored partition set.
[0103] S35, perform boundary smoothing on the second colored partition set to obtain the third colored partition set.
[0104] Optionally, the scheme generation terminal can use a Gaussian filtering algorithm to smooth the partition boundaries of the second colored partition set, eliminating jagged edges and abrupt changes, and obtaining a third colored partition set with continuous boundaries.
[0105] S36. Based on a preset area threshold, morphological closing operations are used to eliminate isolated partitions in the third coloring partition set that are smaller than the preset area threshold, thus obtaining the fourth coloring partition set.
[0106] Optionally, the scheme generation terminal can use morphological closing operations to fill the small gaps in the partitions according to a preset area threshold, while removing isolated small partitions with an area smaller than the threshold, to obtain a set of fourth colored partitions with regular partitioning.
[0107] S37. Based on the fourth set of colored partitions, establish the topological connection relationship between each partition to obtain the set of colored partitions.
[0108] For example, the scheme generation terminal can establish topological connection relationships between partitions based on the spatial adjacency status of each partition in the fourth coloring partition set, set the adjacency and connection attributes of each partition, and form a coloring partition set with reasonable partitioning, smooth boundaries and complete topology, providing a standardized partitioning basis for subsequent coloring parameter generation.
[0109] In one embodiment, a scalp coloring scheme is generated based on coloring parameters and a three-dimensional digital model, including:
[0110] S41, based on the topological connection relationship of the set of shading partitions, combined with the grid nodes of the three-dimensional digital model, uses a graph search algorithm to generate the first shading path covering each shading partition.
[0111] Optionally, the solution generation terminal can use the grid nodes of the 3D digital model as the basic nodes for path planning, based on the topological connection relationship of the set of colored partitions, and traverse all colored partitions using an algorithm such as A* graph search to generate a first colored path that can completely cover each partition.
[0112] S42, based on the shading parameters, adjust the path density of the first shading path to obtain the second shading path.
[0113] Optionally, the scheme generation terminal can adjust the density of the first coloring path according to parameters such as pigment concentration and color value in the preset coloring parameters that can affect the coloring effect in conjunction with the path density. For example, the path can be made denser in areas with large scalp curvature and sparse hair follicle distribution, and the path can be made sparser in flat areas to obtain a second coloring path that adapts to the physiological characteristics of the scalp.
[0114] S43, the Bezier curve fitting algorithm is used to optimize the path inflection points of the second coloring path to obtain the third coloring path.
[0115] Optionally, the scheme generation terminal can use a cubic Bézier curve fitting algorithm to smooth and optimize the turning points of the second coloring path, correct the path corner angles, and obtain a smooth third coloring path.
[0116] S44 identifies cross-partition path segments based on the third coloring path.
[0117] Optionally, the scheme generation terminal can identify path segments that cross different coloring partitions based on the spatial distribution of the third coloring path.
[0118] S45, calculate the path density difference and path inflection point curvature difference of cross-partition path segments.
[0119] Optionally, the scheme generation terminal can calculate the difference in path density and the difference in curvature at the turning point on both sides of the path segment based on the path segment of the same colored partition.
[0120] S46 generates a transition path by interpolation based on the path density difference and the curvature difference of the path inflection point.
[0121] Optionally, the solution generation terminal can use a bilinear interpolation algorithm to generate a naturally connected transition path based on the path density difference and the curvature difference at the turning point.
[0122] S47, based on the transition path and the third coloring path, is connected and integrated to obtain the fourth coloring path.
[0123] Optionally, the scheme generation terminal can connect and integrate the transition path with the third coloring path to eliminate path breaks at the partition boundaries and obtain a continuous and complete fourth coloring path.
[0124] S48 maps the coloring parameters to the fourth coloring path to generate a scalp coloring scheme.
[0125] Specifically, the scheme generation terminal can map data such as pigment concentration, coloring depth, and color value in the coloring parameters to each node of the fourth coloring path, thereby achieving parameter-path matching and generating a scalp coloring scheme that can be directly executed.
[0126] In one embodiment, S51, the calculation formula for dividing the first colored partition set based on scalp curvature features is as follows:
[0127]
[0128] in, Let be the weighted similarity function between nodes i and j, used to divide the first colored partition based on the similarity threshold; This is the spatial distance attenuation coefficient; It is a curvature inhibition factor; Let i be the Gaussian curvature value of node i. Let be the Gaussian curvature value of node j; The adjacent area weighting coefficient; This is a parameter for adjusting area similarity; Let be the average area of the adjacent triangles of node i. Let be the average area of the adjacent triangles of node j; Let be the Euclidean distance between nodes i and j. This is the distance decay exponent.
[0129] For example, the weighted similarity function This is the core calculation basis for refining the first colored partition set based on scalp curvature features. It is used to quantify the comprehensive feature similarity between any two mesh nodes i and j in the 3D digital model, providing a standardized numerical reference for partition boundary determination. In the calculation formula, the exponent term... The Gaussian curvature values and curvature suppression factors of nodes i and j are merged. This index is used to adjust the degree of influence of curvature difference on similarity. The larger the curvature difference between two nodes, the smaller the value of this index, and the lower the corresponding similarity. Combining the mean area of adjacent triangles of a node, the adjacent area weighting coefficient With area similarity adjustment parameters The weighting of the area feature is adjusted by the proximity of adjacent nodes; the closer the areas of adjacent nodes are, the higher this value is. The distance decay index reflects the attenuation effect of spatial distance on similarity. Controlling the attenuation magnitude, the greater the spatial distance between two nodes, the lower their similarity; spatial distance attenuation coefficient. The weight ratios of each factor are used to unify and integrate the weights, and the comprehensive weighted similarity σ(i,j) is output. This calculation result is directly used as the judgment threshold for the secondary division of the first colored partition. It is linked with the scalp curvature feature extraction and tensor clustering steps to divide the second colored partition set, providing data support for subsequent partition boundary smoothing, isolated partition removal and topological connection relationship establishment, ensuring that the colored partitions are highly matched with the three-dimensional morphology and physiological characteristics of the scalp.
[0130] In one embodiment, based on a scalp coloring scheme and combined with a three-dimensional digital model, a coloring effect is generated, including:
[0131] S61 is based on a three-dimensional digital model and uses the finite element algorithm to construct a physical model of the scalp.
[0132] Optionally, the solution generation terminal can discretize the three-dimensional digital model into several regular finite element units based on the mesh topology, geometric shape and feature distribution of the three-dimensional digital model using the finite element algorithm. Each unit is then assigned physical parameters such as the scalp's inherent elastic modulus and optical transmittance, thus constructing a scalp physical model that can simulate the physical and optical response characteristics of the scalp, laying the foundation for realistic simulation of the coloring effect.
[0133] S62, map the scalp coloring scheme to the scalp physical model to generate the first coloring distribution.
[0134] Optionally, the scheme generation terminal can assign core parameters such as the coloring path trajectory, pigment concentration, and coloring depth in the scalp coloring scheme to the corresponding grid cells of the scalp physical model through spatial coordinate association mapping, forming an initial pigment deposition distribution that matches the scheme, i.e., the first coloring distribution.
[0135] S63 uses a ray tracing algorithm to simulate the shading transmission attenuation effect under illumination conditions to generate a second shading distribution.
[0136] Optionally, the solution generation terminal can use a ray tracing algorithm to simulate the light propagation path under different angles of illumination in a real environment, calculate the light transmission, absorption and scattering attenuation effects of the pigment layer and scalp tissue, dynamically correct the color brightness and saturation of each unit, and generate a second color distribution that fits the actual visual presentation.
[0137] S64, based on the second coloring distribution, performs boundary optimization to obtain the coloring execution effect.
[0138] For example, the scheme generation terminal can perform boundary optimization processing on the second coloring distribution: such as eliminating color difference abruptness and harsh contour problems at the boundary of the coloring area through linear interpolation and edge smoothing, so that the coloring area blends naturally with the surrounding scalp, and obtains a visual coloring execution effect, providing an intuitive basis for the effect verification and execution adjustment of the scalp micro-coloring scheme.
[0139] The aforementioned image recognition-based method for generating scalp micro-coloring schemes acquires image data of the target scalp region and extracts scalp region features using a convolutional neural network, achieving automated recognition of scalp physiological characteristics and eliminating reliance on technician experience. Based on scalp region features, a three-dimensional digital model is constructed to fully restore the scalp's three-dimensional morphology, providing a model foundation for solving the color difference problem caused by traditional methods neglecting three-dimensional morphology. Based on the three-dimensional digital model, a set of coloring zones is divided (through composite feature tensor clustering, curvature feature analysis, and boundary smoothing), achieving differentiated division of the scalp region and solving the problem of uneven hair follicle distribution making fine analysis difficult. Technical bottlenecks: Based on the coloring partition set combined with preset coloring rules, coloring parameters are generated, which can standardize the output of pigment concentration and path density adapted to individual scalp characteristics, improving the personalization and consistency of the coloring scheme; Based on the coloring parameters combined with the 3D digital model, a scalp coloring scheme is generated (using graph search algorithm to plan the path and optimize turning points), scientifically planning the coloring trajectory and avoiding the problem of uneven coloring caused by manual planning; Based on the scalp coloring scheme combined with the 3D digital model, the coloring execution effect is generated (using finite element algorithm and ray tracing to simulate light attenuation), realizing color transmission simulation under natural light and shadow, improving the accuracy and naturalness of the coloring visual effect.
[0140] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0141] Based on the same inventive concept, this application also provides an image recognition-based scalp micro-shading scheme generation system for implementing the above-mentioned image recognition-based scalp micro-shading scheme generation method. The solution provided by this system is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of an image recognition-based scalp micro-shading scheme generation system provided below can be found in the limitations of the image recognition-based scalp micro-shading scheme generation method described above, and will not be repeated here.
[0142] In one exemplary embodiment, such as Figure 2 As shown, a scalp micro-coloring scheme generation system based on image recognition is provided, including:
[0143] The image feature extraction module 101 is used to acquire image data of the target scalp region and extract scalp region features based on the image data using a convolutional neural network.
[0144] The 3D model building module 102 is used to build a 3D digital model based on the features of the scalp region;
[0145] The coloring partitioning module 103 is used to divide the set of coloring partitions based on the three-dimensional digital model;
[0146] The coloring parameter generation module 104 is used to generate coloring parameters based on the coloring partition set and in combination with preset coloring rules;
[0147] The color scheme generation module 105 is used to generate a scalp color scheme based on color parameters and a three-dimensional digital model.
[0148] The execution effect generation module 106 is used to generate coloring execution effects based on the scalp coloring scheme and combined with a three-dimensional digital model.
[0149] In one embodiment, the convolutional neural network includes a first parallel branch, a second parallel branch, and a third parallel branch;
[0150] Image feature extraction module 101 can also be used for:
[0151] Based on image data, spatial geometric features are extracted using the first parallel branch;
[0152] Based on image data, a second parallel branch is used to extract skin color distribution features through color histogram analysis;
[0153] Based on image data, the third parallel branch is used to extract hair follicle distribution features through wavelet transform;
[0154] By integrating skin color distribution features, hair follicle distribution features, and spatial geometric features, scalp region features are obtained.
[0155] In one embodiment, the 3D model building module 102 can also be used for:
[0156] Based on the geometric features of the scalp region, the Delaunay triangulation algorithm is used to construct the first three-dimensional mesh framework;
[0157] The mesh topology of the first three-dimensional mesh frame is optimized using the Poisson surface reconstruction algorithm to obtain the second three-dimensional mesh frame;
[0158] The skin color distribution features and hair follicle distribution features are concatenated to generate a composite feature tensor.
[0159] The composite feature tensor is mapped to the mesh nodes of the second three-dimensional mesh framework to generate a three-dimensional digital model.
[0160] In one embodiment, the color partitioning module 103 can also be used for:
[0161] Clustering of composite feature tensors yields tensor clustering results;
[0162] Based on the grid nodes corresponding to the composite feature tensors in the tensor clustering results, the first set of colored partitions is divided from the three-dimensional digital model;
[0163] Based on the mesh topology of the 3D digital model, scalp curvature features are extracted.
[0164] Based on the scalp curvature characteristics, the first set of colored partitions is divided to obtain the second set of colored partitions;
[0165] Smooth the boundaries of the second colored partition set to obtain the third colored partition set;
[0166] Based on a preset area threshold, morphological closing operations are used to eliminate isolated partitions smaller than the preset area threshold in the third coloring partition set, resulting in the fourth coloring partition set.
[0167] Based on the fourth set of colored partitions, the topological connection relationship between each partition is established to obtain the set of colored partitions.
[0168] In one embodiment, the color scheme generation module 105 can also be used for:
[0169] Based on the topological connectivity of the set of shading partitions, and combined with the grid nodes of the 3D digital model, a graph search algorithm is used to generate the first shading path covering each shading partition.
[0170] Based on the shading parameters, the path density of the first shading path is adjusted to obtain the second shading path;
[0171] The Bézier curve fitting algorithm is used to optimize the path inflection points of the second coloring path to obtain the third coloring path;
[0172] Based on the third coloring path, identify cross-partition path segments;
[0173] Calculate the path density difference and path inflection point curvature difference of cross-partition path segments;
[0174] Transition paths are generated by interpolation based on path density differences and path inflection point curvature differences.
[0175] Based on the transition path and the third coloring path, a fourth coloring path is obtained by connecting and integrating them.
[0176] The coloring parameters are mapped to the fourth coloring path to generate a scalp coloring scheme.
[0177] In one embodiment, the effect generation module 106 can also be used to:
[0178] A physical model of the scalp is constructed based on a three-dimensional digital model using the finite element method.
[0179] The scalp coloring scheme is mapped to the scalp physical model to generate the first coloring distribution;
[0180] A second shading distribution is generated by simulating the shading transmission attenuation effect under illumination conditions using a ray tracing algorithm.
[0181] Based on the second coloring distribution, boundary optimization is performed to obtain the coloring performance.
[0182] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the image recognition-based scalp micro-coloring scheme generation method as described above.
[0183] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0184] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0185] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. An image recognition based scalp micro-pigmentation scheme generation method, characterized by, The method includes: Image data of the target scalp region is acquired, and based on the image data, features of the scalp region are extracted using a convolutional neural network; Based on the features of the scalp region, a three-dimensional digital model is constructed; Based on the aforementioned three-dimensional digital model, a set of colored partitions is defined; Based on the set of coloring partitions and combined with preset coloring rules, coloring parameters are generated; Based on the coloring parameters and the three-dimensional digital model, a scalp coloring scheme is generated; Based on the scalp coloring scheme and the three-dimensional digital model, the coloring effect is generated.
2. The method of claim 1, wherein, The convolutional neural network includes a first parallel branch, a second parallel branch, and a third parallel branch; The step of extracting scalp region features using a convolutional neural network based on the image data includes: Based on the image data, spatial geometric features are extracted using the first parallel branch; Based on the image data, the second parallel branch is used to extract skin color distribution features through color histogram analysis; Based on the image data, the third parallel branch is used to extract the hair follicle distribution features through wavelet transform; By integrating the skin color distribution features, the hair follicle distribution features, and the spatial geometric features, the scalp region features are obtained.
3. The method of claim 2, wherein, The construction of a three-dimensional digital model based on the scalp region features includes: Based on the geometric features of the scalp region, the Delaunay triangulation algorithm is used to construct a first three-dimensional mesh framework; The mesh topology of the first three-dimensional mesh frame is optimized using the Poisson surface reconstruction algorithm to obtain the second three-dimensional mesh frame; The skin color distribution features and hair follicle distribution features are concatenated to generate a composite feature tensor. The composite feature tensor is mapped to the mesh nodes of the second three-dimensional mesh framework to generate the three-dimensional digital model.
4. The method of claim 3, wherein, The process of dividing the set of shading partitions based on the three-dimensional digital model includes: Clustering is performed on the composite feature tensors to obtain tensor clustering results; Based on the grid nodes corresponding to the composite feature tensors in the tensor clustering results, the first set of colored partitions is divided from the three-dimensional digital model; Based on the mesh topology of the three-dimensional digital model, scalp curvature features are extracted; Based on the scalp curvature characteristics, the first set of colored partitions is divided to obtain a second set of colored partitions; The second set of colored partitions is smoothed to obtain the third set of colored partitions; Based on a preset area threshold, morphological closing operations are used to eliminate isolated partitions smaller than the preset area threshold in the third coloring partition set, resulting in a fourth coloring partition set. Based on the fourth set of colored partitions, the topological connection relationship between each partition is established to obtain the set of colored partitions.
5. The method according to claim 4, characterized in that, The step of generating a scalp coloring scheme based on the coloring parameters and the three-dimensional digital model includes: Based on the topological connection relationship of the set of shading partitions, and combined with the grid nodes of the three-dimensional digital model, a graph search algorithm is used to generate a first shading path covering each of the shading partitions; Based on the shading parameters, the path density of the first shading path is adjusted to obtain the second shading path; The Bézier curve fitting algorithm is used to optimize the path inflection points of the second coloring path to obtain the third coloring path; Based on the third coloring path, identify cross-partition path segments; Calculate the path density difference and path inflection point curvature difference of the cross-partition path segments; Based on the path density difference and the path inflection point curvature difference, a transition path is generated by interpolation. Based on the transition path and the third coloring path, a fourth coloring path is obtained by connecting and integrating them. The coloring parameters are mapped to the fourth coloring path to generate the scalp coloring scheme.
6. The method according to claim 4, characterized in that, The formula for dividing the first set of colored partitions based on the scalp curvature features is as follows: in, The weighted similarity function between nodes i and j is used to divide the first colored partition based on a similarity threshold; This is the spatial distance attenuation coefficient; It is a curvature inhibition factor; Let i be the Gaussian curvature value of node i. Let be the Gaussian curvature value of node j; The adjacent area weighting coefficient; This is a parameter for adjusting area similarity; Let be the average area of the adjacent triangles of node i. Let be the average area of the adjacent triangles of node j; Let be the Euclidean distance between nodes i and j. This is the distance decay exponent.
7. The method according to claim 1, characterized in that, The process of generating the coloring effect based on the scalp coloring scheme and the three-dimensional digital model includes: Based on the aforementioned three-dimensional digital model, a physical model of the scalp is constructed using the finite element method. The scalp coloring scheme is mapped to the scalp physical model to generate a first coloring distribution; A second shading distribution is generated by simulating the shading transmission attenuation effect under illumination conditions using a ray tracing algorithm. Based on the second coloring distribution, boundary optimization is performed to obtain the coloring performance effect.
8. A scalp micro-coloring scheme generation system based on image recognition, characterized in that, The system includes: The image feature extraction module is used to acquire image data of the target scalp region and extract scalp region features based on the image data using a convolutional neural network. A 3D model building module is used to build a 3D digital model based on the features of the scalp region; The coloring partitioning module is used to divide the set of coloring partitions based on the three-dimensional digital model; The coloring parameter generation module is used to generate coloring parameters based on the coloring partition set and in combination with preset coloring rules; A coloring scheme generation module is used to generate a scalp coloring scheme based on the coloring parameters and the three-dimensional digital model. The effect generation module is used to generate the coloring effect based on the scalp coloring scheme and the three-dimensional digital model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.