Scalp feature detection method and device and electronic equipment

By collecting and pre-processing scalp images using a high-power microscope and analyzing hair follicle information using a target detection model, the problems of low efficiency and poor accuracy of existing scalp detection technologies are solved, and efficient and accurate assessment of scalp health status is achieved.

CN120198720APending Publication Date: 2025-06-24BEIJING YONGHE MEDICAL INVESTMENT MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510256442.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The existing scalp testing technology is inefficient and has poor accuracy, and requires the professional knowledge of medical staff for evaluation.

Method used

Scalp images are collected by a scalp detector configured with a microscope of more than 50 times, and after pre-processing, the pre-trained target detection model is input, the hair follicle information is output, and the hair follicle information is segmented and characterized based on the hair follicle information is determined to determine the patient's scalp characteristics.

Benefits of technology

It improves the efficiency and accuracy of scalp detection and achieves accurate quantitative assessment of scalp health status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198720A_ABST
    Figure CN120198720A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a scalp feature detection method and device and electronic equipment. The method comprises the following steps: acquiring a scalp image of a patient; wherein the scalp image is an image acquired by a scalp detector provided with a microscope of more than 50 times; preprocessing the scalp image to obtain a preprocessed image; inputting the preprocessed image into a pre-trained target detection model, and outputting hair follicle information in the preprocessed image; the target detection model is obtained based on original scalp image training; the original scalp image carries hair follicle labeling information; segmenting the preprocessed image according to the hair follicle information to obtain a plurality of sub-images; according to the number of the hairlines corresponding to the hair follicle information in each sub-image, obtaining the total number of the hairlines of the preprocessed image; and determining a first scalp feature of the patient according to the total hair amount, the hair follicle information and a scalp area corresponding to the scalp image. According to the method, the scalp health condition is accurately and quantitatively evaluated, and the operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical devices, and in particular, to a scalp feature detection method, device and electronic device. Background Art

[0002] Currently, the detection technology for scalp problems is mainly completed through the following steps: First, medical staff use a scalp detection mirror to obtain image data of a patient's scalp. Then, through the professional skills of medical staff, the image data is professionally evaluated to obtain the scalp features of the patient.

[0003] Therefore, due to the cumbersome operation steps and the need to rely on the professional knowledge of medical staff, the above method has low efficiency and poor accuracy. Summary of the Invention

[0004] The purpose of the present invention is to provide a scalp feature detection method, device and electronic device, so as to alleviate the technical problems of low efficiency and poor accuracy in the prior art, and improve the detection efficiency and accuracy.

[0005] In a first aspect, an embodiment of the present invention provides a scalp feature detection method, including: obtaining a scalp image of a patient; wherein, the scalp image is an image collected by a scalp detector configured with a microscope with a magnification of more than 50 times; preprocessing the scalp image to obtain a preprocessed image; inputting the preprocessed image into a pre-trained target detection model, and outputting follicle information in the preprocessed image; the target detection model is trained based on an original scalp image; the original scalp image carries follicle annotation information; according to the follicle information, segmenting the preprocessed image to obtain a plurality of sub-images; obtaining the total amount of hair strands in the preprocessed image according to the number of hair strands corresponding to the follicle information in each sub-image; determining a first scalp feature of the patient according to the total amount of hair strands, the follicle information and the scalp area corresponding to the scalp image.

[0006] In a preferred embodiment of the present invention, after the step of preprocessing the scalp image to obtain a preprocessed image, the method includes: performing edge detection on the preprocessed image to extract the hair strand contour of the preprocessed image; performing binarization and opening and closing operation processing on the preprocessed image to obtain a smooth binary image; calculating the Euclidean distance from each foreground pixel to the background pixel in the binary image; determining a marked point of the hair strand contour based on the Euclidean distance; the Euclidean distance corresponding to the marked point is higher than the foreground pixels around the marked point; segmenting and brightening the hair strand contour in the preprocessed image based on the marked point to obtain a brightened image; determining a second scalp feature of the patient according to the brightened image.

[0007] In a preferred embodiment of the present invention, the step of determining the second scalp feature of the patient according to the above-mentioned brightened image includes: extracting the central axis of each hair strand in the brightened image based on the Zhang Suen thinning algorithm; calculating the normal direction distance between the central axis and the target hair strand contour corresponding to the central axis; determining the hair diameter of the patient according to the normal direction distance; and determining the hair diameter as the second scalp feature of the patient.

[0008] In a preferred embodiment of the present invention, after the step of calculating the Euclidean distance from each foreground pixel to the background pixel in the binary image, the method includes: eliminating the target Euclidean distances greater than a preset threshold to obtain updated Euclidean distances; and the step of determining the marker points of the hair strand contour based on the Euclidean distances includes: determining the marker points of the hair strand contour based on the updated Euclidean distances.

[0009] In a preferred embodiment of the present invention, the step of preprocessing the scalp image to obtain a preprocessed image includes: performing noise reduction processing on the scalp image to obtain a first image; enhancing the contrast of the first image based on the adaptive histogram equalization technique to obtain a second image; and performing morphological adjustment on the second image based on opening operation and / or closing operation to obtain the preprocessed image.

[0010] In a preferred embodiment of the present invention, before the step of inputting the preprocessed image into a pre-trained target detection model to output the hair follicle information in the preprocessed image, the method includes: obtaining the original scalp image; annotating the hair follicle positions and the number of hair strands corresponding to the hair follicle positions in the original scalp image to obtain an updated original scalp image carrying the hair follicle annotation information; and training an initial mask region convolutional neural network or an initial YOLO series model with the updated original scalp image until a preset training standard is reached to obtain the target detection model.

[0011] In a preferred embodiment of the present invention, after the step of segmenting the preprocessed image according to the above-mentioned hair follicle information to obtain a plurality of sub-images, the method includes: generating a hair follicle mask for each of the sub-images through a semantic segmentation network model; and determining the number of hair strands corresponding to the hair follicle information in each sub-image based on the attention mechanism according to the hair follicle mask.

[0012] In a preferred embodiment of the present invention, the above-mentioned hair follicle information includes: the number of hair follicles; the step of determining the first scalp feature of the patient according to the total amount of hair strands, the above-mentioned hair follicle information, and the scalp area corresponding to the above-mentioned scalp image includes: calculating the hair density of the scalp area according to the total amount of hair strands and the scalp area corresponding to the above-mentioned scalp image; and determining the hair follicle density of the patient according to the number of the above-mentioned hair follicles and the scalp area; determining the hair density and the hair follicle density as the first scalp feature of the patient.

[0013] In a second aspect, an embodiment of the present invention provides a scalp feature detection device, including: an acquisition module, configured to acquire a scalp image of a patient; wherein, the above-mentioned scalp image is an image acquired by a scalp detector configured with a microscope of 50 times or more; an image processing module, configured to preprocess the above-mentioned scalp image to obtain a preprocessed image; a feature determination module, configured to input the above-mentioned preprocessed image into a pre-trained target detection model, and output the hair follicle information in the above-mentioned preprocessed image; the above-mentioned target detection model is trained based on an original scalp image; the above-mentioned original scalp image carries hair follicle annotation information; segmenting the above-mentioned preprocessed image according to the above-mentioned hair follicle information to obtain a plurality of sub-images; obtaining the total amount of hair strands in the above-mentioned preprocessed image according to the number of hair strands corresponding to the above-mentioned hair follicle information in each sub-image; and determining the first scalp feature of the patient according to the total amount of hair strands, the above-mentioned hair follicle information, and the scalp area corresponding to the above-mentioned scalp image.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, the above-mentioned electronic device includes a processor and a memory, the above-mentioned memory stores computer-executable instructions that can be executed by the above-mentioned processor, and the above-mentioned processor executes the above-mentioned computer-executable instructions to implement the above-mentioned scalp feature detection method.

[0015] The embodiment of the present invention has the following beneficial technical effects:

[0016] An embodiment of the present invention provides a scalp feature detection method, device, and electronic device. The method includes: obtaining a scalp image of a patient; wherein, the scalp image is an image collected by a scalp detector configured with a microscope with a magnification of more than 50 times; preprocessing the scalp image to obtain a preprocessed image; inputting the preprocessed image into a pre-trained target detection model to output follicle information in the preprocessed image; the target detection model is trained based on an original scalp image; the original scalp image carries follicle annotation information; segmenting the preprocessed image according to the follicle information to obtain a plurality of sub-images; obtaining the total number of hair strands in the preprocessed image according to the number of hair strands corresponding to the follicle information in each sub-image; and determining a first scalp feature of the patient according to the total number of hair strands, the follicle information, and the scalp area corresponding to the scalp image. This method can improve the pixel accuracy of the scalp image by collecting the scalp image with a scalp detector configured with a microscope with a magnification of more than 50 times, providing reliable data guarantee for the accurate evaluation of the scalp health status; by preprocessing the scalp image, the quality of the scalp image can be optimized, further ensuring the accuracy of subsequent processing; using the original scalp image carrying follicle annotation information to train the target detection model and applying the model to process the preprocessed scalp image, that is, the preprocessed image, more accurate and comprehensive follicle information can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0018] Figure 1 It is a flowchart of a scalp feature detection method provided by an embodiment of the present invention;

[0019] Figure 2 It is a flowchart of another scalp feature detection method provided by an embodiment of the present invention;

[0020] Figure 3 It is a schematic diagram of a scalp feature provided by an embodiment of the present invention;

[0021] Figure 4 It is a schematic structural diagram of a scalp feature detection device provided by an embodiment of the present invention;

[0022] Figure 5 It is a schematic structural diagram of a head electronic device provided by an embodiment of the present invention.

[0023] Icons: 31 - Acquisition module; 32 - Image processing module; 33 - Feature determination module; 41 - Memory; 42 - Processor; 43 - Bus; 44 - Communication interface. Detailed implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Components of the embodiments of the present invention usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0025] The detection technology of scalp problems is mainly completed through the following steps: First, medical staff use a scalp detection mirror to obtain the image data of the patient's scalp. Then, through the professional skills of medical staff, the image data is professionally evaluated to obtain the scalp characteristics of the patient. Therefore, due to the cumbersome operation steps and the need to rely on the professional knowledge of medical staff, the above method has low efficiency and poor accuracy.

[0026] Based on this, the embodiments of the present invention provide a scalp feature detection method, device, and electronic device. This method realizes the accurate quantitative evaluation of the scalp health status and improves the operation efficiency. For the convenience of understanding, a scalp feature detection method is introduced first.

[0027] Embodiment 1

[0028] In the embodiments of the present invention, Figure 1 is a schematic flowchart of a scalp feature detection method provided by an embodiment of the present invention. This method can be applied to terminal devices, such as computers or scalp detectors, etc. As Figure 1 can be seen, this method includes the following steps:

[0029] Step S101: Obtain the scalp image of the patient; wherein, the above scalp image is an image collected by a scalp detector configured with a microscope of more than 50 times magnification.

[0030] In this embodiment, the image acquisition parameters of the scalp detector with a microscope of more than 50 times magnification are: the image acquisition area is 0.25 square centimeters, the pixels are greater than or equal to 1920*1080, and it is configured with a stable LED light source. If the method of this embodiment is applied to terminal devices such as computers, the terminal device can be communicatively connected to the scalp detector, and then obtain the scalp image of the patient from the scalp detector.

[0031] The process of collecting scalp images using the above scalp detector can simply include: collecting a set of scalp images of patients through the scalp detector. Then, based on preset parameters, select the scalp image with the highest clarity from the above scalp images.

[0032] Step S102: Preprocess the above scalp image to obtain a preprocessed image.

[0033] In this embodiment, the purpose of the above preprocessing is mainly to optimize the quality of the scalp image. For example, the above step S102 includes adjusting the noise, contrast, background, etc. of the above scalp image to obtain a preprocessed image.

[0034] Step S103: Input the above preprocessed image into a pre-trained object detection model to output the hair follicle information in the above preprocessed image; the above object detection model is trained based on the original scalp image; the above original scalp image carries hair follicle annotation information.

[0035] In this embodiment, the above hair follicle information includes: hair follicle position, hair follicle shape, hair follicle boundary contour, and the number of hair strands in the hair follicle, etc.

[0036] Here, the above hair follicle position is the coordinate information of the hair follicle.

[0037] Further, before the step of inputting the above preprocessed image into a pre-trained object detection model to output the hair follicle information in the above preprocessed image, the above method includes: obtaining the above original scalp image; annotating the hair follicle position and the number of hair strands corresponding to the hair follicle position in the above original scalp image to obtain an updated original scalp image carrying the above hair follicle annotation information; training an initial Mask R-CNN or an initial YOLO series model with the above updated original scalp image until a preset training standard is reached to obtain the above object detection model.

[0038] Here, the above Mask R-CNN can be: Mask R-CNN or a similar network model; the above YOLO series model can be the YOLOv8 model or other models in this series.

[0039] Among them, the hair follicle position and the number of hair strands corresponding to the hair follicle position in the above original scalp image are annotated through software such as LabelImg, CVAT, and VIA, that is, setting the bounding box of the above hair follicle position and the number of hair strands within the bounding box.

[0040] As a possible implementation manner, the number of the above original scalp images can be greater than or equal to 1000 images to ensure the training accuracy of the above object detection model.

[0041] As a possible implementation, in this way, after obtaining the original scalp image, the feature pyramid is applied to enhance the features of small hair follicles and the threshold of non-maximum suppression is used to determine the bounding box of the above-mentioned hair follicle positions, thereby avoiding overlapping detections.

[0042] Step S104: Segment the preprocessed image according to the above-mentioned hair follicle information to obtain a plurality of sub-images.

[0043] In this embodiment, through U-Net or DeepLabv3+, an accurate mask corresponding to each hair follicle information is generated, and the attention mechanism is used to improve the accuracy of hair follicle edge segmentation.

[0044] For example: perform edge segmentation on each hair follicle and the hair in the hair follicle.

[0045] Step S105: Obtain the total number of hair strands in the preprocessed image according to the number of hair strands corresponding to the above-mentioned hair follicle information in each sub-image.

[0046] In this embodiment, the total number of hair strands in the preprocessed image is obtained by adding the number of hair strands corresponding to the above-mentioned hair follicle information in each sub-image.

[0047] Step S106: Determine the first scalp feature of the above-mentioned patient according to the total number of hair strands, the above-mentioned hair follicle information, and the scalp area corresponding to the above-mentioned scalp image.

[0048] In this embodiment, the above-mentioned first scalp feature includes: hair follicle density, the area ratio of each hair strand, and the number ratio of empty hair follicles to the total number of hair follicles.

[0049] An embodiment of the present invention provides a scalp feature detection method, including: obtaining a scalp image of a patient; wherein, the above-mentioned scalp image is an image collected by a scalp detector configured with a microscope with a magnification of more than 50 times; preprocessing the above-mentioned scalp image to obtain a preprocessed image; inputting the above-mentioned preprocessed image into a pre-trained target detection model to output the hair follicle information in the above-mentioned preprocessed image; the above-mentioned target detection model is trained based on the original scalp image; the above-mentioned original scalp image carries hair follicle annotation information; segmenting the above-mentioned preprocessed image according to the above-mentioned hair follicle information to obtain a plurality of sub-images; obtaining the total number of hair strands in the above-mentioned preprocessed image according to the number of hair strands corresponding to the above-mentioned hair follicle information in each sub-image; determining the first scalp feature of the above-mentioned patient according to the total number of hair strands, the above-mentioned hair follicle information, and the scalp area corresponding to the above-mentioned scalp image. This method realizes the accurate quantitative assessment of the scalp health status and improves the operation efficiency.

[0050] Embodiment 2

[0051] On the basis of the above embodiment, Figure 2Schematic flowchart of another scalp feature detection method provided by an embodiment of the present invention.

[0052] As Figure 2 can be seen, the method includes:

[0053] Step S201: Obtain a scalp image of the patient; wherein, the scalp image is an image collected by a scalp detector configured with a microscope with a magnification of more than 50 times.

[0054] Step S202: Preprocess the scalp image to obtain a preprocessed image.

[0055] Here, the preprocessing method includes: removing noise, enhancing the contrast between hair and background, and background correction to provide a clear image for subsequent segmentation processing.

[0056] Among them, the methods for denoising include: Gaussian filtering to eliminate high-frequency noise; non-local means denoising for complex noise in high-magnification microscopic images; the methods for enhancing the contrast between hair and background include: contrast-limited adaptive histogram equalization to enhance local contrast in blocks and avoid overexposure; gamma correction to enhance hair details in dark areas; the method for background correction includes: top-hat transformation to extract the background using morphological opening operation, and subtracting the background from the original image to eliminate uneven illumination.

[0057] Step S2031: Input the preprocessed image into a pre-trained object detection model to output the hair follicle information in the preprocessed image; the object detection model is trained based on the original scalp image; the original scalp image carries hair follicle annotation information.

[0058] Step S2032: Segment the preprocessed image according to the hair follicle information to obtain a plurality of sub-images.

[0059] Among them, after step S2032, the method includes: generating a hair follicle mask for each of the sub-images through a semantic segmentation network model; based on an attention mechanism, determining the number of hair strands corresponding to the hair follicle information in each sub-image according to the hair follicle mask.

[0060] Step S2033: Obtain the total number of hair strands in the preprocessed image according to the number of hair strands corresponding to the hair follicle information in each sub-image.

[0061] Step S2034: Determine the first scalp feature of the patient according to the total number of hair strands, the hair follicle information, and the scalp area corresponding to the scalp image.

[0062] Among them, the above-mentioned hair follicle information includes: the number of hair follicles; the step of determining the first scalp feature of the patient according to the total amount of hair strands, the above-mentioned hair follicle information, and the scalp area corresponding to the above-mentioned scalp image includes: calculating the hair density of the above-mentioned scalp area according to the total amount of hair strands and the scalp area corresponding to the above-mentioned scalp image; and determining the hair follicle density of the above-mentioned patient according to the number of the above-mentioned hair follicles and the scalp area; determining the above-mentioned hair density and hair follicle density as the first scalp feature of the above-mentioned patient.

[0063] Here, the hair follicle density usually refers to the number of hair follicles contained in one square centimeter of the scalp. Usually, there are 1 / 2 / 3 / multiple hairs in one hair follicle, and the vacant hair follicles have no hair.

[0064] For the sake of easy understanding, Figure 3 is a schematic diagram of a scalp feature provided by an embodiment of the present invention.

[0065] Further, after step S202, the above method includes:

[0066] Step S2041: Perform edge detection on the above-mentioned preprocessed image to extract the hair strand contour of the above-mentioned preprocessed image.

[0067] In this embodiment, the edge detection methods include: Canny edge detection to extract the hair contour; phase consistency edge detection, which is more robust to weak edges in high-magnification microscopic images.

[0068] Step S2042: Perform binarization and opening and closing operation processing on the above-mentioned preprocessed image to obtain a smooth binary image.

[0069] In this embodiment, the above binarization and opening and closing operation processing include: adaptive threshold segmentation: calculating a dynamic threshold with a local window to adapt to light and dark changes; closing operation to connect broken hair edges; opening operation to remove isolated noise points and retain slender structures.

[0070] Step S2043: Calculate the Euclidean distance from each foreground pixel to the background pixel in the above-mentioned binary image.

[0071] Step S2044: Determine the marked points of the above-mentioned hair strand contour based on the above-mentioned Euclidean distance; the Euclidean distance corresponding to the above-mentioned marked points is higher than that of the foreground pixels around the above-mentioned marked points.

[0072] Step S2045: Based on the above-mentioned marked points, segment and brighten the above-mentioned hair strand contour in the above-mentioned preprocessed image to obtain a brightened image.

[0073] In this embodiment, steps S2043, S2044, and S2045 are mainly implemented by the watershed algorithm to solve the problem of hair cross-linking and adhesion.

[0074] Step S2046: Determine the second scalp feature of the patient according to the above-mentioned brightened image.

[0075] Among them, the second scalp feature includes hair diameter; based on this, the above-mentioned step S2046 includes: based on the Zhang Suen thinning algorithm, extract the central axis of each hair in the above-mentioned brightened image; calculate the normal direction distance between the central axis and the target hair contour corresponding to the central axis; determine the hair diameter of the patient according to the above-mentioned normal direction distance.

[0076] Furthermore, this method also improves the accuracy of determining the hair diameter of the patient by using sub-pixel interpolation, namely bilinear or cubic spline.

[0077] Specifically, in each iteration of extracting the central axis of each hair in the above-mentioned brightened image, interpolate the gray values around the candidate deletion pixels to estimate the gray values at their sub-pixel positions. This can help more accurately determine which pixels should be deleted, thereby achieving a finer thinning effect. And after the thinning is completed, sub-pixel interpolation can be performed on the obtained skeleton image to generate smoother and continuous lines. For example, resampling the skeleton image using bilinear interpolation or cubic spline interpolation can make the skeleton smoother and reduce the jagged effect.

[0078] The above method obtains the first scalp feature of the patient through S201 to S2034, and obtains the second scalp feature of the patient through S201 to S2045. Taking the first scalp feature and the second scalp feature as the final detection result of the scalp, information such as hair density, follicle density, and hair diameter corresponding to the patient's scalp can be obtained, thereby helping the patient understand their scalp health status and providing reliable data for scalp care.

[0079] As a possible implementation, after the step of calculating the Euclidean distance from each foreground pixel to the background pixel in the above-mentioned binary image, the above method includes: removing the target Euclidean distance whose Euclidean distance is greater than a preset threshold to obtain an updated Euclidean distance; the step of determining the marker points of the hair contour based on the above-mentioned Euclidean distance includes: determining the marker points of the hair contour based on the above-mentioned updated Euclidean distance.

[0080] As a possible implementation, after the step of calculating the Euclidean distance from each foreground pixel to the background pixel in the above binary image, the above method may further include: removing the target Euclidean distances greater than a preset threshold from the above Euclidean distances to obtain updated Euclidean distances; correspondingly, the step of determining the marker points of the hair strand contour based on the above Euclidean distances may include: determining the marker points of the hair strand contour based on the above updated Euclidean distances. In this way, the target Euclidean distances greater than the preset threshold are usually likely to be noise. By removing the target Euclidean distances greater than the preset threshold from the above Euclidean distances, the updated Euclidean distances can be made more accurate, and further, determining the marker points of the hair strand contour based on the above updated Euclidean distances is also more accurate.

[0081] In some embodiments, the step of preprocessing the above scalp image to obtain a preprocessed image includes: performing noise reduction processing on the above scalp image to obtain a first image; enhancing the contrast of the above first image based on the adaptive histogram equalization technique to obtain a second image; performing morphological adjustment on the above second image based on opening operation and / or closing operation to obtain a preprocessed image.

[0082] In some other embodiments, before the step of inputting the above preprocessed image into a pre-trained target detection model and outputting the hair follicle information in the above preprocessed image, the above method includes: obtaining the above original scalp image; annotating the hair follicle positions and the number of hair strands corresponding to the hair follicle positions in the above original scalp image to obtain an updated original scalp image carrying the above hair follicle annotation information; training an initial mask region convolutional neural network or an initial YOLO series model with the above updated original scalp image until a preset training standard is reached to obtain the above target detection model.

[0083] The scalp feature detection method of this embodiment includes: obtaining a scalp image of a patient; wherein, the scalp image is an image collected by a scalp detector configured with a microscope of more than 50 times magnification; preprocessing the scalp image to obtain a preprocessed image; inputting the preprocessed image into a pre-trained object detection model to output follicle information in the preprocessed image; the object detection model is trained based on the original scalp image; the original scalp image carries follicle annotation information; segmenting the preprocessed image according to the follicle information to obtain a plurality of sub-images; obtaining the total number of hair strands in the preprocessed image according to the number of hair strands corresponding to the follicle information in each sub-image; determining the first scalp feature of the patient according to the total number of hair strands, the follicle information, and the scalp area corresponding to the scalp image; wherein, after the step of preprocessing the scalp image to obtain a preprocessed image, the method includes: performing edge detection on the preprocessed image to extract the hair strand contour of the preprocessed image; performing binarization and opening and closing operation processing on the preprocessed image to obtain a smooth binary image; calculating the Euclidean distance from each foreground pixel to the background pixel in the binary image; determining the marker points of the hair strand contour based on the Euclidean distance; the Euclidean distance corresponding to the marker points is higher than the foreground pixels around the marker points; segmenting and brightening the hair strand contour in the preprocessed image based on the marker points to obtain a brightened image; determining the second scalp feature of the patient according to the brightened image. This method collects and preprocesses the scalp image of the patient through a high-power microscope, analyzes the follicle information using an object detection model, and combines technologies such as edge detection, binarization processing, and Euclidean distance calculation to accurately segment and brighten the hair strand contour, and finally quantitatively evaluates the scalp features of the patient, realizing multi-dimensional and high-precision analysis of the scalp health status.

[0084] Embodiment 3

[0085] Based on the above embodiment, Figure 4 It is a schematic structural diagram of a scalp feature detection device provided by an embodiment of the present invention.

[0086] As Figure 4 can be seen, the device includes:

[0087] An acquisition module 31, configured to acquire a scalp image of a patient; wherein, the scalp image is an image collected by a scalp detector configured with a microscope of more than 50 times magnification.

[0088] An image processing module 32, configured to preprocess the scalp image to obtain a preprocessed image.

[0089] The feature determination module 33 is used to input the above-mentioned pre-processed image into a pre-trained target detection model, and output the hair follicle information in the above-mentioned pre-processed image; the above-mentioned target detection model is trained based on the original scalp image; the above-mentioned original scalp image carries hair follicle annotation information; according to the above-mentioned hair follicle information, the above-mentioned pre-processed image is segmented to obtain multiple sub-images; according to the number of hairs corresponding to the above-mentioned hair follicle information in each sub-image, the total amount of hairs in the above-mentioned pre-processed image is obtained; according to the above-mentioned total amount of hairs, the above-mentioned hair follicle information and the scalp area corresponding to the above-mentioned scalp image, the first scalp feature of the above-mentioned patient is determined.

[0090] The acquisition module 31, the image processing module 32 and the feature determination module 33 are connected in sequence.

[0091] In one embodiment, the image processing module 32 is further used to perform edge detection on the preprocessed image to extract the hair contour of the preprocessed image; perform binarization and opening and closing operations on the preprocessed image to obtain a smooth binary image; calculate the Euclidean distance from each foreground pixel to the background pixel in the binary image; determine the marking point of the hair contour based on the Euclidean distance; the Euclidean distance corresponding to the marking point is higher than the foreground pixels around the marking point; based on the marking point, segment the hair contour in the preprocessed image and perform brightening processing to obtain a brightened image; the feature determination module 33 is further used to determine the second scalp feature of the patient based on the brightened image.

[0092] In one embodiment, the feature determination module 33 is further used to extract the central axis of each hair in the brightened image based on the Zhang Suen refinement algorithm; calculate the normal direction distance between the central axis and the target hair contour corresponding to the central axis; determine the hair diameter of the patient based on the normal direction distance; and determine the hair diameter as the second scalp feature of the patient.

[0093] In one embodiment, the image processing module 32 is further used to eliminate the target Euclidean distance whose Euclidean distance is greater than a preset threshold value to obtain an updated Euclidean distance; and determine the marking points of the hair contour based on the updated Euclidean distance.

[0094] In one embodiment, the image processing module 32 is further used to perform noise reduction processing on the scalp image to obtain a first image; based on the adaptive histogram equalization technology, enhance the contrast of the first image to obtain a second image; based on the opening operation and / or the closing operation, perform morphological adjustment on the second image to obtain a preprocessed image.

[0095] In one implementation, the feature determination module 33 is further configured to obtain the above-mentioned original scalp image; label the hair follicle positions in the above-mentioned original scalp image and the number of hair strands corresponding to the hair follicle positions to obtain an updated original scalp image carrying the above-mentioned hair follicle annotation information; train the initial mask region convolutional neural network or the initial YOLO series model through the above-mentioned updated original scalp image until a preset training standard is reached, so as to obtain the above-mentioned target detection model.

[0096] In one implementation, the image processing module 32 is further configured to generate a hair follicle mask for each of the above-mentioned sub-images through a semantic segmentation network model; based on an attention mechanism, determine the number of hair strands corresponding to the above-mentioned hair follicle information in each sub-image according to the above-mentioned hair follicle mask.

[0097] In one implementation, the feature determination module 33 is further configured to calculate the hair density of the above-mentioned scalp area according to the total amount of hair strands and the scalp area corresponding to the above-mentioned scalp image; and determine the hair follicle density of the above-mentioned patient according to the number of hair follicles and the above-mentioned scalp area; determine the above-mentioned hair density and hair follicle density as the first scalp feature of the above-mentioned patient.

[0098] The scalp feature detection device provided by the embodiments of the present invention has the same technical features as the scalp feature detection method provided by the above-mentioned embodiments, so it can also solve the same technical problems and achieve the same technical effects. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described device can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0099] Embodiment 4

[0100] This embodiment provides an electronic device, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the scalp feature detection method.

[0101] This embodiment provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the scalp feature detection method are implemented.

[0102] See Figure 5 As shown in the structural schematic diagram of an electronic device, the electronic device includes: a memory 41 and a processor 42. A computer program that can run on the processor 42 is stored in the memory 41, and when the processor executes the computer program, the steps provided by the above-mentioned scalp feature detection method are implemented.

[0103] Such as Figure 5As shown, the device further includes: a bus 43 and a communication interface 44. The processor 42, the communication interface 44, and the memory 41 are connected via the bus 43. The processor 42 is configured to execute an executable module stored in the memory 41, such as a computer program.

[0104] Among them, the memory 41 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 44 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.

[0105] The bus 43 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 5 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0106] Among them, the memory 41 is used to store programs. After receiving an execution instruction, the processor 42 executes the programs. The methods executed by the scalp feature detection device disclosed in any embodiment of the present invention can be applied to the processor 42 or implemented by the processor 42. The processor 42 may be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the above methods can be completed by the integrated logic circuit in the hardware of the processor 42 or instructions in the form of software. The above-mentioned processor 42 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory 41, and the processor 42 reads the information in the memory 41 and combines its hardware to complete the steps of the above method.

[0107] Furthermore, an embodiment of the present invention also provides a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor 42, the machine-executable instructions cause the processor 42 to implement the above scalp feature detection method.

[0108] The electronic device and the computer-readable storage medium provided by the embodiments of the present invention have the same technical features, so they can also solve the same technical problems and achieve the same technical effects.

[0109] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "coupled" shall be construed in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0110] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

Claims

1. A scalp feature detection method, characterized in that: include: Acquire a scalp image of the patient; wherein the scalp image is an image acquired by a scalp detector equipped with a microscope with a magnification of 50 or more; Preprocessing the scalp image to obtain a preprocessed image; Input the pre-processed image into a pre-trained target detection model, and output the hair follicle information in the pre-processed image; the target detection model is trained based on the original scalp image; the original scalp image carries the hair follicle annotation information; Segmenting the preprocessed image according to the hair follicle information to obtain a plurality of sub-images; Obtaining the total amount of hair in the preprocessed image according to the number of hairs corresponding to the hair follicle information in each sub-image; A first scalp feature of the patient is determined according to the total amount of hair, the hair follicle information, and a scalp area corresponding to the scalp image.

2. The scalp feature detection method according to claim 1, characterized in that: After the step of preprocessing the scalp image to obtain a preprocessed image, the method comprises: Performing edge detection on the preprocessed image to extract hair contours of the preprocessed image; Binarization and opening and closing operations are performed on the preprocessed image to obtain a smooth binary image; Calculating the Euclidean distance from each foreground pixel to the background pixel in the binary image; Based on the Euclidean distance, determining a marker point of the hair contour; the Euclidean distance corresponding to the marker point is higher than the foreground pixels around the marker point; Based on the marking points, segmenting and brightening the hair contour in the preprocessed image to obtain a brightened image; A second scalp feature of the patient is determined based on the brightened image.

3. The scalp feature detection method according to claim 2, characterized in that: The step of determining the second scalp feature of the patient according to the brightened image comprises: Extracting the central axis of each hair in the brightened image based on Zhang Suen's thinning algorithm; Calculating the normal distance between the central axis and the target hairline contour corresponding to the central axis; Determining the hair diameter of the patient according to the normal direction distance; The hair diameter is determined as a second scalp characteristic of the patient.

4. The scalp feature detection method according to claim 2, characterized in that: After the step of calculating the Euclidean distance from each foreground pixel to the background pixel in the binary image, the method comprises: Eliminate the target Euclidean distance whose Euclidean distance is greater than a preset threshold to obtain an updated Euclidean distance; The step of determining the marking points of the hair contour based on the Euclidean distance comprises: Based on the updated Euclidean distance, the marking points of the hair contour are determined.

5. The scalp feature detection method according to claim 1, characterized in that: The step of preprocessing the scalp image to obtain a preprocessed image comprises: Performing noise reduction processing on the scalp image to obtain a first image; Based on the adaptive histogram equalization technology, the contrast of the first image is enhanced to obtain a second image; The second image is morphologically adjusted based on an opening operation and / or a closing operation to obtain a preprocessed image.

6. The scalp feature detection method according to claim 1, characterized in that: Before the step of inputting the preprocessed image into a pre-trained target detection model and outputting the hair follicle information in the preprocessed image, the method comprises: Acquire the original scalp image; Marking the hair follicle positions and the number of hairs corresponding to the hair follicle positions in the original scalp image to obtain an updated original scalp image carrying the hair follicle marking information; The initial mask region convolutional neural network or the initial YOLO series model is trained by updating the original scalp image until a preset training standard is reached to obtain the target detection model.

7. The scalp feature detection method according to claim 1, characterized in that: After the step of segmenting the preprocessed image according to the hair follicle information to obtain a plurality of sub-images, the method comprises: Generate a hair follicle mask for each of the sub-images through a semantic segmentation network model; Based on the attention mechanism, the number of hairs corresponding to the hair follicle information in each sub-image is determined according to the hair follicle mask.

8. The scalp feature detection method according to claim 1, characterized in that: The hair follicle information includes: the number of hair follicles; the step of determining the first scalp feature of the patient according to the total amount of hair, the hair follicle information and the scalp area corresponding to the scalp image includes: Calculating the hair density of the scalp area according to the total amount of hair strands and the scalp area corresponding to the scalp image; and determining the hair follicle density of the patient according to the number of hair follicles and the scalp area; The hair density and hair follicle density are determined as the first scalp characteristics of the patient.

9. A scalp feature detection device, characterized in that: include: An acquisition module, used to acquire a scalp image of a patient; wherein the scalp image is an image acquired by a scalp detector equipped with a microscope with a magnification of 50 or more; An image processing module, used for preprocessing the scalp image to obtain a preprocessed image; The feature determination module is used to input the pre-processed image into a pre-trained target detection model and output the hair follicle information in the pre-processed image; the target detection model is trained based on the original scalp image; the original scalp image carries hair follicle annotation information; according to the hair follicle information, the pre-processed image is segmented to obtain a plurality of sub-images; according to the number of hairs corresponding to the hair follicle information in each sub-image, the total amount of hairs in the pre-processed image is obtained; according to the total amount of hairs, the hair follicle information and the scalp area corresponding to the scalp image, the first scalp feature of the patient is determined.

10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the scalp feature detection method according to any one of claims 1 to 8.