Body fat rate estimation method based on non-medical image

By building a body fat percentage estimation model based on non-medical images on terminal devices, and combining image processing and machine learning technologies, the portability and accuracy issues of body fat percentage estimation are solved, achieving low-cost and accurate body fat percentage monitoring, which is suitable for ordinary users to use anytime and anywhere.

CN121359902APending Publication Date: 2026-01-20HANGZHOU JOINHEALTH TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511923191.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing body fat percentage estimation methods cannot achieve both portability and accuracy, and their cost and adaptability to different usage scenarios are poor, failing to meet the needs of ordinary users for accurate body fat monitoring anytime, anywhere, at low cost.

Method used

A body fat percentage estimation method based on non-medical images is adopted. Images of the front, left, and right sides of the subject are captured by a camera. Combined with basic parameters, image preprocessing and feature extraction are performed. A fusion model of gradient boosting tree and fully connected neural network is used for training to build a body fat percentage estimation model, which is then deployed on a terminal device to achieve real-time estimation.

Benefits of technology

It has improved the accuracy of body fat percentage estimation to ≤3%, reduced costs, supported convenient monitoring for ordinary users in any scenario, adapted to individual differences among different groups, and provided risk warnings for fat distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121359902A_ABST
    Figure CN121359902A_ABST
Patent Text Reader

Abstract

The invention relates to the cross technical field of body fat rate detection and image processing, and particularly discloses a non-medical image-based body fat rate estimation method, which comprises the following steps of: S1, acquiring three images of the front surface, the left side surface and the right side surface of a detected person through a camera, and synchronously recording basic parameters of the detected person; s2, performing normalization processing on the three images, and extracting body edge information through a Canny algorithm to obtain a body contour image; s3, extracting appearance features and texture features of the human body contour image, performing feature fusion on the basic parameters, the appearance features and the texture features of the testee, and determining a multi-dimensional feature vector of the testee; s4, constructing a body fat rate estimation model; and deploying the body fat rate estimation model to realize real-time estimation of the body fat rate. And S5, inputting the multi-dimensional feature vector of the tested person into the trained body fat rate estimation model, and outputting a body fat rate estimation value.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of body fat rate detection and image processing, and particularly relates to a body fat rate estimation method based on non-medical images. BACKGROUND

[0002] The traditional formula calculation method of body fat rate has large estimation error and cannot meet the precise monitoring requirement. The existing bioelectrical impedance analysis method calculates the body fat rate by combining the impedance difference of different tissues of the human body (high fat impedance, low muscle / water impedance) with height, weight, age and other parameters. The method is commonly used in household body fat scales. Its defects include being easily affected by water state (such as water change after drinking water or exercise, which can cause impedance fluctuation, and single measurement error can reach 5%-10%), being unable to distinguish fat types (visceral fat and subcutaneous fat cannot be estimated separately), and the device needs to be purchased separately, which has poor portability and cannot realize monitoring at any time and anywhere.

[0003] In addition, the medical image analysis method is also used, such as the body fat rate estimation method based on CT and MRI scan images. The body section image is obtained by professional medical equipment, and the U-net model is used to segment fat tissue to calculate the body fat rate. The method depends on high-resolution medical images and has high precision (error is less than 3%). However, the defects are obvious, the device cost is high (the cost of a single CT device is more than one million yuan), professional medical personnel are needed for operation, there is a radiation risk (CT scanning), and the device can only be used in professional places such as hospitals, which cannot meet the daily and convenient body fat monitoring requirement of ordinary users. Therefore, in view of the contradiction between the portability and accuracy of the existing body fat rate estimation method and the cost and adaptability of the use scene, the body fat rate monitoring requirement of ordinary users is proposed, which can be monitored at any time and anywhere, at low cost and with relatively high accuracy. SUMMARY

[0004] The purpose of the present application is to provide a body fat rate estimation method based on non-medical images, which solves the following technical problems: How to significantly improve the accuracy of body fat rate estimation while reducing the cost of body fat estimation and expanding the scene of ordinary users.

[0005] The purpose of the present application can be achieved by the following technical solutions: A body fat rate estimation method based on non-medical images, the method comprising: S1, three images of a subject, including front, left side and right side, are collected by a camera, and the basic parameters of the subject are recorded synchronously; S2, the three images in step S1 are normalized, and the body edge information is extracted by Canny algorithm to obtain a human body contour image; S3, extract the shape features and texture features of the human body contour image, fuse the basic parameters of the measured person with the shape features and the texture features to determine the multi-dimensional feature vector of the measured person; S4, collect historical population sample information to construct a historical data set and obtain sample labels, input the historical data set into a fusion model based on gradient boosting tree and fully connected neural network for training to construct a body fat rate estimation model; And the body fat rate estimation model is deployed, the deployment method is to convert the trained body fat rate estimation model into ONNX format, which supports running on terminal devices without relying on cloud computing, realizing real-time estimation of body fat rate; S5, input the multi-dimensional feature vector of the measured person into the trained body fat rate estimation model to output the body fat rate estimation value.

[0006] Preferably, the multi-dimensional feature vector is a 18-dimensional feature vector, the basic parameters are 6 dimensions, the shape features are 8 dimensions, and the texture features are 4 dimensions derived from GLCM; wherein: The dimensions of the basic parameters include: height, weight, age, gender, exercise habit; The dimensions of the shape features include: key part circumference, key part diameter, proportion feature, area feature; The proportion feature includes: waist-hip ratio, shoulder-hip ratio, waist-height ratio; the area feature includes: torso area, whole body area, lower limb area; the torso area is defined as the area between the shoulder key point and the hip key point; the lower limb area is defined as the area between the hip key point and the ankle key point; the torso fat ratio is determined according to the torso area / whole body area, and the lower limb fat ratio is determined according to the lower limb area / whole body area; The texture features are calculated by selecting two fat accumulation prone areas, the waist and abdomen, and the upper arm back, selecting a 200x200 pixel ROI area in each area, and using a gray level co-occurrence matrix to calculate four texture parameters as four-dimensional texture features. The four texture parameters include: contrast, correlation, energy, and entropy. The average value of each texture parameter of the two ROI areas is taken as the final texture feature.

[0007] Preferably, the construction steps of the body fat rate estimation model are: S41, collect a plurality of different population samples as a data set, the population samples include age, gender, and the true body fat rate of each sample is measured by dual-energy X-ray absorption method to obtain the label for training; S42, left and right random flip, rotation, and brightness disturbance are performed on the images of the population samples to expand the data set and increase the number of population samples; S43, a fusion model of "gradient boosting tree + fully connected neural network" is used for population sample training to obtain training parameters; S44, 80% of the training set and 20% of the validation set are divided by 5-fold cross-validation, the parameters are optimized by grid search, the average absolute error of the model validation set is ≤3%, and the optimized body fat rate estimation model is obtained.

[0008] Preferably, gradient boosting trees are used to extract non-linear correlations between features, and fully connected neural networks are used to fit complex feature mapping model architectures.

[0009] Preferably, the body fat rate estimation step of the body fat rate estimation model is: Real-time input of three images of the subject's front, left side and right side to obtain a multi-dimensional feature vector; The body fat rate estimation model outputs the body fat rate estimation value and outputs the fat distribution risk prompt information according to the fat distribution.

[0010] Preferably, step S5 further comprises: S51, error correction judgment of body fat rate estimation: If the subject is measured again, the body fat rate estimation model will perform weighted correction according to the historical measurement data to reduce individual measurement error.

[0011] Preferably, the weighted correction weight is set as: The ratio of the weight of the latest measurement to the sum of the weights of the previous measurements is 1:1, and the weights of each previous measurement are the same.

[0012] A user terminal device, the user terminal is equipped with: An image acquisition module for acquiring three images of the subject's front, left side and right side through a camera, and synchronously recording the subject's basic parameters; A preprocessing module for normalizing the three images in step S1 and extracting body edge information to obtain a human body contour image through a Canny algorithm; A feature extraction module for extracting the shape features and texture features of the human body contour image, and fusing the subject's basic parameters and shape features and texture features to determine the subject's multi-dimensional feature vector; A model deployment module for collecting historical population sample information to construct a historical data set and obtain sample labels, inputting the historical data set into a fusion model based on gradient boosting trees and fully connected neural networks for training, and constructing a body fat rate estimation model; It is also used for deploying the body fat rate estimation model, the deployment method is to convert the trained body fat rate estimation model into ONNX format, support running on terminal equipment, without relying on cloud computing, realize real-time estimation of body fat rate; A result display module for inputting the subject's multi-dimensional feature vector into the trained body fat rate estimation model to output the body fat rate estimation value.

[0013] Advantages of the present application: (1) Compared with the traditional formula calculation method (error 8%~15%), bioelectrical impedance method (error 5%~10%), the average absolute error of the present application is ≤3%, the precision is close to the medical method (DXA error ≤2%), and the visceral fat risk can be indirectly prompted through the waist-hip ratio and other characteristics, which makes up for the functional gap of non-medical methods; (2) Only ordinary smart phones are needed to complete the measurement, without the need for special equipment, and the measurement time is ≤5 minutes (including image acquisition, preprocessing, and estimation of the whole process), supporting any scene such as outdoor and home, solving the "scene limited" problem of existing methods; (3) Without the need to purchase professional body fat scales and medical imaging equipment, the model can be integrated into existing health APPs, with extremely low development and use costs (zero hardware cost for users), suitable for large-scale civilian promotion; (4) Through data enhancement and cross-validation optimization of the model, it can adapt to different age (18-60 years old), gender, and body type (slim / normal / obese) populations, and the estimation error of the model in fitness groups, office groups, and elderly groups is ≤3.5%, solving the problem of "poor individual difference adaptability" of existing methods.

[0014] Of course, any product implementing the present application does not necessarily need to achieve all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0016] Figure 1 A body fat rate estimation method based on non-medical images according to the present application; Figure 2 An application system module schematic diagram of a user terminal device according to the present application. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0018] Embodiment 1 Please refer toFigure 1 As shown, the present application is a body fat rate estimation method based on non-medical images. The present application realizes convenient and accurate body fat rate estimation by combining image processing and machine learning technology through the technical path of "non-medical image acquisition-image preprocessing-multi-dimensional feature extraction-machine learning model training-body fat rate estimation". The specific steps and technical features are as follows: Step 1. Image acquisition step Device requirements: Use ordinary consumer-grade cameras (such as smartphone rear cameras, digital cameras), resolution not less than 12 million pixels, no need for professional lenses or medical imaging modules; Collection specification: The subject wears tight and patternless clothes (such as black tight sportswear) to avoid clothing wrinkles and body contour obstruction; The background is a pure color (such as white, light gray) texture-free background, 1.5-2 meters away from the subject, ensuring that the whole body is in the shot; Collect three images of the front, left side and right side (the side images need to ensure that the body is parallel to the lens plane without front-to-back tilt), the lens height is level with the subject's waist, avoiding contour distortion caused by looking down or looking up; Synchronously record the subject's basic parameters: height (accurate to 0.5 cm), weight (accurate to 0.1 kg), age (years old), gender (male / female), whether there is a sports habit (yes / no, sports frequency ≥3 times per week as having).

[0019] Step 2. Image preprocessing step Background removal: use a "human key point detection + semantic segmentation" joint algorithm, first detect 17 key nodes of the human body (head, shoulder, elbow, wrist, hip, knee, ankle) through the OpenPose open source library to determine the minimum bounding rectangle of the human body; then use the MaskR-CNN model to perform semantic segmentation on the rectangular region to separate the human body region from the background region, output a binary mask image containing only the human body, and remove the background interference; Image normalization: Size normalization: take the body height as the benchmark, scale the body height in the image to 500 pixels (for example, if the original image has a body height of 250 pixels, the scaling factor is 2), and the width is scaled synchronously according to the original width-height ratio to ensure that the image size benchmarks of different subjects are consistent; Brightness / contrast normalization: calculate the average gray value of the human body region, adjust the average gray value of all images to 128 (8-bit grayscale image range 0-255), and unify the contrast through gamma correction (γ=1.2) to avoid feature deviation caused by light differences; Contour optimization: edge detection (using Canny operator with lower threshold 50 and upper threshold 150) and burr noise removal (by 3x3 median filter) are performed on the normalized body image to obtain a smooth body contour image.

[0020] Step 3. Multi-dimensional feature extraction step Contour feature extraction (core feature, related to fat distribution): Circumference / diameter type: calculate the circumference (waist circumference: horizontal circumference at 5 cm above the hip; hip circumference: horizontal circumference at the widest part of the hips; chest circumference: horizontal circumference along the nipple line) and diameter (shoulder width: distance between left and right shoulder key points; thigh root diameter: horizontal diameter between the hip and knee) of key parts by contour pixel coordinates, and convert the unit to cm (1 pixel in the image corresponds to the actual length = subject height / image body height); Proportion feature: calculate the waist-hip ratio (waist circumference / hip circumference), shoulder-hip ratio (shoulder width / hip circumference), and waist-height ratio (waist circumference / height) to reflect the characteristics of fat accumulation in certain parts (e.g., high waist-hip ratio usually corresponds to high visceral fat); Area feature: calculate the trunk fat percentage (trunk area / total body area, trunk area defined as the area between the shoulder key point and the hip key point) and lower limb fat percentage (area between the hip key point and the ankle key point / total body area) to indirectly reflect fat distribution through area percentage; Texture feature extraction (auxiliary feature, related to subcutaneous fat density): Select two fat accumulation areas (200x200 pixel ROI area for each region) in the waist and abdomen, and upper arm back, and calculate four texture parameters using the gray level co-occurrence matrix (GLCM): contrast (reflecting texture clarity, low contrast in fat areas), correlation (reflecting texture direction consistency, high correlation in fat areas), energy (reflecting texture uniformity, high energy in fat areas), and entropy (reflecting texture complexity, low entropy in fat areas). The average value of each parameter for the two ROI regions is taken as the final texture feature; Basic parameter fusion: combine the collected height, weight, age, gender (converted to 0-1 variable, male = 1, female = 0), exercise habit (converted to 0-1 variable, yes = 1, no = 0) with the above image features to form an 18-dimensional feature vector (8 contour features, 4 texture features, and 6 basic parameters).

[0021] Step 4. Body fat rate estimation model construction step Dataset construction: Sample size: collect 2000 samples from different populations (age 18-60, 1000 males and 1000 females, body fat rate range male 5%-35%, female 10%-40%); Label acquisition: The true body fat rate (accurate to 0.1%) of each sample is measured by dual-energy X-ray absorptiometry (DXA, the gold standard for body fat rate measurement) as the label for model training; Data augmentation: The image samples are randomly flipped (left-right flipping to avoid side image direction deviation), rotated (±3° to simulate slight shooting angle deviation), and brightness perturbed (±10% to simulate light fluctuation) to expand the data set to 6000 samples; Model selection and training: Model architecture: A fusion model of "gradient boosting tree (XGBoost) + fully connected neural network (MLP)" is adopted, XGBoost is used to extract the non-linear relationship between features (such as the non-linear relationship between waist-hip ratio and body fat rate), and MLP (input layer 18 neurons, hidden layer 2 layers each with 32 neurons, and output layer 1 neuron) is used to fit complex feature mapping; Training parameters: The learning rate of XGBoost is 0.05, the tree depth is 6, and the iteration number is 100; the optimizer of MLP is Adam (learning rate 0.001), the loss function is mean square error (MSE), the training round is 50 rounds, and the batch size is 32; Model optimization: The training set (80%) and the validation set (20%) are divided by 5-fold cross-validation, the parameters are tuned by grid search to ensure the generalization ability of the model on different population samples, and the final model validation set average absolute error (MAE) ≤3%; Model deployment: The trained model is converted into ONNX format, which supports running on terminal devices such as smartphones (Android / iOS system), tablet computers, etc., without relying on cloud computing, realizing real-time estimation.

[0022] Step 5. Body fat rate estimation step Input: The 18-dimensional feature vector obtained after preprocessing and feature extraction of the 3 images (front, left side, and right side) of the measured person is input into the deployed fusion model; Output: The model outputs the body fat rate estimation value (accurate to 0.1%), and also outputs the "fat distribution risk prompt" (such as when waist-hip ratio > 0.9 (male) / 0.85 (female), prompting "high visceral fat risk"); Error correction: If the measured person is measured again later (interval ≥7 days), the model will make a weighted correction (the latest one is 0.5, and the previous two are 0.25) according to the historical measurement data (the first three measurement values), further reducing the individual measurement error.

[0023] Example 2 User terminal devices usually include smart phones, tablets, and computer application terminal products, please refer to Figure 2 As shown in the figure, a user terminal device of the present application, the user terminal is equipped with: an image acquisition module, configured to acquire three images of a front view, a left side view and a right side view of a subject through a camera, and synchronously record basic parameters of the subject; the image acquisition module is configured to call the camera and determine a parameter input interface of the camera.

[0024] a preprocessing module, configured to perform normalization processing on the three images in step S1, and extract body edge information to obtain a human body contour image through a Canny algorithm; the preprocessing module is equipped with an integrated OpenPose (human key point detection) + Mask and RCNN (semantic segmentation) + OpenCy algorithm; a feature extraction module, configured to extract contour features and texture features of the human body contour image, perform feature fusion on the basic parameters of the subject and the contour features and the texture features, and determine a multi-dimensional feature vector of the subject; the feature extraction module is configured to determine the multi-dimensional feature vector through GLCM (gray level co-occurrence matrix) calculation + feature fusion logic; a model deployment module, configured to collect historical population sample information to construct a historical data set and obtain sample labels, input the historical data set into a fusion model based on gradient boosting trees and fully connected neural networks for training, and construct a body fat rate estimation model; The model deployment module is further configured to deploy the body fat rate estimation model, the deployment manner being converting the trained body fat rate estimation model into an ONNX format, supporting running on a terminal device without relying on cloud computing, and realizing real-time estimation of the body fat rate; The model deployment module loads the ONNK model for Core ML (i0S) / TensorFlow Lite (Android) to run; a result display module, configured to input the multi-dimensional feature vector of the subject into the trained body fat rate estimation model, and output a body fat rate estimation value; the content of the result display module includes numerical display + risk prompt pop-up window + historical data curve.

[0025] The following is verified by an example: Taking a subject Li Si (female, 35 years old, 165 cm in height, 60 kg in weight, and no exercise habit) as an example, the following steps are performed, and the body fat rate estimation process can be directly reproduced: (I) Preparation and image acquisition Device: Huawei Mate60 mobile phone (rear camera 50 million pixels), close to beauty, open normal shooting mode; Environment: stand in front of a white wall (no clutter background), the mobile phone is 1.6 meters away from the body, and the lens is level with the waist (about 95 cm high); Operation: Wear black tight clothes, feet together, arms down, body straight, take 3 pictures of front (face the camera), left side (left body towards the camera), right side (right body towards the camera), save as JPG format; Record parameters: Enter height 165.0 cm, weight 60.0 kg, age 35 years old, gender female, exercise habit "no" in the mobile phone interface.

[0026] (II) Image preprocessing (automatic completion by mobile APP) Remove background: APP uses OpenPose to detect 17 key points of the body (such as shoulders, waist, knees), determines the body range, and uses MaskR-CNN to segment the white background, leaving only the body image; Normalization: Scale the body image to "body height 500 pixels", and unify the brightness (average gray value 128) and contrast (gamma value 1.2); Optimize contour: Use Canny algorithm to extract body edge, and use 3x3 median filter to remove edge burrs caused by clothing wrinkles to get smooth body contour.

[0027] Core algorithm principle 1. Human key point detection (OpenPose): Detect 17 human key points (such as shoulders, hips, knees) through a pre-trained lightweight model (MobileNetbackbone), determine the minimum bounding rectangle of the human body, and exclude the background area.

[0028] 2. Semantic segmentation (MaskR-CNN): For the bounding rectangle area, use a lightweight MaskR-CNN model (simplified version, reduce the number of convolution layers) to generate a human body binary mask, achieving pixel-level separation of background and human body.

[0029] 3. Image normalization: Scale the human body height in the image to 500 pixels based on the height of the subject, and unify the brightness and contrast through gamma correction.

[0030] (III) Feature extraction and model estimation Feature extraction: APP automatically calculates Shape: waist circumference 72 cm, hip circumference 85 cm, waist-hip ratio 0.85, trunk area accounts for 40% of the total body area; Texture: Abdominal skin contrast 46, correlation 0.73; Fusion of basic parameters to form an 18-dimensional feature vector; Body fat calculation: Input the feature vector into the "XGBoost + MLP" model (built-in in the APP, no need to connect to the network), and output the result within 10 seconds.

[0031] Core algorithm principle (1) Shape features: The human body contour is obtained through Canny edge detection, and key circumferences such as waist circumference and hip circumference are calculated (based on the conversion relationship between pixel coordinates and actual height: 1 pixel = actual height / image body height, in the example, 1 pixel = 165 cm / 500 = 0.33 cm).

[0032] (2) Texture features: For the ROI area of the waist and abdomen, four parameters such as contrast and correlation are calculated using the Gray Level Co-occurrence Matrix (GLCM) to reflect the subcutaneous fat density (the texture of the fat area is more uniform, with low contrast and high correlation).

[0033] (3) Feature fusion: The shape features (8), texture features (4), and basic parameters (height, weight, etc. 6) are combined into an 18-dimensional vector for model input.

[0034] The 8 shape features are: key part circumference, key part diameter, waist-hip ratio, shoulder-hip ratio, waist-height ratio, torso area, total body area, and lower limb area. The 4 texture features are: contrast, correlation, energy, and entropy. The 6 basic parameters are: height, weight, age, gender, and exercise habit. (4) Model architecture: The pre-trained "XGBoost + MLP" fusion model is loaded in the backend (converted to ONNX format for mobile adaptation), where XGBoost is responsible for capturing non-linear feature associations (such as the relationship between waist-hip ratio and body fat rate), and MLP is responsible for fitting high-dimensional feature mapping.

[0035] (Four) Result output and verification Output: Body fat rate estimate 22.5%, due to female waist-hip ratio 0.85, suggesting "visceral fat risk needs attention, suggesting moderate aerobic exercise"; Verification: The actual body fat rate measured by dual-energy X-ray absorptiometry (DXA) is 22.8%, with an error of 0.3%, meeting the accuracy requirements.

[0036] The core code is as follows: import cv2 import numpy as np import tensorflow as tf #1. Load lightweight model (OpenPose key point detection + MaskR-CNN segmentation) openpose_model = tf.lite.Interpreter(model_path="openpose_lite.tflite") maskrcnn_model=tf.lite.Interpreter(model_path="maskrcnn_lite.tflite") openpose_model.allocate_tensors() maskrcnn_model.allocate_tensors() #2. Read the image uploaded from the front end (the front view of Li Si in the example). img=cv2.imread("lisi_front.jpg") h,w,_=img.shape #3. Human Keypoint Detection (OpenPose) input_details=openpose_model.get_input_details() output_details=openpose_model.get_output_details() input_data = cv2.resize(img,(256,384)) # Model input size input_data=np.expand_dims(input_data / 255.0,axis=0).astype(np.float32) openpose_model.set_tensor(input_details[0]['index'],input_data) openpose_model.invoke() keypoints = openpose_model.get_tensor(output_details[0]['index'])[0] # Coordinates of 17 keypoints #4. Determine the bounding rectangle of the human figure (excluding the background). shoulder = keypoints[5] # Right shoulder keypoints (x, y) hip = keypoints

[11] # Keypoints of the right hip min_x=int(min(keypoints[:,0])*w) max_x=int(max(keypoints[:,0])*w) min_y = int(min(keypoints[:, 1]) * h) max_y = int(max(keypoints[:, 1]) * h) human_roi = img[min_y:max_y, min_x:max_x] # Human ROI region # 5. Semantic segmentation (MaskR-CNN) to remove residual background mask_input = cv2.resize(human_roi, (320, 320)) mask_input = np.expand_dims(mask_input / 255.0, axis=0).astype(np.float32) maskrcnn_model.set_tensor(maskrcnn_model.get_input_details()[0]['index'], mask_input) maskrcnn_model.invoke() mask = maskrcnn_model.get_tensor(maskrcnn_model.get_output_details()[0]['index'])[0] mask = cv2.resize(mask, (human_roi.shape[1], human_roi.shape[0])) human_img = cv2.bitwise_and(human_roi, human_roi, mask=(mask > 0.5).astype(np.uint8)) # Keep only human region # 6. Image normalization (scale to 500 pixels by height) target_h = 500 # Target human height (pixels) actual_height = 165.0 # Li Si's actual height (cm) scale = target_h / (max_y - min_y) # Scaling factor normalized_img = cv2.resize(human_img, (int(human_img.shape[1] * scale), target_h)) # 7. Brightness / contrast normalization (gamma correction) gray_img = cv2.cvtColor(normalized_img, cv2.COLOR_BGR2GRAY) mean_gray = np.mean(gray_img) gamma = 1.2 normalized_gray = np.power((gray_img / 255.0), gamma) * 255.0 normalized_gray = np.clip(normalized_gray, 0, 255).astype(np.uint8) # Adjust the mean gray to 128 (instance requirement) gray_diff = 128 - mean_gray normalized_gray = cv2.convertScaleAbs(normalized_gray, alpha=1, beta=gray_diff) # Output the pre-processed human image (for subsequent feature extraction) cv2.imwrite("human_normalized.jpg", normalized_gray) Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device, apparatus, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0037] The above describes specific embodiments of the specification. Other embodiments are within the scope of the attached application. In some cases, the actions or steps described in this document can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0038] The above is only an example and description of the concept of the present application. Those skilled in the art can make various modifications or supplements to the described specific embodiments or use similar ways to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined in this application. It should belong to the protection scope of the present application.

Claims

1. A method of estimating a body fat rate based on a non-medical image, characterized by, The method comprises: S1, three images of the front, left side and right side of the measured person are collected by a camera, and the basic parameters of the measured person are recorded synchronously; S2, the three images in step S1 are normalized, and the body contour image is obtained by extracting the body edge information through the Canny algorithm; S3, the shape features and texture features of the body contour image are extracted, the basic parameters of the measured person and the shape features and texture features are fused, and a multi-dimensional feature vector of the measured person is determined; S4, historical population sample information is collected to construct a historical data set and obtain sample labels, the historical data set is input into a fusion model based on gradient boosting tree and full connection neural network for training, and a body fat rate estimation model is constructed; and the body fat rate estimation model is deployed to realize real-time estimation of the body fat rate; S5, the multi-dimensional feature vector of the measured person is input into the trained body fat rate estimation model, and the body fat rate estimation value is output.

2. The method of claim 1, wherein the method is based on a non-medical image. The multi-dimensional feature vector is a total of 18-dimensional feature vectors, the basic parameters are a total of 6 dimensions, the shape features are a total of 8 dimensions, and the texture features are a total of 4 dimensions derived from GLCM; wherein: The dimensions of the basic parameters include: height, weight, age, gender, exercise habit; The dimensions of the shape features include: key part circumference, key part diameter, proportion feature, area feature; The proportion feature includes: waist-hip ratio, shoulder-hip ratio, waist-height ratio; the area feature includes: trunk area, whole body area, lower limb area; the trunk area is defined as the area between the shoulder key point and the hip key point; the lower limb area is defined as the area between the hip key point and the ankle key point; the trunk fat percentage is determined according to the trunk area / whole body area, and the lower limb fat percentage is determined according to the lower limb area / whole body area; The texture features are obtained by selecting two fat accumulation prone areas of the waist and abdomen and the upper arm back, selecting a 200*200 pixel ROI area in each area, calculating four texture parameters as four-dimensional texture features by using a gray level co-occurrence matrix, and taking the average value of each texture parameter of the two ROI areas as the final texture feature.

3. The method of claim 1, wherein the method is based on non-medical images. The four texture parameters include: contrast, correlation, energy, and entropy. The construction steps of the body fat rate estimation model are: S41, collect a plurality of different population samples as a data set, the population samples include age, gender, and the true body fat rate of each sample is measured by dual-energy X-ray absorption method to obtain a label for training; S42, the images of the population samples are randomly flipped left and right, rotated, and brightness disturbed to expand the data set and increase the number of population samples; S43, a fusion model of "gradient boosting tree + full connection neural network" is used for population sample training to obtain training parameters; 4. The body fat rate estimation method based on non-medical images according to claim 3, wherein, S44, 80% of the training set and 20% of the validation set are divided by 5-fold cross-validation, the parameters are optimized by grid search, the average absolute error of the model validation set is optimized to be less than or equal to 3%, and the optimized body fat rate estimation model is obtained. The gradient boosting tree is used to extract the non-linear correlation between features, and the full connection neural network is used to fit a complex feature mapping model architecture.

5. The method of claim 4, wherein the method is based on non-medical images. The estimation step of the body fat rate of the body fat rate estimation model is: Real-time input of three images of the front, left side and right side of the measured person to obtain a multi-dimensional feature vector; The body fat rate estimation model outputs the body fat rate estimation value and outputs the fat distribution risk prompt information according to the fat distribution.

6. The method of claim 1, wherein the method is based on non-medical images. The step S5 further comprises: S51, error correction judgment of body fat rate estimation: If the measured person is measured again, the body fat rate estimation model will perform weighted correction according to the historical measurement data to reduce individual measurement error.

7. The method of claim 6, wherein the method is based on non-medical images. The weighted correction weight is set as: The ratio of the weight of the latest measurement to the weight of the previous measurement is 1:1, and the weight of each previous measurement is the same.

8. A user terminal device employing the non-medical image-based body fat rate estimation method according to any one of claims 1 to 7, characterized by, The user terminal is equipped with: An image acquisition module for acquiring three images of the front, left side and right side of the measured person through a camera and recording the basic parameters of the measured person synchronously; A preprocessing module for normalizing the three images in step S1 and extracting body edge information to obtain a human body contour image through a Canny algorithm; A feature extraction module for extracting the shape features and texture features of the human body contour image, fusing the basic parameters, shape features and texture features of the measured person to determine a multi-dimensional feature vector of the measured person; A model deployment module for collecting historical population sample information to construct a historical data set and obtain sample labels, inputting the historical data set into a fusion model based on gradient boosting tree and full connection neural network for training, and constructing a body fat rate estimation model; Further used for deploying the body fat rate estimation model, the deployment mode is to convert the trained body fat rate estimation model into an ONNX format, support running on a terminal device, without relying on cloud computing, and realizing real-time estimation of body fat rate; A result display module for inputting the multi-dimensional feature vector of the measured person into the trained body fat rate estimation model and outputting a body fat rate estimation value.

Citation Information

Patent Citations

  • Method of identifying a body fat percentage by photographing body and photographing terminal

    CN106227989A

  • Deep learning fat muscle segmentation method and system based on Slicer

    CN120259354A

  • Method for determining a subject's degree of adiposity

    US7599537B1