Human body posture recognition method based on computer vision

Through the lightweight graph convolution sitting posture comparison recognition network LGCSPNet, the existing model has solved the problems of high computational complexity and high hardware cost, and achieved efficient and accurate human posture recognition on edge devices.

CN120452064APending Publication Date: 2025-08-08JILIN UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510547416.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the field of human posture recognition, existing deep learning models have problems such as high computational complexity, high hardware cost, and insufficient cross-region bone correlation modeling capabilities, making it difficult to deploy efficiently on edge devices.

Method used

The lightweight graph convolution sitting posture comparison recognition network LGCSPNet is adopted to directly model human joint association through the lightweight graph convolution module and the contrast learning module, and use non-local shift map operation and adaptive graph structure learning to enhance the distal limb association capture ability, and build an instance-level graph structure repository to optimize the cross-sample feature space.

Benefits of technology

It realizes efficient inference at extremely low parameters, significantly lowers the threshold for edge equipment deployment, and improves the accuracy and efficiency of posture recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120452064A_ABST
    Figure CN120452064A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of posture recognition, and discloses a human body posture recognition method based on computer vision, which comprises the following steps: acquiring posture video data of a recognized person to obtain image data; key point detection is carried out on the image data to obtain two-dimensional key point coordinates, normalization processing is carried out to obtain a data set, attitude mapping labels are established, different attitude categories are systematically mapped into unique corresponding digital identifiers, and the two-dimensional key point coordinates are converted into a floating point type numerical matrix; adding an attitude mapping label to the floating point type numerical matrix to construct an npz format data file; constructing a lightweight graph convolution sitting posture comparison and recognition initial model, and training and testing to obtain an LGCSPNet operation model; and adopting an LGCSPNet operation model to recognize a human body posture. According to the method provided by the invention, high-efficiency reasoning can be realized while extremely low parameter quantity is maintained, the deployment threshold of edge equipment is remarkably reduced, and a lightweight solution is provided for accurate posture recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of posture recognition, and in particular to a human posture recognition method based on computer vision. Background Art

[0002] Human posture recognition technology aims to serve multiple fields such as medical monitoring, sports science, intelligent interaction, and security monitoring by accurately classifying human movement patterns.

[0003] Current mainstream technology approaches can be categorized into two types: sensor acquisition and visual analysis. The former uses external pressure sensors or smart wearable devices to acquire motion data, which is then processed by algorithms to determine movement. However, this approach is limited by high hardware costs and the high level of device attachment, which increases the economic burden and may also affect the user experience. The latter relies on a visual perception system to capture dynamic images of the human body and combines it with deep neural networks for feature analysis. This contactless solution significantly reduces implementation barriers and user resistance, and is gradually becoming the preferred option in everyday scenarios.

[0004] Current mainstream deep learning models, such as convolutional neural networks and visual transformers, still face multiple technical bottlenecks in the field of human posture recognition. Both types of models rely on global structural modeling of human skeletal features. This full-space processing mode not only incurs significant computational overhead but also becomes a key constraint on lightweight deployment: Traditional CNNs are limited by the local receptive field characteristics of convolution kernels, and their ability to model cross-regional skeletal associations is significantly flawed, making it difficult to effectively capture the coordinated movements of distal limb joints. While visual transformers achieve global dependency modeling through a self-attention mechanism, their computational complexity severely restricts their application space in edge devices. Existing research has mostly focused on extracting internal features from samples and has failed to fully utilize cross-class correlation information, which to some extent limits the improvement of the model's discriminative ability.

[0005] In order to solve these problems, a human posture recognition method based on computer vision is urgently needed to improve the model's discrimination ability. Summary of the Invention

[0006] To solve the above problems, this application proposes a human posture recognition method based on computer vision, which includes the following steps:

[0007] Step A: obtaining the posture video data of the person to be identified, performing frame interception processing on the posture video data of the person to be identified, and obtaining image data;

[0008] Step B: Use the key point detection algorithm OpenPose to detect key points on the image data and obtain the two-dimensional key point coordinates;

[0009] Step C: normalize the two-dimensional key point coordinates to obtain a data set, and divide the data set into a training set, a validation set, and a test set;

[0010] Establish posture mapping labels to systematically map different posture categories to unique corresponding digital identifiers;

[0011] Convert the two-dimensional key point coordinates into a floating-point numerical matrix;

[0012] Add the posture mapping label to the floating-point numerical matrix to construct the npz format data file;

[0013] Step D: Build a lightweight graph convolution sitting posture comparison recognition model LGCSPNet initial model, and train the LGCSPNet initial model using the training set and validation set to obtain the LGCSPNet training model;

[0014] Step E: Use the test set to test the training model to obtain the LGCSPNet running model;

[0015] Step F: Use the LGCSPNet running model to recognize human posture.

[0016] Preferably, in step A, a monocular RGB camera is used to capture the posture of the person being identified to obtain the posture video data of the person being identified;

[0017] The video acquisition process of the monocular red, green and blue three-channel RGB camera is performed under preset lighting conditions, the video frame rate is set to 25-60fps, and the image is saved every predetermined frame to obtain image data;

[0018] The image data size is adjusted to 224pix×224pix, the original ratio of the image data is maintained, and the empty parts are filled with black.

[0019] Preferably, in step B, the OpenPose uses a multi-stage convolutional neural network to infer the image data and predicts the coordinates of key points of the human body in the image from bottom to top using a heat map.

[0020] Preferably, in step C, the normalization process is to convert the predicted coordinates of the key points of the human body from absolute pixel values to proportional values relative to the image size;

[0021] According to different categories, the key point coordinate information is converted into a five-dimensional tensor in the form of [N, C, T, V, M], where N represents the batch size, C represents the number of channels, T represents the time dimension, V represents the number of key points, and M represents the number of people;

[0022] After attaching different categories of posture mapping labels, a data file in npz format is formed for data input of subsequent models.

[0023] Preferably, in step D, the LGCSPNet model mainly includes a lightweight graph convolution LGC module for input key point feature extraction and a contrastive learning module for constructing positive and negative sample pairs and calculating contrast loss;

[0024] The lightweight graph convolution LGC module is used to receive a five-dimensional tensor and perform normalization processing;

[0025] The five-dimensional tensor passes through three lightweight graph convolution LGC modules with channel numbers of 64, 128 and 256 respectively;

[0026] The lightweight graph convolution LGC module includes a 1×1 convolution unit, two non-local shiftgraph operation units, and a parameter-free attention SimAM unit:

[0027] After the five-dimensional tensor passes through the three-layer LGC module, it outputs the raw score logits of posture recognition through the global pooling layer and the fully connected layer. Then, the classification cross entropy loss is calculated based on these raw score logits and the true posture label;

[0028] The contrastive learning module is used to guide the optimization of model parameters during the training process. After the current batch of five-dimensional tensor data is input into the model, tensor data of the graph structure G corresponding to the current batch of data will be obtained after the third layer of the LGC module, where G is composed of unique graph structure data g corresponding to each sample of the current batch of data. G undergoes feature transformation through the linear transformation layer and is normalized by the L2 norm. The normalized features corresponding to the current batch of input data are stored in the sample library and the corresponding flag bits are updated. Subsequently, the cosine similarity matrix of the current batch of input data and all existing data in the sample library is calculated;

[0029] The positive sample mask and negative sample mask are generated based on whether the posture mapping label information of the current batch of input data is consistent with the posture mapping labels of all existing data in the sample library.

[0030] Preferably, in the LGC module, the input five-dimensional tensor first undergoes a 1×1 convolution unit to perform a 1×1 convolution to perform feature transformation, and then undergoes a non-local graph shift unit to perform a cyclic shift operation in both the forward and backward directions, and the shifted features are subjected to matrix multiplication to generate a graph structure G;

[0031] The graph structure G is normalized by the normalized exponential function SoftMax;

[0032] The normalized graph structure G is matrix multiplied with the five-dimensional tensor data, and then the feature transformation is performed through the 1×1 convolution unit to obtain the intermediate result Z tensor;

[0033] The intermediate result Z tensor is enhanced with feature representation through the parameterless attention SimAM attention module. After batch normalization, it is added element-by-element with the five-dimensional tensor data. Finally, the linear rectification function ReLU activation function is used to obtain the four-dimensional tensor Z with a shape of (N, C, T, V). Finally, the LGC module returns the tensor Z and the graph structure G.

[0034] Preferably, for valid samples, sort by similarity, select 128 samples with a lower proportion from the positive samples, select 512 samples with a higher proportion from the negative samples as difficult samples, and then randomly select 512 negative samples as random samples;

[0035] Pair the positive samples with the difficult negative samples and the random negative samples to form the first sample pair and the second sample pair;

[0036] Merge the first sample pair and the second sample pair, use the cross entropy loss function to calculate the contrast loss, and the temperature parameter T is used to adjust the contrast;

[0037] The contrast loss is added to the classification cross entropy loss calculated after the output of the three-layer LGC module to form a combined loss to guide the optimization of the lightweight graph convolution sitting posture contrast recognition model LGCSPNet.

[0038] Preferably, in the process of training the LGCSPNet initial model using the training set and the validation set, a contrastive learning loss function combined with a cross entropy loss function, an SGD optimizer, a learning rate set to 0.44, and a batch size of 256 are used.

[0039] Preferably, when testing the trained model using the test set, seven sitting posture categories are predicted to determine whether they are correct sitting postures - to determine the accuracy of the LGCSPNet training model.

[0040] In summary, the present invention presents a computer vision-based human posture recognition method. Compared to traditional technologies, the present invention proposes a lightweight graph convolutional comparative sitting posture recognition network, LGCSPNet. This network overcomes the limitations of traditional models through a dual-module collaborative mechanism: the network's core lightweight graph convolutional module, LGC, abandons traditional convolution and global attention mechanisms and directly models human joint associations based on a skeleton graph. It uses non-local shift graph operations and adaptive graph structure learning to overcome the limitations of predefined skeleton connections, significantly enhancing the ability to capture distal limb associations. The innovative introduction of a parameter-free attention mechanism strengthens the weights of key regional features without increasing the computational burden. The comparative learning module constructs an instance-level graph structure repository and, through a cross-sample feature space optimization strategy, strengthens the aggregation of similar posture features and expands the differences between different categories of features. The proposed network achieves efficient inference while maintaining an extremely low parameter count, significantly reducing the deployment threshold for edge devices and providing a lightweight solution for accurate posture recognition.

[0041] The technical method of the present invention is further described in detail below through the accompanying drawings and examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flowchart of a method for human posture recognition based on computer vision provided by an embodiment of the present invention;

[0043] Figure 2 A structural diagram of the LGCSPNet model provided in an embodiment of the present invention;

[0044] Figure 3 This is a structural diagram of the LGC module and comparative learning module provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The technical method of the present invention is further described below through the accompanying drawings and embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and values described in these embodiments do not limit the scope of this application.

[0046] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0047] Technologies, systems, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, they should be considered part of the specification.

[0048] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0049] Unless otherwise defined, technical or scientific terms used in the present invention shall have the same meaning as commonly understood by one of ordinary skill in the art to which the present invention belongs.

[0050] The present invention provides a method for human posture recognition based on computer vision, comprising the following steps:

[0051] Step A: Acquire the posture video data of the person to be identified, perform frame interception processing on the posture video data of the person to be identified, and obtain image data.

[0052] A monocular RGB camera is used to capture video data of the person's posture under preset lighting conditions. The video frame rate is set to 25-60fps. The collected video data is frame-cropped, and an image is saved every few frames. The obtained image data is normalized to a uniform size of 224pix×224pix, maintaining the original image ratio, and the empty parts are filled with black.

[0053] Step B: Use the key point detection algorithm OpenPose to detect key points on the image data and obtain the two-dimensional key point coordinates.

[0054] The collected image data is used to perform pose estimation using OpenPose's multi-stage convolutional neural network, and the coordinate information of the key points of the human body in the image is predicted from the bottom up using a heat map.

[0055] Step C: Normalize the two-dimensional key point coordinates to obtain a data set, and divide the data set into a training set, a validation set, and a test set.

[0056] Establish posture mapping labels to systematically map different posture categories into unique corresponding digital identifiers.

[0057] The normalization process is to convert the predicted coordinates of the key points of the human body from absolute pixel values to proportional values relative to the image size.

[0058] According to different categories, the key point coordinate information is converted into a five-dimensional tensor in the form of [N, C, T, V, M], where N represents the batch size, C represents the number of channels, T represents the time dimension, V represents the number of key points, and M represents the number of people.

[0059] After attaching different categories of posture mapping labels, a data file in npz format is formed for data input of subsequent models.

[0060] Convert the two-dimensional keypoint coordinates to a floating-point matrix.

[0061] Build an npz format data file by appending the pose mapping label to the floating-point numerical matrix.

[0062] Step D: Build a lightweight graph convolution sitting posture comparison recognition model LGCSPNet initial model, use the training set and validation set to train the LGCSPNet initial model, and obtain the LGCSPNet training model.

[0063] The LGCSPNet model mainly includes a lightweight graph convolution LGC module for input key point feature extraction and a contrastive learning module for constructing positive and negative sample pairs and calculating contrast loss.

[0064] The lightweight graph convolution LGC module is used to receive a five-dimensional tensor and perform normalization processing.

[0065] The five-dimensional tensor passes through three lightweight graph convolution LGC modules with channel numbers of 64, 128 and 256 respectively.

[0066] The lightweight graph convolution LGC module includes a 1×1 convolution unit, two non-local shiftgraph operation units, and a parameter-free attention SimAM unit:

[0067] After the five-dimensional tensor passes through the three-layer LGC module, it outputs the raw score logits of posture recognition through the global pooling layer and the fully connected layer, and then the classification cross entropy loss is calculated based on these raw score logits and the true posture label.

[0068] The contrastive learning module is used to guide the optimization of model parameters during the training process. After the current batch of five-dimensional tensor data is input into the model, tensor data of the graph structure G corresponding to the current batch of data will be obtained after the third-layer LGC module, where G is composed of unique graph structure data g corresponding to each sample of the current batch of data. G undergoes feature transformation through the linear transformation layer and is normalized by the L2 norm. The normalized features corresponding to the current batch of input data are stored in the sample library and the corresponding flag bits are updated. Subsequently, the cosine similarity matrix of the current batch of input data and all existing data in the sample library is calculated.

[0069] The positive sample mask and negative sample mask are generated based on whether the posture mapping label information of the current batch of input data is consistent with the posture mapping labels of all existing data in the sample library.

[0070] The positive and negative sample masks are used to distinguish between the same and different classes of input samples and all samples in the sample library. Specifically, the pose mapping label information corresponding to the current batch of input data is broadcast and compared with the label information of all existing data in the sample library, resulting in a Boolean matrix tensor. In each position, True indicates that the current sample label is the same as the sample label at the corresponding position in the memory library, and False indicates that the current sample label is different from the sample label at the corresponding position in the memory library. This Boolean matrix tensor is then converted to a floating-point matrix composed of 0s and 1s. This floating-point matrix is subtracted from 1 to obtain the corresponding complement of the Boolean matrix tensor.

[0071] Then, the sample library flag is defined to mark whether each position in the sample library has been filled with valid sample data, and the sample library flag is used to multiply the Boolean matrix tensor obtained above and its complement to obtain the positive sample mask and the negative sample mask.

[0072] In the LGC module, the input five-dimensional tensor first undergoes 1×1 convolution to perform feature transformation, and then passes through the non-local shift unit to implement cyclic shift operations in both forward and backward directions. The shifted features are subjected to matrix multiplication to generate the graph structure G.

[0073] The graph structure G is normalized by the normalized exponential function SoftMax.

[0074] The normalized graph structure G is matrix multiplied with the five-dimensional tensor data, and then the feature transformation is performed through a 1×1 convolution unit to obtain the intermediate result Z tensor.

[0075] The intermediate result Z tensor is enhanced with feature representation through the parameterless attention SimAM attention module. After batch normalization, it is added element-by-element with the five-dimensional tensor data. Finally, the linear rectification function ReLU activation function is used to obtain the four-dimensional tensor Z with a shape of (N, C, T, V). Finally, the LGC module returns the tensor Z and the graph structure G.

[0076] For valid samples, they are sorted by similarity, 128 samples with a lower proportion are taken from the positive samples, and 512 samples with a higher proportion are taken from the negative samples as difficult samples, and then 512 negative samples are randomly selected as random samples.

[0077] The positive samples are paired with the difficult negative samples and the random negative samples to form the first sample pair and the second sample pair.

[0078] The first sample pair and the second sample pair are merged, and the contrast loss is calculated using the cross entropy loss function. The temperature parameter T is used to adjust the contrast.

[0079] The contrast loss is added to the classification cross entropy loss calculated after the output of the three-layer LGC module to form a combined loss to guide the optimization of the lightweight graph convolution sitting posture contrast recognition model LGCSPNet.

[0080] Specifically, a deep learning-based LGCSPNet model is constructed for gesture recognition. The input data of shape [256, 2, 1, 18, 1] is reshaped to [256, 36, 1] and normalized in the second dimension through the BatchNormalization operation. The data passes through three LGC modules with 64, 128, and 256 channels respectively. Inside the LGC module: the input data first undergoes feature transformation through a 1×1 convolution with a stride of 1, bias enabled, and no padding. It then passes through two non-local shift graph operation modules to implement cyclic shift operations in both the forward and backward directions. The specific shift formula is: The shifted features are matrix multiplied to generate a unique graph structure G. The graph structure G is normalized by the SoftMax function, and the processed graph structure is matrix multiplied with the input features. Then, the feature is transformed by 1×1 convolution. The feature representation is enhanced by the SimAM attention module. The SimAM module is a carefully designed parameter-free attention module that can calculate an attention map reflecting different weights for different body parts, enabling the model to adaptively focus on the most critical areas for posture recognition. The minimum energy of SimAM can be calculated as:

[0081]

[0082] Where t represents the target neuron, and Represents the mean and variance of the neurons in the same channel when they are identically distributed. The weight of the target neuron is: λ represents the regularization coefficient. The data then undergoes BatchNormalization and is element-wise added to the input data via skip connections. Finally, the output of the LGC module is obtained through the ReLU activation function. The graph structure G output by the last layer of the LGC module is fed into the contrastive learning module. In this module, the graph structure G is transformed from 18×18 dimensions to 256 dimensions through a linear transformation layer and normalized using the L2 norm. The normalized features are stored in the sample library and the corresponding flags are updated. The cosine similarity matrix between the current batch data and all data in the sample library is calculated. Positive and negative sample masks are generated based on the label information, and valid samples are filtered using the sample library flags. For each sample, the lowest similarity positive sample and the highest similarity negative sample are selected. A random subset of negative samples are then selected and paired with the hard negative sample and the random negative sample, forming two types of sample pairs. All batches of sample pairs are merged, and the contrastive loss is calculated using the cross-entropy loss function. The temperature parameter T is used to adjust the contrast. After passing through the three-layer LGC module, the features are globally average pooled and passed through the fully connected layer to achieve posture classification. The contrast loss is added to the classification cross entropy loss to form a combined loss to guide model optimization.

[0083] Step E: Use the test set to test the training model to obtain the LGCSPNet running model.

[0084] LGCSPNet is trained using the training set, using the contrastive learning loss function combined with the cross entropy loss function, the SGD optimizer, the learning rate is set to 0.44, and the batch size is 256.

[0085] Step F: Use the LGCSPNet running model to recognize human posture.

[0086] Use the test set obtained in step C to test the training model generated in step E, predict the seven sitting posture categories, and determine whether it is the correct sitting posture.

[0087] The specific implementation of the present invention is described in detail below with reference to specific embodiments.

[0088] like Figure 1 FIG. 1 is a flow chart of a method for human posture recognition based on computer vision provided by an embodiment of the present invention, which specifically includes the following steps:

[0089] (1) Data collection and construction: A monocular RGB camera is used to shoot a video of the posture of the person being identified under preset lighting conditions. The video frame rate is set to 25-60fps. The collected video data is frame-cropped and an image is saved every few fixed frames. The obtained image data is normalized to a uniform size and adjusted to 224pix×224pix, maintaining the original image ratio, and the blank parts are filled with black. The collected image data is used for posture estimation using the multi-stage convolutional neural network of OpenPose. The coordinate information of the key points of the human body in the image is predicted from the bottom up using the heat map method, and the two-dimensional key point data is collected. The collected key point data is normalized and the data set is divided into three parts, namely the training set, the validation set and the test set. The posture mapping label is established, and the original two-dimensional key point coordinates are converted into a floating-point numerical matrix and the label information is added to construct the npz format data file. The normalization process converts the predicted coordinates of the key points of the human body from absolute pixel values to proportional values relative to the image size; the obtained key point data is further divided into training set, validation set and test set according to the proportion, and the key point coordinate information is converted into a five-dimensional tensor in the form of [N, C, T, V, M] according to different categories, where N represents the batch size, C represents the number of channels, T represents the time dimension, V represents the number of key points, and M represents the number of people; after adding posture mapping labels of different categories, a data file in npz format is formed for data input of subsequent models.

[0090] (2) Network construction: Use pytorch to build the LGCSPNet model. The input of the model is key point data. The input data first passes through the LGC module for feature extraction, combines contrastive learning to optimize parameter learning, and then combines the fully connected layer to output the final classification result.

[0091] (3) Network training: Use the training set obtained in (1) to train LGCSPNet, set the initial learning rate to 0.44, the batch size to 256, the loss function to the cross entropy loss function, select the SGD optimizer, set the training epoch to 50, and configure the learning rate decay strategy so that the learning rate decreases with the change of training rounds (epoch). Specifically, it decays to 0.1 of the initial learning rate at the 35th round. After each round of training, perform a validation set test and save the weight with the best performance on the validation set.

[0092] (4) Network testing: Predict the sitting posture category on the test set, load the best weights saved in the training phase, input the test data into the trained model, obtain the test results, including the confidence of the sitting posture category, and calculate the category of the human sitting posture predicted by the model based on the confidence given by the model.

[0093] Comparison of model parameters and test accuracy performance:

[0094] The current mainstream deep learning models and the method of the embodiments of the present invention were trained on the collected data sets. The results showed that the method of the embodiments of the present invention achieved an accuracy of 99.06% while keeping the model parameter size at only 0.097M. The ViT-B / 16 model had an accuracy of only 95.29% with a parameter size of 85.804M, the VGG16 model had an accuracy of only 96.7% with a parameter size of 138.36M, and the ST-GCN model had an accuracy of only 95.50% with a parameter size of 3.08. This proves that the method of the embodiments of the present invention can very effectively identify different types of posture categories while maintaining extremely low parameters.

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical method of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical method to deviate from the spirit and scope of the technical method of the present invention.

Claims

1. A human posture recognition method based on computer vision, characterized in that: The following steps are involved: Step A: obtaining the posture video data of the person to be identified, performing frame interception processing on the posture video data of the person to be identified, and obtaining image data; Step B: Use the key point detection algorithm OpenPose to detect key points on the image data and obtain the two-dimensional key point coordinates; Step C: normalize the two-dimensional key point coordinates to obtain a data set, and divide the data set into a training set, a validation set, and a test set; Establish posture mapping labels to systematically map different posture categories to unique corresponding digital identifiers; Convert the two-dimensional key point coordinates into a floating-point numerical matrix; Add the posture mapping label to the floating-point numerical matrix to construct the npz format data file; Step D: Build a lightweight graph convolution sitting posture comparison recognition model LGCSPNet initial model, and train the LGCSPNet initial model using the training set and validation set to obtain the LGCSPNet training model; Step E: Use the test set to test the training model to obtain the LGCSPNet running model; Step F: Use the LGCSPNet running model to recognize human posture.

2. The method for human posture recognition based on computer vision according to claim 1, characterized in that: In step A, a monocular RGB camera is used to capture the posture of the person being identified to obtain the posture video data of the person being identified; The video acquisition process of the monocular red, green and blue three-channel RGB camera is performed under preset lighting conditions, the video frame rate is set to 25-60fps, and the image is saved every predetermined frame to obtain image data; The image data size is adjusted to 224pix×224pix, the original ratio of the image data is maintained, and the empty parts are filled with black.

3. The method for human posture recognition based on computer vision according to claim 2, characterized in that: In step B, the OpenPose uses a multi-stage convolutional neural network to infer the image data and predicts the coordinates of key points of the human body in the image from bottom to top using a heat map.

4. The method for human posture recognition based on computer vision according to claim 3, characterized in that: In step C, the normalization process is to convert the predicted coordinates of the key points of the human body from absolute pixel values to proportional values relative to the image size; According to different categories, the key point coordinate information is converted into a five-dimensional tensor in the form of [N, C, T, V, M], where N represents the batch size, C represents the number of channels, T represents the time dimension, V represents the number of key points, and M represents the number of people; After attaching different categories of posture mapping labels, a data file in npz format is formed for data input of subsequent models.

5. The method for human posture recognition based on computer vision according to claim 4, characterized in that: In step D, the LGCSPNet model mainly includes a lightweight graph convolution LGC module for input key point feature extraction and a contrastive learning module for constructing positive and negative sample pairs and calculating contrast loss; The lightweight graph convolution LGC module is used to receive a five-dimensional tensor and perform normalization processing; The five-dimensional tensor passes through three lightweight graph convolution LGC modules with channel numbers of 64, 128 and 256 respectively; The lightweight graph convolution LGC module includes a 1×1 convolution unit, two non-local shiftgraph operation units, and a parameter-free attention SimAM unit: After the five-dimensional tensor passes through the three-layer LGC module, it outputs the raw score logits of posture recognition through the global pooling layer and the fully connected layer. Then, the classification cross entropy loss is calculated based on these raw score logits and the true posture label; The contrastive learning module is used to guide the optimization of model parameters during the training process. After the current batch of five-dimensional tensor data is input into the model, tensor data of the graph structure G corresponding to the current batch of data will be obtained after the third layer of the LGC module, where G is composed of unique graph structure data g corresponding to each sample of the current batch of data. G undergoes feature transformation through the linear transformation layer and is normalized by the L2 norm. The normalized features corresponding to the current batch of input data are stored in the sample library and the corresponding flag bits are updated. Subsequently, the cosine similarity matrix of the current batch of input data and the data in the sample library is calculated; The positive sample mask and negative sample mask are generated based on whether the posture mapping label information of the current batch input data is consistent with the posture mapping label of the data in the sample library.

6. The method for human posture recognition based on computer vision according to claim 5, characterized in that: In the LGC module, the input five-dimensional tensor first undergoes 1×1 convolution to perform feature transformation, and then passes through the non-local image shift unit to implement cyclic shift operations in both forward and backward directions. The shifted features are matrix multiplied to generate the graph structure G. The graph structure G is normalized by the normalized exponential function SoftMax; The normalized graph structure G is matrix multiplied with the five-dimensional tensor data, and then the feature transformation is performed through the 1×1 convolution unit to obtain the intermediate result Z tensor; The intermediate result Z tensor is enhanced with feature representation through the parameterless attention SimAM attention module. After batch normalization, it is added element-by-element with the five-dimensional tensor data. Finally, the linear rectification function ReLU activation function is used to obtain the four-dimensional tensor Z with a shape of (N, C, T, V). Finally, the LGC module returns the tensor Z and the graph structure G.

7. The method for human posture recognition based on computer vision according to claim 5, characterized in that: For valid samples, sort them by similarity, select 128 samples with a lower proportion from the positive samples, and select 512 samples with a higher proportion from the negative samples as difficult samples, and then randomly select 512 negative samples as random samples; Pair the positive samples with the difficult negative samples and the random negative samples to form the first sample pair and the second sample pair; Merge the first sample pair and the second sample pair, use the cross entropy loss function to calculate the contrast loss, and the temperature parameter T is used to adjust the contrast; The contrast loss is added to the classification cross entropy loss calculated after the output of the three-layer LGC module to form a combined loss to guide the optimization of the lightweight graph convolution sitting posture contrast recognition model LGCSPNet.

8. The method for human posture recognition based on computer vision according to claim 1, characterized in that: During the training process of the LGCSPNet initial model using the training set and validation set, the contrastive learning loss function combined with the cross entropy loss function, the SGD optimizer, the learning rate was set to 0.44, and the batch size was 256.

9. The method for human posture recognition based on computer vision according to claim 1, characterized in that: When testing the trained model using the test set, the accuracy of the LGCSPNet trained model is determined by predicting seven sitting posture categories and judging whether they are correct sitting postures.

Citation Information

Cited By

  • Bed human body posture recognition method based on multi-level label collaborative perception

    CN121580144A