A scalp skin recognition method and system based on image classification
By employing an image classification-based approach, high-magnification bright light imaging, and image segmentation algorithms, hair areas are removed, and reflective pixels are identified and labeled. This solves the problems of inaccurate diagnosis and lack of visualization in existing scalp detection technologies, and achieves accurate quantification and visualization of scalp moisture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU MEILAIBAO BEAUTY EQUIP CO LTD
- Filing Date
- 2025-07-21
- Publication Date
- 2026-05-12
AI Technical Summary
Existing scalp detection technologies rely on manual observation and experience-based judgment, which can lead to inaccurate diagnosis and low efficiency. Furthermore, contact-based non-invasive skin measurement instruments cannot accurately measure overall scalp moisture or visualize the distribution of skin moisture.
Using an image classification-based method, scalp images are acquired through high-magnification bright light photography. The hair area is removed using an image segmentation algorithm, and reflective pixels are identified and matched. By combining pixel parameters with a preset database, scalp moisture results are calculated, and reflective areas are marked with specific colors to achieve quantitative assessment and visualization of scalp moisture.
It enables precise quantitative assessment and visualization of scalp moisture, providing objective and intuitive data to help users and professionals understand scalp moisture status and improve the accuracy and efficiency of detection.
Smart Images

Figure CN120912531B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and specifically to a scalp skin recognition method and system based on image classification. Background Technology
[0002] Currently, scalp testing and assessment mainly rely on manual observation and experience, which suffers from inaccurate diagnosis, low efficiency, and cumbersome operation, failing to meet the public's demand for fast and safe scalp health management. Traditional visual diagnosis has low reliability, and most customers trust the objective data from instrument testing. Existing scalp testing technologies have limitations in several aspects. For example, while contact-type non-invasive skin measurement instruments can quantitatively measure skin moisture content, they are limited by the probe's contact area, testing only a very small area of skin moisture content, and the results cannot represent the overall skin moisture status. For the scalp, due to its dense hair cover, most contact probes cannot directly measure it. Removing hair from the area for measurement is not only cumbersome, but the shaving process may also cause pressure or damage to the test area, affecting the test results. Furthermore, the test results of such instruments are presented numerically, without visualizing the distribution of skin moisture. Although some contact-type non-invasive measurement instruments use needle-shaped probes to eliminate the influence of hair for scalp moisture content testing, the results only represent the moisture content at the probe contact point and cannot represent the overall scalp moisture status, nor can they achieve a visual representation of scalp moisture. Therefore, designing a convenient method for detecting scalp skin condition has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0003] To address the aforementioned shortcomings, this invention discloses an image classification-based scalp skin recognition method, which can achieve accurate quantitative assessment of scalp skin, allowing users to intuitively understand the scalp's moisture status.
[0004] The first aspect of this invention discloses a scalp skin recognition method based on image classification, comprising:
[0005] First image information is acquired by a detector under first set conditions, wherein the first image information includes a scalp image;
[0006] An image segmentation algorithm is used to identify the first image information to determine the location of the hair region in the first image information, and the corresponding hair image in the first image information is removed according to the location of the hair region.
[0007] Determine the pixel parameters of each pixel in the first image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set reflective pixel database. If the pixel parameters of the corresponding pixel match the reflective pixel database, update the number of reflective pixels until all pixels are matched.
[0008] The corresponding scalp moisture result is determined based on the number of reflective pixels and the first image information of the hair-removed image.
[0009] As an optional implementation, in the first aspect of the present invention, after the step of matching all pixels is completed, the method further includes:
[0010] The pixel parameters of the pixels that match the reflective pixel database are converted into set pixel parameters, and the corresponding pixels in the first image information are updated according to the set pixel parameters and the position of the pixels that match the reflective pixel database to obtain the updated display effect image.
[0011] The display effect diagram is shown below.
[0012] As an optional implementation, in a first aspect of the present invention, determining the corresponding scalp moisture result based on the number of reflective pixels and first image information of the hair-removed image includes:
[0013] The number of reflective pixels and the total number of pixels in the first image information after removing hair are input into the moisture calculation formula to obtain the corresponding moisture detection score. The moisture calculation formula is as follows:
[0014] ,
[0015] Where S is the number of reflective pixels, Z is the total number of pixels in the image after instance segmentation, Y is the normal ratio value configured in the background, and C is the moisture detection score for this instance.
[0016] The process of displaying the effect diagram includes:
[0017] The display effect diagram and the first image information are displayed together.
[0018] As an optional implementation, in the first aspect of the present invention, the step of if the pixel parameters of the corresponding pixel point match the reflective pixel database further includes:
[0019] If the values of all three color channels in the pixel parameters of the corresponding pixel are at the edge of the data range, then the pixel information within the set position range is obtained, and the pixel information within the set position range is analyzed to determine the corresponding gradient change information; if the gradient change information meets the set conditions, then it is determined that the pixel parameters of the corresponding pixel match the reflective pixel database.
[0020] As an optional implementation, in the first aspect of the present invention, the identification method further includes:
[0021] A second image information is acquired by a detector under a second set condition, wherein the second image information includes a scalp image;
[0022] An image segmentation algorithm is used to identify the second image information to determine the location of the hair region in the second image information, and the corresponding hair image in the second image information is removed according to the location of the hair region;
[0023] Determine the pixel parameters of each pixel in the second image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set sensitive pixel database. If the pixel parameters of the corresponding pixel match the sensitive pixel database, update the number of sensitive pixels until all pixels are matched.
[0024] The corresponding scalp detection result is determined based on the number of sensitive pixels and the second image information of the image after removing hair.
[0025] As an optional implementation, in the first aspect of the present invention, after the pixel parameters of the corresponding pixel point match the reflective pixel database, the method further includes:
[0026] If the values of the three color channels in the pixel parameters of the corresponding pixel are all at the edge of the data interval, then the corresponding pixel comparison interval in the sensitive pixel database is determined according to the scalp condition. The pixel comparison interval includes the first color interval, the second color interval, and the third color interval.
[0027] Determine the weight parameters corresponding to the first color interval, the second color interval, and the third color interval;
[0028] The pixel parameters of each pixel are matched with the corresponding pixel comparison interval to determine the corresponding matching score. When the matching score exceeds the set value, the number of sensitive pixels is updated.
[0029] As an optional implementation, in a first aspect of the present invention, after acquiring the first image information by a detector under first set conditions, the method further includes:
[0030] The hair recognition model is used to traverse all image pixels in the first image information, identify all hair strand regions of a set length, and generate a rotating rectangle for each hair strand region.
[0031] Extract the width parameter from the rotating rectangle, where the width parameter is the number of pixels, and determine the actual physical diameter of the corresponding hair strand based on the optical magnification of the detector and the width parameter.
[0032] If the actual physical diameter of the corresponding hair strand is within the first width range, then the corresponding hair strand is determined to be a fine hair, and the number of the corresponding fine hair strands is updated.
[0033] If the actual physical diameter of the corresponding hair strand is within the second width range, then the corresponding hair strand is determined to be a normal hair strand, and the quantity of the corresponding normal hair strand is updated.
[0034] If the actual physical diameter of the corresponding hair is within the third width range, then the corresponding hair is determined to be coarse hair, and the number of coarse hairs is updated.
[0035] The hair condition score is determined based on the number of fine hairs, normal hairs, and coarse hairs.
[0036] A second aspect of this invention discloses a scalp skin recognition system based on image classification, comprising:
[0037] Acquisition module: used to acquire first image information through a detector under first set conditions, wherein the first image information includes a scalp image;
[0038] Segmentation module: used to identify the first image information using an image segmentation algorithm to determine the location of the hair region in the first image information, and to remove the corresponding hair image in the first image information according to the location of the hair region;
[0039] Matching module: used to determine the pixel parameters of each pixel in the first image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set reflective pixel database. If the pixel parameters of the corresponding pixel match the reflective pixel database, the number of reflective pixels is updated until all pixels are matched.
[0040] Calculation module: used to determine the corresponding scalp moisture result based on the number of reflective pixels and the first image information of the hair-removed image.
[0041] A third aspect of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calling the executable program code stored in the memory to execute the scalp skin recognition method based on image classification disclosed in the first aspect of the present invention.
[0042] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the scalp skin recognition method based on image classification disclosed in the first aspect of the present invention.
[0043] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0044] The identification method in this embodiment of the invention determines the scalp moisture result based on the number of reflective pixels and image information after hair removal, thus achieving a quantitative assessment of scalp moisture. This quantitative method provides objective and referable data for scalp moisture detection, helping professionals or users to more intuitively understand the scalp's moisture status and take corresponding scalp care measures based on the results. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments 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.
[0046] Figure 1 This is a schematic flowchart of the scalp skin recognition method based on image classification disclosed in an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the scalp inflammation detection process disclosed in an embodiment of the present invention;
[0048] Figure 3 This is a schematic diagram of the hair state detection process disclosed in an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram showing the first image information obtained according to an embodiment of the present invention;
[0050] Figure 5 This is a schematic diagram showing the scalp after hair removal, as disclosed in an embodiment of the present invention;
[0051] Figure 6 This is a display effect diagram after color conversion disclosed in an embodiment of the present invention;
[0052] Figure 7This is a schematic diagram showing the obtained second image information disclosed in an embodiment of the present invention;
[0053] Figure 8 This is another schematic diagram showing the scalp after hair removal, as disclosed in an embodiment of the present invention;
[0054] Figure 9 This is another display diagram after color conversion disclosed in an embodiment of the present invention;
[0055] Figure 10 This is a schematic diagram illustrating the prediction using a target detection rotation algorithm disclosed in an embodiment of the present invention;
[0056] Figure 11 This is a schematic diagram of the structure of a scalp skin recognition system based on image classification provided in an embodiment of the present invention;
[0057] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] It should be noted that the terms "first," "second," "third," "fourth," etc., in the specification and claims of this invention are used to distinguish different objects, not to describe a specific order. The terms "comprising" and "having," and any variations thereof, in the embodiments of this invention are intended to cover non-exclusive inclusion. Exemplarily, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0060] Example 1:
[0061] Please see Figure 1 , Figure 1This is a flowchart illustrating the scalp skin recognition method based on image classification disclosed in an embodiment of the present invention. The execution entity of the method described in this embodiment is an execution entity composed of software and / or hardware. This execution entity can receive relevant information via wired or / or wireless means and can send certain instructions. It may also have certain processing and storage functions. This execution entity can control multiple devices, such as remote physical servers or cloud servers and related software, or local hosts or servers and related software that perform related operations on devices located in a certain location. In some scenarios, it can also control multiple storage devices, which may be placed in the same location as the device or in different locations. Figures 1 to 10 As shown, this image classification-based scalp skin recognition method includes the following steps:
[0062] S101: First image information is acquired by a detector under first set conditions, wherein the first image information includes a scalp image;
[0063] S102: An image segmentation algorithm is used to identify the first image information to determine the location of the hair region in the first image information, and the corresponding hair image in the first image information is removed according to the location of the hair region.
[0064] S103: Determine the pixel parameters of each pixel in the first image information after removing the hair image, and match the pixel parameters of each pixel with the pre-set reflective pixel database. If the pixel parameters of the corresponding pixel match the reflective pixel database, update the number of reflective pixels until all pixel matching is completed.
[0065] S104: Determine the corresponding scalp moisture result based on the number of reflective pixels and the first image information of the hair-removed image.
[0066] Specifically, the first setting is to use a 100x professional grip for bright light shooting; the 100x high magnification allows for macro photography of the scalp, clearly revealing the subtle features of the scalp surface. This provides richer raw data for subsequent steps such as image segmentation and reflective pixel recognition, making the boundary between the hair area and the scalp area clearer. This facilitates the image segmentation algorithm to accurately locate and remove hair images, reduces misjudgments of areas caused by blurred details, and further improves the accuracy of scalp area localization.
[0067] The professional handle design of this invention provides a stable and sufficient light source, avoiding insufficient or uneven lighting problems that may occur during ordinary shooting. In bright light environments, the 100x high-magnification camera ensures image brightness and clarity while maintaining high magnification, making it easier to identify and extract parameters of each pixel on the scalp (such as color, brightness, saturation, etc.). This provides a more reliable pixel parameter basis for matching reflective pixels and reduces parameter misjudgment caused by lighting issues. The 100x high magnification can magnify the tiny reflective areas on the scalp surface, and bright light environments make the characteristics of reflective pixels more obvious, making the matching of pixel parameters of reflective pixels with the pre-set reflective pixel database more accurate. Even small reflective points can be accurately identified and counted, thereby improving the accuracy of reflective pixel count statistics. This lays a more solid foundation for determining scalp moisture results based on their quantity, making the final scalp moisture result closer to the actual situation.
[0068] Moisture will show obvious reflective spots under white light. A pixel database of moisture reflection was initially collected. This database was then compared to the scalp to determine if corresponding pixel ranges existed. The core objective of constructing this moisture reflection pixel database is to establish a mapping relationship between moisture reflection features and RGB value ranges through standardized collection and feature extraction, providing a reliable benchmark for subsequent pixel matching.
[0069] Specifically, use equipment consistent with the actual testing to ensure that lighting conditions, magnification, and polarization mode parameters are fixed, and avoid fluctuations in reflective characteristics due to equipment differences.
[0070] In the specific implementation, a more diverse sample is used: samples of different skin tones (light, medium, dark), hair types (oily, dry, normal), and scalp conditions (healthy, inflamed, sensitive) are collected to avoid the database being biased towards a specific population; samples are collected from different scalp areas such as the top of the head, forehead, temples, and occipital region to consider the impact of differences in sebum secretion and hair density in different areas on reflectivity.
[0071] Manual labeling: Professionals select areas in the image that are clearly "moisture reflections" (such as bright white, regular circular / elliptical spots) to ensure the accuracy of the labels on the training data;
[0072] Dynamic acquisition: Take multiple frames of images of the same area (e.g., take 5 frames at 0.5-second intervals) to verify whether the reflective points are moisture through time continuity (the position of moisture reflective points is relatively fixed in a short period of time, while oil reflective points may change with scalp secretion).
[0073] Feature extraction stage: From image to RGB feature library, RGB values are directly extracted: For manually labeled reflective areas, the R, G, and B values of each pixel are extracted to form an initial dataset (e.g., 1000 reflective points correspond to 1000 sets of RGB triples); the mean and standard deviation of R, G, and B are calculated (e.g., mean R of moisture reflective points = 240±5, mean G = 230±8, mean B = 210±10); the distribution pattern of RGB is analyzed (e.g., whether it conforms to a normal distribution), and the reasonable boundaries of the feature interval are determined (e.g., taking the 95% confidence interval as the range).
[0074] Light intensity verification: The same water sample was photographed under different white light intensities (e.g., 500 lumens, 1000 lumens) to verify the fluctuation range of RGB characteristics. Finally, the database retains the "robust range" (e.g., regardless of the light intensity, the R value of water reflection is always between 230-255).
[0075] Database construction phase: From features to queryable range, RGB range is determined, interval shrinkage method: Based on statistical features, the full range of the initial RGB dataset (e.g., R=220-255, G=210-245, B=190-235) is shrunk to a 95% confidence interval (e.g., R=230-250, G=220-240, B=200-230), and extreme values are removed to reduce false positives; through test set validation, the interval boundaries are gradually adjusted until the best detection accuracy is achieved.
[0076] Build efficient query indexes (such as KD trees and R trees) to support quick determination of whether the RGB value of a pixel is within the range of the database, store data according to different scenarios (such as skin color and hair type), and call the corresponding sub-database based on the user's prior information (such as selecting "dry hair") during detection to improve matching accuracy.
[0077] The dynamic update mechanism regularly collects new samples (such as misjudgment cases reported by users), retrains the database, and gradually expands the coverage. An incremental learning strategy is adopted to update only the feature intervals that have changed significantly (such as discovering new water reflection patterns) to avoid rebuilding the entire database.
[0078] More preferably, after the step of matching all pixels is completed, the method further includes:
[0079] The pixel parameters of the pixels that match the reflective pixel database are converted into set pixel parameters, and the corresponding pixels in the first image information are updated according to the set pixel parameters and the position of the pixels that match the reflective pixel database to obtain the updated display effect image.
[0080] The display effect diagram is shown below.
[0081] Specifically, if a match is found, the RGB value of the pixel is modified to (255, 200, 0), and the RGB value of the moisture reflection point in the scalp image is modified to a fixed (255, 200, 0) (usually a bright orange-yellow). The above is essentially a visual labeling and data extraction technique, the core purpose of which is to enable the moisture reflection feature to be clearly identified, quantified and analyzed from complex scalp images.
[0082] The above method can highlight the target features and simplify subsequent analysis. In the original scalp image, the RGB values of the water reflection points may be very close to the color of the surrounding scalp and hair (for example, the reflection points may be light gray or light pink, with a slight difference from the natural skin color of the scalp), making it difficult to quickly distinguish them directly through the original pixel values.
[0083] By setting (255, 200, 0) as the exclusive marker color for moisture reflection points, these pixels will appear as a high-contrast orange-yellow in the image, creating a striking contrast with the surrounding dark hair and light scalp. Subsequent algorithms (such as calculating the number of reflection points S, area ratio, etc.) can quickly locate the target by "identifying orange-yellow pixels," avoiding interference from other colors.
[0084] By making these features explicit, manual verification and visual display are facilitated. In practical applications, the detection results need to be understood by users or operators.
[0085] Orange-yellow is a highly visually distinctive color. After modification, users can intuitively see which areas show moisture reflection, enhancing the credibility of the results. For technicians, the labeled images also facilitate manual verification of the algorithm's accuracy (e.g., checking for missed or incorrectly labeled reflective points), thereby optimizing model parameters.
[0086] In scalp analysis, in addition to moisture, other features (such as oil, dandruff, inflammation, etc.) may need to be marked. Each feature is usually assigned a unique color to facilitate overall observation.
[0087] For example, oil might be marked in red, dandruff in white, and moisture in orange-yellow. Fixing (255, 200, 0) as the exclusive color for moisture can avoid confusion with the colors of other features and ensure that data does not conflict when performing "simultaneous analysis of multiple features" (e.g., when counting moisture points, the red pixels of oil will not be included).
[0088] The core logic behind modifying RGB values is to manually assign a standardized, high-contrast, and personalized color label to the target feature, thereby solving the problems of unclear features, significant environmental interference, and low analysis efficiency in the original image. This ultimately achieves rapid identification, accurate quantification, and intuitive display of the target. This operation does not change the essential characteristics of the reflective point; it simply makes it easier for the algorithm and the human eye to see.
[0089] This invention converts matched reflective pixels into set pixel parameters (such as specific color and brightness), clearly marking reflective areas in the display image. This allows reflective features, which previously required professional analysis to identify, to be presented directly in a visual manner. Both professionals and ordinary users can quickly and intuitively understand the reflective distribution on the scalp surface, lowering the barrier to understanding scalp reflective features. The prominent reflective area markings in the display image correspond to scalp moisture results. Professionals can combine the location and extent of reflective areas with quantified moisture data to more comprehensively analyze scalp condition—for example, whether concentrated reflective areas overlap with areas of abnormal moisture—and thus more accurately determine moisture-related characteristics such as scalp sebum secretion and stratum corneum condition, providing a more intuitive reference for developing scalp care plans or diagnosing scalp problems.
[0090] The updated display images allow users to directly observe the scalp image processing and key features, enhancing the transparency and reliability of the detection process. Users can visually compare changes in reflective areas at different detection time points using the images, and combined with moisture results, more clearly perceive improvements or changes in scalp condition, thereby increasing acceptance and user engagement with the detection method. This is particularly suitable for user interaction scenarios in home scalp detection devices or the beauty and skincare industry. The marked display images can be saved as part of the detection data, facilitating subsequent comparative analysis of multiple tests for the same user. By observing changes in reflective areas in the images at different time points, combined with moisture quantification data, the dynamic trends of scalp condition can be tracked more intuitively, providing a visualized historical basis for long-term scalp care effect evaluation and improving the method's practicality in long-term tracking scenarios. Pixel enhancement of the above images further improves the final display effect.
[0091] More preferably, determining the corresponding scalp moisture result based on the number of reflective pixels and the first image information of the hair-removed image includes:
[0092] The number of reflective pixels and the total number of pixels in the first image information after removing hair are input into the moisture calculation formula to obtain the corresponding moisture detection score. The moisture calculation formula is as follows:
[0093] ,
[0094] Where S is the number of reflective pixels, Z is the total number of pixels in the image after instance segmentation, Y is the normal ratio value configured in the background, and C is the moisture detection score for this instance.
[0095] The process of displaying the effect diagram includes:
[0096] The display effect diagram and the first image information are displayed together.
[0097] The solution in this invention calculates a moisture detection score (C) by combining the number of reflective pixels (S), the total number of pixels in the image after hair removal (Z), and a normal ratio value configured in the background (Y) using a formula. This upgrades the scalp moisture result from a qualitative description to a specific numerical value. This quantitative method is based on objective data of image pixels, avoiding the bias of subjective judgment, and providing a unified standard for measuring scalp moisture detection results at different times and in different areas. This facilitates accurate comparison and analysis, for example, clearly reflecting the change in moisture in a certain area of the scalp before and after treatment.
[0098] The integrated display of the preview image (including markers for reflective areas) and the original first image information allows users or professionals to intuitively connect the relationship between the original image, reflective areas, and moisture content. For example, a scalp area observed in the original image may be marked as a highly reflective area in the preview image, corresponding to a lower moisture content. This linked display makes the origin of the moisture content easier to understand, enhancing the persuasiveness and credibility of the test results.
[0099] The high-definition raw images captured by the 100x professional handle's bright camera complement the display images highlighting reflective areas. The raw images preserve the complete details of the scalp, while the display images emphasize key reflective features. Combined with quantified moisture content, these three elements together create a multi-dimensional understanding of the scalp's condition. Professionals can observe the scalp's texture, color, and other basic characteristics through the raw images, analyze the correlation between reflective distribution and moisture through the display images, and grasp the quantitative results through the scores, thus making a more comprehensive assessment of scalp health. Based on accurate moisture content, clear reflective area distribution, and the details of the raw images, the care recommendations provided to users can be more targeted. For example, if a certain area in the display image has dense reflection and low moisture content, it may be recommended to strengthen moisturizing care in that area; if the overall score is normal but local reflection is abnormal, it may be suggested to pay attention to the regulation of local oil secretion and moisture balance, making the care measures more in line with the actual scalp condition.
[0100] In the specific implementation, it is also possible to assist in the statistical analysis of hair coverage and correction coefficient: through sample training, establish the mapping relationship between hair coverage (the proportion of hair pixels) and correction coefficient K (e.g., the denser the hair, the larger K is), and correct the final score to: C=(S / Z / Y×100)×K; the correction coefficient is used to make the final result more accurate.
[0101] More preferably, if the pixel parameters of the corresponding pixel point match the reflective pixel database, the method further includes:
[0102] If the values of all three color channels in the pixel parameters of the corresponding pixel are at the edge of the data range, then the pixel information within the set position range is obtained, and the pixel information within the set position range is analyzed to determine the corresponding gradient change information; if the gradient change information meets the set conditions, then it is determined that the pixel parameters of the corresponding pixel match the reflective pixel database.
[0103] In this embodiment of the invention, the classification of pixels whose three color channel values are at the edge of the data range as reflective pixels is ambiguous. By acquiring pixel information within a defined range and analyzing gradient changes, more evidence can be provided for identifying such pixels. If the gradient change meets the defined conditions (e.g., a gentle gradient change, consistent with the natural transition characteristics of pixels in reflective areas), it is identified as a reflective pixel. This avoids misjudgments or omissions that may occur due to matching only a single pixel parameter, making the identification of reflective pixels more accurate and providing a more reliable data foundation for subsequent calculations of scalp moisture results.
[0104] The scalp surface presents diverse conditions, including uneven lighting and varying stratum corneum thickness, causing the color channel parameters of some pixels to be at a critical state. By introducing gradient change analysis, the algorithm is no longer limited to the parameters of the pixel itself, but rather combines the distribution characteristics of surrounding pixels for a comprehensive judgment, enabling it to better handle these complex scenarios. Even when there are many critical pixels, it can accurately identify reflective areas by observing the patterns of surrounding gradient changes, improving the robustness of the method in practical applications.
[0105] If pixels located at the edge of the data range are misjudged, it may affect the accuracy of the statistical count of reflective pixels, leading to deviations in the scalp moisture results. By performing secondary verification on these pixels through gradient change analysis, true reflective edge pixels can be effectively filtered out, eliminating interference from non-reflective borderline pixels. This makes the statistical count of reflective pixels more accurate to reality, reduces errors caused by edge pixels, and makes the final scalp moisture quantification result closer to the true state.
[0106] In this scheme, the RGB feature value range is formed by defining the numerical ranges of the three channels R, G, and B respectively, which together constitute a three-dimensional feature range to match the pixel features of target indicators (such as inflammation, sensitivity, moisture reflection, etc.).
[0107] For example, assuming the characteristic RGB range of scalp inflammation is: R∈[200,255], G∈[50,100], B∈[30,80], then pixels satisfying R between 200-255, G between 50-100, and B between 30-80 will be identified as inflammation-related feature pixels. The characteristic range of moisture reflection might be: R∈[230,255], G∈[230,255], B∈[200,255], representing the bright white feature of highly reflective areas.
[0108] More preferably, such as Figure 2 As shown, the identification method further includes:
[0109] S105: Acquire second image information by a detector under second set conditions, wherein the second image information includes a scalp image;
[0110] S106: An image segmentation algorithm is used to identify the second image information to determine the location of the hair region in the second image information, and the corresponding hair image in the second image information is removed according to the location of the hair region;
[0111] S107: Determine the pixel parameters of each pixel in the second image information after removing the hair image, and match the pixel parameters of each pixel with the pre-set sensitive pixel database. If the pixel parameters of the corresponding pixel match the sensitive pixel database, update the number of sensitive pixels until all pixels are matched.
[0112] S108: Determine the corresponding scalp detection result based on the number of sensitive pixels and the second image information of the hair-removed image.
[0113] This invention acquires scalp images and analyzes sensitive pixels using a detector under second set conditions, adding a dimension for detecting scalp sensitivity to the existing scalp moisture detection. This allows the identification method to not only assess scalp moisture levels but also simultaneously or independently determine scalp sensitivity, achieving multi-faceted coverage of scalp health and providing richer information for a comprehensive understanding of scalp conditions.
[0114] A separate database of sensitive pixels was used for detection, and hair interference was removed through image segmentation algorithms to ensure accurate identification of sensitive areas. Different settings (first setting and second setting) can be adapted to the needs of moisture detection and sensitivity detection respectively. For example, the second setting may optimize the capture of sensitivity-related features (such as reddish areas), making the identification of sensitive pixels more targeted and the detection results more consistent with the actual state of scalp sensitivity. The second setting here was adjusted under 100x polarized light.
[0115] Scalp moisture levels and sensitivity are often correlated. Combining the detection results of both can reveal the root causes of scalp health problems more deeply. For example, if a certain area has a high number of sensitive pixels and abnormal moisture levels, it can help determine if there is a sensitivity and moisture imbalance in that area due to barrier damage. This provides a more comprehensive basis for developing a holistic scalp care plan, enhancing the practical value of the detection method. Adding a sensitive pixel detection process allows this identification method to adapt to more diverse scalp detection needs. Whether it's basic moisture detection that users care about or specific detection of sensitivity issues, this method can achieve both without developing an additional independent detection system, reducing the cost of technology application. It also provides a referable expansion model for adding more scalp detection dimensions (such as oil, keratin, etc.) in the future, improving the flexibility and scalability of the method.
[0116] More preferably, after the pixel parameters of the corresponding pixel point match the reflective pixel database, the method further includes:
[0117] If the values of the three color channels in the pixel parameters of the corresponding pixel are all at the edge of the data interval, then the corresponding pixel comparison interval in the sensitive pixel database is determined according to the scalp condition. The pixel comparison interval includes the first color interval, the second color interval, and the third color interval.
[0118] Determine the weight parameters corresponding to the first color interval, the second color interval, and the third color interval;
[0119] The pixel parameters of each pixel are matched with the corresponding pixel comparison interval to determine the corresponding matching score. When the matching score exceeds the set value, the number of sensitive pixels is updated.
[0120] This invention determines corresponding pixel comparison intervals (first, second, and third color intervals) based on scalp condition, ensuring that the judgment criteria for sensitive pixels match the actual scalp condition. Different scalp conditions (such as dryness, oiliness, and sensitive redness) result in different color characteristics in sensitive areas. Targeted interval settings allow for more accurate pixel parameter matching. For example, a sensitive, reddish scalp may correspond to a specific red channel interval, while a dry, sensitive scalp may correspond to different color parameter ranges. This avoids recognition bias caused by using a uniform interval and improves the adaptability of sensitive pixel recognition.
[0121] Setting weight parameters for different color ranges reflects the varying importance of each color channel in sensitive pixel identification. For example, when identifying sensitive pixels exhibiting allergic redness, the red channel might have a higher weight, while the blue or green channel might be more prominent when identifying sensitive pixels with dryness and flaking. This weighting system makes the matching score calculation more aligned with the characteristic patterns of sensitive pixels, avoiding the coarse judgment caused by equal weighting of all color channels. It upgrades sensitive pixel identification from simple range matching to multi-dimensional weighted evaluation, improving the scientific rigor and precision of the judgment.
[0122] The number of sensitive pixels is updated by comparing the matching score with a set value. This introduces a quantified judgment threshold, avoiding a binary judgment based solely on whether the parameter is within a certain range. For pixels with values in the three color channels that are on the edge, they may partially meet the sensitive characteristics but not all range requirements. The matching score can comprehensively reflect the degree of compliance. Only when the score exceeds the set value is it judged as a sensitive pixel, reducing false judgments of pixels in critical states. This makes the statistics of the number of sensitive pixels more accurate and provides reliable data for subsequent assessment of scalp sensitivity.
[0123] This step targets pixels whose three color channel values are at the edge. These pixels have already undergone gradient change analysis in reflective pixel recognition. Here, we further combine this with sensitive pixel recognition logic to form a multi-dimensional verification of critical pixels. By linking reflective and sensitive features, we can avoid confusion between the two types of pixel recognition and allow scalp condition assessment to simultaneously integrate information from reflective (related to moisture) and sensitive pixels (related to sensitivity), resulting in a more comprehensive scalp detection result and providing richer evidence for the development of scalp care plans.
[0124] In this embodiment of the invention, feature weights and multi-dimensional verification are introduced to assign different weights to the R, G, and B channels (e.g., the R channel has a higher weight in inflammation features because inflammation is often accompanied by redness). Even if a certain channel is at the edge, it will not be judged as a feature pixel if other high-weight channels do not meet the criteria. Combined with texture features (e.g., inflammation areas may be accompanied by rough textures), it avoids relying solely on RGB values for judgment.
[0125] A single edge pixel might be noise, but when multiple consecutive adjacent pixels are within the feature range, it's more likely to be a true feature. Isolated edge noise points can be filtered out by determining if there are enough feature pixels within an N×N range around the target pixel. Alternatively, a trained YOLOv8 model can be used to perform secondary verification on the initially identified feature regions: if the model determines that the region does not belong to the target indicator (such as inflammation), it will be discarded even if its RGB values are at the edge.
[0126] More preferably, such as Figure 3As shown, after acquiring the first image information through a detector under the first set conditions, the method further includes:
[0127] S1011: Use a hair recognition model to traverse all image pixels in the first image information, identify all hair strand regions of a set length, and generate a rotating rectangle for each hair strand region.
[0128] S1012: Extract the width parameter in the rotating rectangle, where the width parameter is the number of pixels, and determine the actual physical diameter of the corresponding hair strand based on the optical magnification of the detector and the width parameter;
[0129] S1013: If the actual physical diameter of the corresponding hair strand is within the first width range, then the corresponding hair strand is determined to be a fine hair, and the number of the corresponding fine hair strands is updated;
[0130] S1014: If the actual physical diameter of the corresponding hair strand is within the second width range, then the corresponding hair strand is determined to be a normal hair strand, and the quantity of the corresponding normal hair strand is updated.
[0131] S1015: If the actual physical diameter of the corresponding hair strand is within the third width range, then the corresponding hair strand is determined to be coarse hair, and the number of corresponding coarse hair strands is updated;
[0132] S1016: Determine the corresponding hair condition score based on the number of fine hairs, the number of normal hairs, and the number of coarse hairs.
[0133] Building upon existing scalp moisture and sensitivity testing, this study expands the dimensions of scalp assessment by adding hair thickness classification and quantity statistics. Hair thickness is a crucial indicator of hair health (for example, fine hair may be associated with fragile hair and insufficient nutrition, while coarse hair may be related to a robust hair shaft structure). By combining the quantity and condition scores of fine, normal, and coarse hair, a more comprehensive assessment of the overall hair condition can be achieved, overcoming the limitations of focusing solely on scalp and skin characteristics.
[0134] The hair condition score is calculated based on the number of hair strands of varying thicknesses, providing users and professionals with an intuitive quantitative indicator of hair condition. For example, if the proportion of fine hairs is too high and the score is low, it may indicate hair damage or nutritional deficiencies; conversely, if the proportion of coarse hairs is reasonable and the score is normal, it suggests a relatively healthy hair structure. This result, combined with data on scalp moisture and sensitivity, provides a more specific basis for developing personalized hair care solutions.
[0135] In hair thickness detection, an object detection rotation algorithm (OBB model) is used to solve the detection challenge caused by the non-fixed growth direction of hair. Its core is to accurately define hair strands at arbitrary angles by rotating the bounding box, replacing the traditional axis-aligned bounding box (AABB), thereby achieving accurate measurement of hair thickness (diameter). The following is a detailed description of the specific technical implementation:
[0136] The limitations of traditional axis-aligned bounding boxes (AABB) in hair detection stem from the randomness of hair growth direction (e.g., upright, tilted, curved), and the elongated shape of individual hair strands. Using traditional AABB detection results in several issues: the bounding box includes a large amount of non-hair area (e.g., surrounding scalp, other hair strands), making it impossible to accurately extract the pixel range of a single hair strand; the width and height of the bounding box do not correspond to the actual diameter of the hair strand (e.g., the AABB width of a tilted hair strand will be much larger than its actual diameter), directly affecting the accuracy of thickness measurement.
[0137] Therefore, in this embodiment of the invention, a rotating bounding box is used to adapt to any direction of the hair strands, so as to achieve precise framing that closely follows the edge of the hair strands.
[0138] Data preparation: Construct a hair dataset with rotation labels. Sample collection: Use a 100x brightness handheld device to capture scalp images, covering hair samples of different textures (coarse, medium, fine), different growth angles (0°-180°), and different densities (sparse, dense) to ensure data diversity.
[0139] Labeling: For each individual hair strand in each image, manually label it using a rotated rectangle. The label contains 5 parameters:
[0140] (x_center,y_center,width,height,angle)
[0141] x_center, y_center: Coordinates of the center of the rotating frame;
[0142] width: Length in the direction of hair diameter (corresponding to thickness, core measurement value);
[0143] height: Length of the hair strand in the direction of extension (a secondary parameter used to define the entire hair strand);
[0144] angle: The angle between the rotating frame and the horizontal axis (0°-180°, adapted to the direction of hair growth).
[0145] Data augmentation: Expanding the dataset through methods such as rotation, scaling, cropping, and adding noise enhances the model's adaptability to different angles and environments.
[0146] Model Selection and Training: Customized Training Based on YOLOv8-OBB
[0147] Basic model: Select the YOLOv8-OBB version that supports rotation detection (an extended model of YOLOv8 that natively supports rotated bounding box output). Its advantages are: strong real-time performance, suitable for quick calls from the business layer; and high accuracy.
[0148] Training objective: To enable the model to learn the feature differences between hair regions and non-hair regions (such as scalp and impurities), and to output the rotation box parameters (especially width and angle) for each hair.
[0149] Loss function optimization: Considering the characteristics of hair detection, the focus is on optimizing the angle loss and width loss of the rotating frame to ensure accurate angle prediction (avoiding frame distortion) and precise width measurement (directly affecting thickness judgment). Output the rotating frame and thickness parameters for a single hair strand.
[0150] After the business layer acquires the image, it calls the trained YOLOv8-OBB model for inference: Detection process: The model traverses the image pixels, identifies all hair strand regions, and generates a rotating bounding box for each hair strand (excluding interference areas such as scalp and impurities). Key output: For each rotating bounding box, the width parameter (in pixels) is extracted. Combined with the optical magnification of a 100x handle (it is known that 1 pixel corresponds to an actual number of micrometers, e.g., 1 pixel = 1 micrometer), the pixel width is converted into the actual physical diameter (e.g., width = 60 pixels corresponds to 60 micrometers).
[0151] Classification Rules: Hair types are categorized based on actual diameter: Fine hair: ≤60 micrometers (width≤60 pixels); Normal hair: 60-90 micrometers (60 pixels < width < 90 pixels); Coarse hair: ≥90 micrometers (width≥90 pixels). Score Calculation: Calculated using the formula (S+Y) / (S+Y+T / Z)*100=C, where: S: number of coarse hairs, Y: number of normal hairs, T: number of fine hairs; Z: customer-configured normal proportion (e.g., standard value for normal hair percentage); the final score C reflects the overall hair thickness (a higher value indicates a higher proportion of coarse and normal hair). The rotating frame can fit snugly against hair strands at any angle, avoiding redundant areas of traditional rectangular frames and ensuring the width parameter accurately reflects the hair diameter; YOLOv8-OBB has fast inference speed, suitable for high-frequency calls at the business layer, and can meet accuracy requirements through customized training.
[0152] Hair thickness detection based on the OBB model is fundamentally achieved by accurately defining hair strands in any direction using a rotating bounding box, combined with real-time output of diameter parameters from the YOLOv8-OBB model, thus solving the orientation adaptation problem of traditional rectangular bounding boxes. The technical process, from data annotation and model training to inference and classification, is designed around the two core objectives of hair direction and diameter measurement, ultimately achieving quantitative detection and score output of hair thickness, providing data support for subsequent business analysis (such as hair quality assessment and product recommendation).
[0153] Specifically, some code examples from this application are as follows:
[0154] if projectType == 2:
[0155] if type1 == 2: # Skin cell moisture
[0156] mask, number, percentage = shuifen_skin(imgs)
[0157] _, img_encoded = cv2.imencode('.png', mask)
[0158] local_file = img_encoded.tobytes()
[0159] img_name = str(uuid.uuid1()) + ".jpg"
[0160] img_url = put_img2oss("skin", "water", img_name, local_file)
[0161] type_data = {
[0162] "type": type1,
[0163] "percentage": percentage,
[0164] "resultImageUr": img_url,
[0165] "number": number
[0166] }
[0167] datalist.append(type_data)
[0168] elif type1 == 128:# Skin elasticity
[0169] c2, red_count, color_count = tanxingSkin(imgs)
[0170] _, img_encoded = cv2.imencode('.png', c2)
[0171] local_file = img_encoded.tobytes()
[0172] img_name = str(uuid.uuid1()) + ".jpg"
[0173] img_url = put_img2oss("skin", "Skintanxing", img_name, local_file)
[0174] type_data = {
[0175] "type": type1,
[0176] "percentage": color_count,
[0177] "resultImageUr": img_url,
[0178] "number": int(red_count)
[0179] }
[0180] datalist.append(type_data)
[0181] elif type1 == 16:# Skin oil
[0182] im0, det = yz_model.inference(imgs,all_cls=1)
[0183] _, img_encoded = cv2.imencode('.png', im0)
[0184] local_file = img_encoded.tobytes()
[0185] img_name = str(uuid.uuid1()) + ".jpg"
[0186] img_url = put_img2oss("skin", "crema", img_name, local_file)
[0187] type_data = {
[0188] "type": type1,
[0189] "percentage": 0.5,
[0190] "resultImageUr": img_url,
[0191] "number": det
[0192] }
[0193] datalist.append(type_data)
[0194] elif type1 == 1:# Skin blockage
[0195] im0, det = yz_model.inference(imgs,all_cls=0)
[0196] _, img_encoded = cv2.imencode('.png', im0)
[0197] local_file = img_encoded.tobytes()
[0198] img_name = str(uuid.uuid1()) + ".jpg"
[0199] img_url = put_img2oss("skin", "clogged", img_name, local_file)
[0200] type_data = {
[0201] "type": type1,
[0202] "percentage": 0.5,
[0203] "resultImageUr": img_url,
[0204] "number": det
[0205] }
[0206] datalist.append(type_data)
[0207] elif type1 == 123: # Skin and hair
[0208] c2, red_count, color_count = SkinMidu(imgs)
[0209] _, img_encoded = cv2.imencode('.png', c2)
[0210] local_file = img_encoded.tobytes()
[0211] img_name = str(uuid.uuid1()) + ".jpg"
[0212] img_url = put_img2oss("skin", "density", img_name, local_file)
[0213] type_data = {
[0214] "type": type1,
[0215] "percentage": color_count,
[0216] "resultImageUr": img_url,
[0217] "number": int(red_count)
[0218] }
[0219] datalist.append(type_data)
[0220] elif type1 == 32: # Skin sensitivity
[0221] im1, percentage, count = xhs_model.inference(imgs)
[0222] rgb_image = im1.convert('RGB')
[0223] c2 = cv2.cvtColor(np.asarray(rgb_image), cv2.COLOR_RGB2BGR)
[0224] _, img_encoded = cv2.imencode('.png', c2)
[0225] local_file = img_encoded.tobytes()
[0226] img_name = str(uuid.uuid1()) + ".jpg"
[0227] img_url = put_img2oss("skin", "BloodRedSilk", img_name, local_file)
[0228] type_data = {
[0229] "type": type1,
[0230] "percentage": percentage,
[0231] "resultImageUr": img_url,
[0232] "number": count
[0233] }
[0234] datalist.append(type_data)
[0235] elif type1 == 64:# Skin pigmentation
[0236] c2, red_count, color_count = skin_ban(imgs)
[0237] _, img_encoded = cv2.imencode('.png', c2)
[0238] local_file = img_encoded.tobytes()
[0239] img_name = str(uuid.uuid1()) + ".jpg"
[0240] img_url = put_img2oss("skin", "freckle", img_name, local_file)
[0241] type_data = {
[0242] "type": type1,
[0243] "percentage": color_count,
[0244] "resultImageUr": img_url,
[0245] "number": int(red_count)
[0246] }
[0247] datalist.append(type_data)elif type1 == 256:# Skin keratin
[0248] im1, percentage, count = jz_model.inference(imgs)
[0249] rgb_image = im1.convert('RGB')
[0250] c2=cv2.cvtColor(np.asarray(rgb_image),cv2.COLOR_RGB2BGR)
[0251] _, img_encoded = cv2.imencode('.png', c2)
[0252] local_file = img_encoded.tobytes()
[0253] img_name = str(uuid.uuid1()) + ".jpg"
[0254] img_url = put_img2oss("skin", "keratin", img_name, local_file)
[0255] type_data = {
[0256] "type": type1,
[0257] "percentage": percentage,
[0258] "resultImageUr": img_url,
[0259] "number": count
[0260] }
[0261] datalist.append(type_data)
[0262] def make_app():
[0263] return tornado.web.Application([
[0264] (r" / scalp / detect", testpost) ])
[0266] def run():
[0267] tornado.options.parse_command_line()
[0268] app = make_app()
[0269] http_server = tornado.httpserver.HTTPServer(app)
[0270] http_server.listen(options.port)
[0271] http_server.start(4)
[0272] tornado.ioloop.IOLoop.instance().start()
[0273] if __name__ == "__main__":
[0274] onnx_path = '. / weights / skin_youzhi.onnx'
[0275] yz_model = YOLOV5(onnx_path)
[0276] onnx_path = '. / weights / model_xhs.onnx'
[0277] xhs_model = XHS(onnx_path)
[0278] onnx_path = '. / weights / skin_jiaozhi.onnx'
[0279] jz_model = skin_jiaozhi(onnx_path)
[0280] log.info("start detect port: 7091")
[0281] run()
[0282] The identification method in this embodiment of the invention determines the scalp moisture result based on the number of reflective pixels and image information after hair removal, thus achieving a quantitative assessment of scalp moisture. This quantitative method provides objective and referable data for scalp moisture detection, helping professionals or users to more intuitively understand the scalp's moisture status and take corresponding scalp care measures based on the results.
[0283] Example 2:
[0284] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of the scalp skin recognition system based on image classification disclosed in an embodiment of the present invention. Figure 10 As shown, the image classification-based scalp skin recognition system may include:
[0285] Acquisition module 21: used to acquire first image information through a detector under first set conditions, wherein the first image information includes a scalp image;
[0286] Segmentation module 22: Used to identify the first image information using an image segmentation algorithm to determine the location of the hair region in the first image information, and to remove the corresponding hair image in the first image information according to the location of the hair region;
[0287] Matching module 23: is used to determine the pixel parameters of each pixel in the first image information after removing the hair image, and match the pixel parameters of each pixel with the pre-set reflective pixel database. If the pixel parameters of the corresponding pixel match the reflective pixel database, the number of reflective pixels is updated until all pixel matching is completed.
[0288] Calculation module 24: used to determine the corresponding scalp moisture result based on the number of reflective pixels and the first image information of the hair-removed image.
[0289] The identification method in this embodiment of the invention determines the scalp moisture result based on the number of reflective pixels and image information after hair removal, thus achieving a quantitative assessment of scalp moisture. This quantitative method provides objective and referable data for scalp moisture detection, helping professionals or users to more intuitively understand the scalp's moisture status and take corresponding scalp care measures based on the results.
[0290] Example 3:
[0291] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. The electronic device can be a computer, a server, etc. Of course, in certain cases, it can also be a mobile phone, tablet computer, monitoring terminal, or other smart device, as well as an image acquisition device with processing capabilities. Figure 11 As shown, the electronic device may include:
[0292] Memory 510 storing executable program code;
[0293] Processor 520 coupled to memory 510;
[0294] The processor 520 calls the executable program code stored in the memory 510 to execute some or all of the steps in the scalp skin recognition method based on image classification in Embodiment 1.
[0295] The foregoing has provided a detailed description of the scalp skin recognition method, system, electronic device, and storage medium based on image classification disclosed in the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A scalp skin recognition method based on image classification, characterized in that, include: First image information is acquired by a detector under first set conditions, wherein the first image information includes a scalp image; the first set conditions are to use a 100x handle for bright light shooting; An image segmentation algorithm is used to identify the first image information to determine the location of the hair region in the first image information, and the corresponding hair image in the first image information is removed according to the location of the hair region. Determine the pixel parameters of each pixel in the first image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set reflective pixel database. If the pixel parameters of the corresponding pixel match the reflective pixel database, update the number of reflective pixels until all pixels are matched. The corresponding scalp moisture result is determined based on the number of reflective pixels and the first image information of the image after removing hair. The identification method further includes: The second image information is acquired by a detector under the second set conditions, wherein the second image information includes a scalp image; the second set conditions are a polarized light state of 100 times. An image segmentation algorithm is used to identify the second image information to determine the location of the hair region in the second image information, and the corresponding hair image in the second image information is removed according to the location of the hair region; Determine the pixel parameters of each pixel in the second image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set sensitive pixel database. If the pixel parameters of the corresponding pixel match the sensitive pixel database, update the number of sensitive pixels until all pixels are matched. If the values of the three color channels in the pixel parameters of the corresponding pixel are all at the edge of the data interval, then the corresponding pixel comparison interval in the sensitive pixel database is determined according to the scalp condition. The pixel comparison interval includes the first color interval, the second color interval, and the third color interval. Determine the weight parameters corresponding to the first color interval, the second color interval, and the third color interval; The pixel parameters of each pixel are matched with the corresponding pixel comparison range to determine the corresponding matching score. When the matching score exceeds the set value, the number of sensitive pixels is updated. The corresponding scalp detection result is determined based on the number of sensitive pixels and the second image information of the image after removing hair.
2. The scalp skin recognition method based on image classification as described in claim 1, characterized in that, After all pixel matching is completed, the process also includes: The pixel parameters of the pixels that match the reflective pixel database are converted into set pixel parameters, and the corresponding pixels in the first image information are updated according to the set pixel parameters and the position of the pixels that match the reflective pixel database to obtain the updated display effect image. The display effect diagram is shown below.
3. The scalp skin recognition method based on image classification as described in claim 2, characterized in that, The step of determining the corresponding scalp moisture result based on the number of reflective pixels and the first image information of the hair-removed image includes: The number of reflective pixels and the total number of pixels in the first image information after removing hair are input into the moisture calculation formula to obtain the corresponding moisture detection score. The moisture calculation formula is as follows: Where S is the number of reflective pixels, Z is the total number of pixels in the image after instance segmentation, Y is the normal ratio value configured in the background, and C is the moisture detection score for this instance. The process of displaying the effect diagram includes: The display effect diagram and the first image information are displayed together.
4. The scalp skin recognition method based on image classification as described in claim 1, characterized in that, If the pixel parameters of the corresponding pixel point match the reflective pixel database, the method further includes: If the values of all three color channels in the pixel parameters of the corresponding pixel are at the edge of the data range, then the pixel information within the set position range is obtained, and the pixel information within the set position range is analyzed to determine the corresponding gradient change information; if the gradient change information meets the set conditions, then it is determined that the pixel parameters of the corresponding pixel match the reflective pixel database.
5. The scalp skin recognition method based on image classification as described in claim 1, characterized in that, After acquiring the first image information using a detector under the first set conditions, the method further includes: The hair recognition model is used to traverse all image pixels in the first image information, identify all hair strand regions of a set length, and generate a rotating rectangle for each hair strand region. Extract the width parameter from the rotating rectangle, where the width parameter is the number of pixels, and determine the actual physical diameter of the corresponding hair strand based on the optical magnification of the detector and the width parameter. If the actual physical diameter of the corresponding hair strand is within the first width range, then the corresponding hair strand is determined to be a fine hair, and the number of the corresponding fine hair strands is updated. If the actual physical diameter of the corresponding hair strand is within the second width range, then the corresponding hair strand is determined to be a normal hair strand, and the quantity of the corresponding normal hair strand is updated. If the actual physical diameter of the corresponding hair is within the third width range, then the corresponding hair is determined to be coarse hair, and the number of coarse hairs is updated. The hair condition score is determined based on the number of fine hairs, normal hairs, and coarse hairs.
6. A scalp skin recognition system based on image classification, characterized in that, include: Acquisition module: used to acquire first image information through a detector under first set conditions, wherein the first image information includes a scalp image; the first set conditions are to use a 100x handle for bright light shooting; Segmentation module: used to identify the first image information using an image segmentation algorithm to determine the location of the hair region in the first image information, and to remove the corresponding hair image in the first image information according to the location of the hair region; Matching module: used to determine the pixel parameters of each pixel in the first image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set reflective pixel database. If the pixel parameters of the corresponding pixel match the reflective pixel database, the number of reflective pixels is updated until all pixels are matched. Calculation module: used to determine the corresponding scalp moisture result based on the number of reflective pixels and the first image information of the image after removing hair; The identification system further includes: The second image information is acquired by a detector under the second set conditions, wherein the second image information includes a scalp image; the second set conditions are a polarized light state of 100 times. An image segmentation algorithm is used to identify the second image information to determine the location of the hair region in the second image information, and the corresponding hair image in the second image information is removed according to the location of the hair region; Determine the pixel parameters of each pixel in the second image information after removing the hair image, and match the pixel parameters of each pixel with a pre-set sensitive pixel database. If the pixel parameters of the corresponding pixel match the sensitive pixel database, update the number of sensitive pixels until all pixels are matched. If the values of the three color channels in the pixel parameters of the corresponding pixel are all at the edge of the data interval, then the corresponding pixel comparison interval in the sensitive pixel database is determined according to the scalp condition. The pixel comparison interval includes the first color interval, the second color interval, and the third color interval. Determine the weight parameters corresponding to the first color interval, the second color interval, and the third color interval; The pixel parameters of each pixel are matched with the corresponding pixel comparison range to determine the corresponding matching score. When the matching score exceeds the set value, the number of sensitive pixels is updated. The corresponding scalp detection result is determined based on the number of sensitive pixels and the second image information of the image after removing hair.
7. An electronic device, characterized in that, include: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the scalp skin recognition method based on image classification as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program causes a computer to perform the scalp skin recognition method based on image classification as described in any one of claims 1 to 5.