Human behavior recognition method based on machine learning

By constructing an LSTM network model optimized by crayfish optimization algorithm, combining inverse distance weighting and global feature representation, the problem of low accuracy of human behavior recognition is solved, and more efficient and accurate behavior recognition is achieved.

CN120164260BActive Publication Date: 2025-08-29LUSHAN COLLEGE OF GUANGXI UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510329360.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-08-29
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

In the prior art, the accuracy of human behavior recognition is low.

Method used

The LSTM network model optimized based on the crayfish optimization algorithm is adopted, combined with inverse distance weighting and global feature representation, and the video frame is preprocessed and the LSTM network model is constructed for training, which improves the accuracy of behavior recognition.

Benefits of technology

It improves the accuracy and reliability of human behavior recognition, enhances the robustness and computing efficiency of the model, and can more comprehensively reflect the behavioral information in the video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164260B_ABST
    Figure CN120164260B_ABST
Patent Text Reader

Abstract

The present invention provides a human behavior recognition method based on machine learning, which relates to the technical field of human behavior recognition. The method comprises: obtaining target video data, collecting video data containing different human behaviors and corresponding behavior categories as historical data; preprocessing the target video data and the historical data respectively to obtain target data and training data; constructing an LSTM network model optimized based on a crayfish optimization algorithm, inputting the training data for training, and obtaining an optimal behavior recognition model; and inputting the target data into the optimal recognition model to obtain the behavior categories. The present invention constructs an LSTM network model optimized based on a crayfish optimization algorithm, inputs the training data for training, obtains an optimal recognition model, performs feature extraction on the target video data, and obtains a global feature representation through an inverse weighting method, comprehensively reflecting the behavior information in the video, thereby improving the accuracy and reliability of the optimal behavior recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Human behavior recognition refers to the process of automatically detecting, analyzing, and understanding human motion, posture, and behavior patterns in video images or sensor data using technologies such as computer vision, image processing, pattern recognition, and artificial intelligence. Its basic principle is to analyze and extract characteristics of human motion, posture, and behavior, and then use mathematical models and machine learning algorithms for pattern matching and classification. Human behavior recognition technology can detect and alert suspicious behavior. Surveillance cameras can analyze human behavior, identify unusual patterns such as theft and harassment, and promptly issue alerts, thereby improving public safety. Human behavior recognition enables touchless human-computer interaction, providing a more natural and intelligent interactive experience. Gesture recognition enables gesture control of devices such as televisions and smart home devices. Human behavior recognition technology can monitor the health of special populations such as the elderly and children. By analyzing human posture and movement trajectories, it can determine whether an elderly person has fallen, providing timely warnings and rescue efforts. Human behavior recognition can also manage personal identity and behavior. With the continuous advancement of artificial intelligence and big data technologies, human behavior recognition methods will have even greater potential for development.

[0003] However, in actual application, due to the influence of many factors, the accuracy of human behavior recognition is low. Summary of the Invention

[0004] The present invention provides a human behavior recognition method based on machine learning to solve the defect of inaccurate behavior recognition in the prior art.

[0005] In one aspect, the present invention provides a human behavior recognition method based on machine learning, comprising:

[0006] S1: Obtain target video data, collect video data containing different human behaviors and corresponding behavior categories as historical data.

[0007] S2: Preprocess the target video data and the historical data respectively to obtain target data and training data.

[0008] S3: Construct an LSTM network model based on the crayfish optimization algorithm, and input the training data for training to obtain the optimal behavior recognition model.

[0009] S4: Input the target data into the optimal recognition model to obtain the behavior category.

[0010] According to a human behavior recognition method based on machine learning provided by the present invention, in step S2, the preprocessing specific steps include:

[0011] S21: extracting video frames from the video data at preset time intervals, processing the video frames to obtain enhanced video frames, and using a convolutional neural network to extract features from the enhanced video frames to obtain a feature sequence.

[0012] S22: performing normalization and smoothing processing on the feature sequence to obtain an enhanced feature sequence.

[0013] S23: Calculate the distance between the enhanced feature sequences, and use an inverse distance weighting method according to the distance to obtain a weighted feature.

[0014] S24: Summarize the weighted features by an average aggregation method to obtain a global feature representation.

[0015] According to a human behavior recognition method based on machine learning provided by the present invention, in step S21, the specific steps of processing the video frame include:

[0016] S211: Enhance the video frame using a tone transformation method.

[0017] S212: Use Gaussian blur to perform noise filtering on the video frame.

[0018] According to a human behavior recognition method based on machine learning provided by the present invention, in step S22, the smoothing process specifically includes:

[0019] S221: Remove outliers in the feature sequence, and supplement missing values ​​in the feature sequence through interpolation.

[0020] S222: Smoothing the feature sequence using a moving average method.

[0021] According to a human behavior recognition method based on machine learning provided by the present invention, in step S23, the expression formula of inverse distance weighting is:

[0022]

[0023] in, is the value of the unknown point x to be estimated, It is The data value of the known point, The unknown point x and the The distance between known points, is the exponential of the weight.

[0024] According to a human behavior recognition method based on machine learning provided by the present invention, in step S3, the specific steps of constructing an LSTM network model include:

[0025] S31: Setting a network architecture including an input layer, an LSTM layer, and an output layer. The input layer is configured to receive the target data. The LSTM layer is configured to capture the temporal dependencies of the target data and identify dynamic changes in behavior. The output layer is configured to convert the output of the LSTM layer into a specific behavior category.

[0026] S32: Two Dropout layers are provided in the network architecture. The two Dropout layers are provided between the input layer and the LSTM layer, and between the LSTM layer and the output layer, respectively. The two Dropout layers are used to prevent overfitting of the model.

[0027] According to a human behavior recognition method based on machine learning provided by the present invention, in step S3, the specific steps of optimizing the crayfish optimization algorithm include:

[0028] S33: Use mean square error as the fitness function of the LSTM network model.

[0029] S34: Initialize the population and randomly generate individual crayfish positions. Each crayfish individual represents an LSTM network model hyperparameter group.

[0030] S35: Calculate the individual fitness values ​​of the initialized population and randomly generate the ambient temperature value.

[0031] S36: An iterative mechanism is set. Each time a new population is formed, an ambient temperature is randomly selected, and population one or population two is obtained according to the iterative mechanism.

[0032] S37: Calculate the fitness value of each individual in the population one or the population two. If the output fitness value is higher than the preset fitness threshold, output the optimal hyperparameter. Otherwise, continue to iterate until the fitness value is higher than the preset fitness threshold or the maximum number of iterations is reached to obtain the optimal hyperparameter.

[0033] According to a human behavior recognition method based on machine learning provided by the present invention, in step S3, in step S36, the iterative mechanism specifically includes:

[0034] S361: When the ambient temperature is higher than the preset ambient temperature threshold, the individuals in the population find the location of the summer cave based on the current global optimal position and the individual historical optimal position.

[0035] S362: Individuals of the population move to the location of the summer cave. If the locations of the individuals are the same, by comparing the individual fitness values, the individual with low fitness will randomly select the location of another crayfish to adjust its position to compete for the summer cave. When the positions of all individuals are updated, population one is obtained.

[0036] S363: When the ambient temperature is lower than or equal to the preset ambient temperature threshold, the optimal position of the individual in the current population is used as the food position.

[0037] S364: Determine the size of the food according to the individual fitness values ​​of the current population, and select a foraging method according to the determination result to obtain population two.

[0038] According to a human behavior recognition method based on machine learning provided by the present invention, in step S361, the summer cave location expression formula is:

[0039]

[0040] in, The location of the cave. is the individual's best historical position, is the previous global optimal position.

[0041] According to a human behavior recognition method based on machine learning provided by the present invention, in step S364, the expression formula for determining the size of food is:

[0042]

[0043] in, It is the identification value of food size. is the food factor, which is a constant, is a random number, between, The current individual's fitness value, The fitness value of food, when When , the food is judged to be larger, , the food is judged to be small.

[0044] The present invention provides a human behavior recognition method based on machine learning. The present invention obtains an optimal behavior recognition model by constructing an LSTM network model optimized based on a crayfish optimization algorithm and inputting training data for training. Feature extraction is performed on target video data, and a global feature representation is obtained by inverse weighting to obtain target data. The target data is input into the optimal behavior recognition model to obtain behavior categories, thereby solving the problem of inaccurate behavior recognition. The global feature representation can more comprehensively reflect the behavior information in the video, and improve the accuracy and reliability of the optimal behavior recognition model. The crayfish optimization algorithm increases the time required for LSTM network model training, improves overall computational efficiency, and robustness, thereby further improving recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 3 is a flow chart of a human behavior recognition method based on machine learning provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0048] See also Figure 1 The embodiment of the present invention provides a human behavior recognition method based on machine learning, which includes:

[0049] S1: Obtain target video data, collect video data containing different human behaviors and corresponding behavior categories as historical data.

[0050] In this embodiment, the video data collected for different human behaviors covers a wide range of content, primarily including common body movements. These common movements may include, but are not limited to, simple ones such as running, jumping, and waving. Furthermore, more complex body movements are also included, such as dancing, playing basketball, and swimming. Interactions between people and objects, such as making phone calls, eating, and opening doors, can also be considered. In practical applications, the collection of relevant body movement video data can be customized according to the needs of specific fields to ensure the professionalism and applicability of the data. For example, in the medical field, the focus can be on movements related to rehabilitation exercises. In the sports field, videos can be collected around behaviors related to specific sports. When collecting data on different human behaviors, ensuring the diversity of the video data is crucial. Diversity is not only reflected in the body movements themselves, but also includes different scene settings, lighting conditions, shooting angles, and backgrounds. Videos can be shot in both outdoor and indoor environments, and the lighting can include both natural and artificial light. Different backgrounds can increase the diversity of the dataset. The collected video data also needs to be annotated, ensuring that each video has one or more behavior category labels to facilitate subsequent model training and evaluation. This annotation can be done manually or using existing efficient annotation tools to improve efficiency.

[0051] S2: Preprocess the target video data and the historical data respectively to obtain target data and training data.

[0052] S21: extracting video frames from the video data at preset time intervals, processing the video frames to obtain enhanced video frames, and using a convolutional neural network to extract features from the enhanced video frames to obtain a feature sequence.

[0053] In this embodiment, a fixed extraction rate of 30 frames per second can be set to obtain a series of frame sequences from the entire video. For example, starting from the first second of the video, a frame can be extracted every 33 milliseconds to form a group of continuous frames in this way. The number of frames extracted per second can be adjusted according to the complexity of the video content and the analysis requirements. For example, for fast-moving videos, a higher FPS may be required to capture more details. For static or slowly changing videos, a lower FPS may be sufficient. The extracted frames are arranged in chronological order to form a group of continuous frame sequences. This group of frame sequences is processed and used for subsequent feature extraction steps. The multiplication neural network model will extract features from each frame image and generate corresponding feature vectors. These feature vectors contain key information in the image, such as edges, textures, object shapes, etc. The feature vectors of each frame are arranged in chronological order to obtain a feature sequence.

[0054] S211: Enhance the video frame using a tone transformation method.

[0055] In this embodiment, the contrast of the region of interest in the video frame can be enhanced by hue conversion, making it easier for the model to identify important features and improving the accuracy of subsequent model recognition.

[0056] S212: Use Gaussian blur to perform noise filtering on the video frame.

[0057] In this embodiment, it is easier to capture important image information during feature extraction, thereby enhancing the sensitivity of subsequent models to features.

[0058] S22: performing normalization and smoothing processing on the feature sequence to obtain an enhanced feature sequence.

[0059] In this embodiment, the normalized expression formula is:

[0060]

[0061] in, is the normalized eigenvalue, is the original eigenvalue, is the minimum value of the characteristic sequence, is the maximum value of the feature sequence.

[0062] Through smoothing, unnecessary differences between adjacent samples are reduced, thereby improving the separability between features of different classes and helping to improve the performance of the classification algorithm.

[0063] S221: Remove outliers in the feature sequence, and supplement missing values ​​in the feature sequence through interpolation.

[0064] In this example, outliers in the feature sequence arise from errors in the data collection process, measurement equipment failures, or inherent variability in the data. Outliers appear as extremely high or low values. To effectively identify and handle outliers, a threshold can be set to treat values ​​outside this range as outliers and handle them accordingly. However, the effectiveness of this approach depends on the appropriate choice of threshold, which typically needs to be determined based on the specific distribution and characteristics of the data. Another more statistical approach is to use the median absolute deviation (MAD) to detect outliers. MAD is a robust statistic that is not affected by extreme values ​​and therefore more accurately reflects the central tendency and dispersion of the data. By calculating the absolute deviation between each weighted eigenvalue and its median and comparing it with the MAD, outliers that significantly deviate from the normal range can be identified. In addition, a variety of other outlier detection techniques are available, such as boxplots, Z-scores, and density-based clustering. Each method has its own unique advantages and applicable scenarios. In practical applications, the most appropriate method should be selected based on the characteristics of the data and the requirements of the task. Once outliers are identified, a variety of strategies can be adopted to handle them.

[0065] S222: Smoothing the feature sequence using a moving average method.

[0066] S23: Calculate the distance between the enhanced feature sequences, and use an inverse distance weighting method according to the distance to obtain a weighted feature.

[0067] In this embodiment, the Euclidean distance can be used to calculate the distance between enhanced feature sequences. The Euclidean distance expression formula is:

[0068]

[0069] in, To represent the Euclidean distance between eigenvector A and eigenvector B, For vector A in the The values ​​in the dimensions, For vector B in the The values ​​in the dimensions.

[0070] Another weighting approach focuses on the similarity between feature vectors. Feature vectors with higher similarity are assigned greater weights. Similar feature vectors tend to carry more consistent or relevant information, and therefore should be given greater importance in analysis or model building. To achieve this goal, various similarity metrics can be used, with cosine similarity being a common choice. By converting the calculated cosine similarity values ​​into corresponding weights, the relative importance of feature vectors can be quantified. Manhattan distance is also an effective method for measuring the distance between feature vectors, particularly when dealing with high-dimensional data and sparse features. Manhattan distance evaluates the distance between two vectors by calculating the sum of the absolute differences across all dimensions. This calculation makes it more sensitive to sparse features and can capture subtle differences that might be overlooked using traditional Euclidean distance. In certain situations, Manhattan distance may more accurately reflect the actual relationship between feature vectors than Euclidean distance, providing a more appropriate basis for weighting.

[0071] In step S23, the inverse distance weighted expression formula is:

[0072]

[0073] in, is the value of the unknown point x to be estimated, It is The data value of the known point, The unknown point x and the The distance between known points, is the exponential of the weight.

[0074] In this embodiment, another inverse distance weighted expression formula may also be used:

[0075]

[0076] in, For the The weight of the feature vector, For the The distance between an eigenvector and its adjacent eigenvectors, is a very small constant used to prevent division by zero when calculating weights.

[0077] When the feature distance between two frames is small, it indicates a high degree of similarity in visual content, motion patterns, or semantic information. Such frames often represent consecutive parts of the same scene, action, or event, and are crucial for understanding the overall structure and content of the video. Therefore, by increasing the weight of these frame features, the video's feature representation can be more focused on continuous and consistent information, improving the accuracy and efficiency of video analysis or recognition.

[0078] On the contrary, when the feature distance between two frames is large, they may represent significant change points in the video, such as scene switching, the appearance or disappearance of objects, etc. However, when processing continuous changes in video content, these significant change points are usually not the main focus. Therefore, reducing the weight of these frame features can reduce noise and interference, making the feature representation smoother and more coherent. This weight distribution strategy not only helps to improve the accuracy of video content analysis, but also optimizes the use of computing resources. By focusing on frames that are adjacent in time and have similar content, unnecessary data processing and computing overhead can be reduced, improving the real-time performance and efficiency of video processing.

[0079] Furthermore, this strategy can be combined with other video processing techniques, such as motion estimation, object tracking, and event detection, to build a more comprehensive and powerful video analysis system. By comprehensively considering the temporal continuity between frames, content similarity, and feature weights, we can achieve more accurate and efficient video content understanding and analysis.

[0080] S24: Summarize the weighted features by an average aggregation method to obtain a global feature representation.

[0081] In this embodiment, the global feature representation is obtained by adding the continuous values ​​of all weighted features and averaging them. In this process, each weighted feature is considered equally and its values ​​are aggregated to form a comprehensive feature representation.

[0082] S3: Construct an LSTM network model based on the crayfish optimization algorithm, and input the training data for training to obtain the optimal behavior recognition model.

[0083] In this example, the crayfish optimization algorithm is a highly efficient search and optimization algorithm that can search and find the optimal parameter combination within a broad hyperparameter space, thereby improving the performance of the LSTM network model. Using this optimization algorithm can enhance the model's learning ability, training speed, and ultimate recognition performance, giving the model greater memory and accuracy when processing time series data.

[0084] In step S3, the specific steps of building the LSTM network model include:

[0085] S31: Setting a network architecture including an input layer, an LSTM layer, and an output layer. The input layer is configured to receive the target data. The LSTM layer is configured to capture the temporal dependencies of the target data and identify dynamic changes in behavior. The output layer is configured to convert the output of the LSTM layer into a specific behavior category.

[0086] In this embodiment, the input layer converts the input data into a format that the model can efficiently process—a three-dimensional tensor. This three-dimensional tensor contains three key dimensions: number of samples, time steps, and number of features. The number of samples represents the number of independent records in the dataset; each sample represents a separate observation or event. The time step reflects the length of the sequence data, namely the number of time points included in each sample, which is crucial for capturing the temporal dynamics of the data. The number of features refers to the number of variables observed at each time point, which together form a comprehensive description of the data. Data from the input layer is passed to the LSTM layer, a core component of the model architecture. The LSTM layer, or Long Short-Term Memory (LSTM) network, is specifically designed to capture long-term dependencies in sequential data. By utilizing specialized memory units and gating mechanisms, it effectively avoids vanishing and exploding gradients when processing long sequences, thereby more accurately capturing temporal dynamics and long-term trends in the data. Finally, the output layer is responsible for converting the output of the LSTM layer into the final recognition result. The output layer can employ various strategies and methods, such as classification, regression, or sequence-to-sequence conversion, depending on the application scenario and objectives of the model. The results of the output layer will directly reflect the model's understanding and analysis of the input data.

[0087] S32: Two Dropout layers are provided in the network architecture. The two Dropout layers are provided between the input layer and the LSTM layer, and between the LSTM layer and the output layer, respectively. The two Dropout layers are used to prevent overfitting of the model.

[0088] In this embodiment, the dropout layer dropout rate can be set to 0.5, which means that in each training iteration, each neuron has a 50% probability of being randomly dropped. By randomly dropping neurons, the Dropout layer can force the model to learn a more robust feature representation, thereby reducing excessive dependence on training data. The model needs to adapt to situations where different neurons are dropped, so that it can show stronger generalization ability on unseen data. Although the Dropout layer adds randomness during the training process, it actually increases the speed of model convergence and optimizes the final performance. In practical applications, it may be necessary to flexibly adjust the dropout rate based on the performance of the model and the characteristics of the data set.

[0089] In step S3, the specific steps of optimizing the crayfish optimization algorithm include:

[0090] S33: Use mean square error as the fitness function of the LSTM network model.

[0091] In this embodiment, the mean square error is expressed as:

[0092]

[0093] in, is the mean square error, is the actual value, i.e. The true output in the samples is is the predicted value, i.e., the model The predicted output on samples.

[0094] S34: Initialize the population and randomly generate individual crayfish positions. Each crayfish individual represents an LSTM network model hyperparameter group.

[0095] S35: Calculate the individual fitness values ​​of the initialized population and randomly generate the ambient temperature value.

[0096] S36: An iterative mechanism is set. Each time a new population is formed, an ambient temperature is randomly selected, and population one or population two is obtained according to the iterative mechanism.

[0097] In step S36, the iterative mechanism specifically includes:

[0098] S361: When the ambient temperature is higher than the preset ambient temperature threshold, the individuals in the population find the location of the summer cave based on the current global optimal position and the individual historical optimal position.

[0099] In step S361, the summer cave location expression formula is:

[0100]

[0101] in, The location of the cave. is the individual's best historical position, is the previous global optimal position.

[0102] S362: Individuals of the population move to the location of the summer cave. If the locations of the individuals are the same, by comparing the individual fitness values, the individual with low fitness will randomly select the location of another crayfish to adjust its position to compete for the summer cave. When the positions of all individuals are updated, population one is obtained.

[0103] S363: When the ambient temperature is lower than or equal to the preset ambient temperature threshold, the optimal position of the individual in the current population is used as the food position.

[0104] S364: Determine the size of the food according to the individual fitness values ​​of the current population, and select a foraging method according to the determination result to obtain population two.

[0105] In step S364, the formula for determining the size of the food is:

[0106]

[0107] in, It is the identification value of food size. is the food factor, which is a constant, is a random number, between, The current individual's fitness value, The fitness value of food, when When , the food is judged to be larger, , the food is judged to be small.

[0108] S37: Calculate the fitness value of each individual in the population one or the population two. If the output fitness value is higher than the preset fitness threshold, output the optimal hyperparameter. Otherwise, continue to iterate until the fitness value is higher than the preset fitness threshold or the maximum number of iterations is reached to obtain the optimal hyperparameter.

[0109] S4: Input the target data into the optimal recognition model to obtain the behavior category.

[0110] In this embodiment, through the precise recognition model, the human behavior category displayed in the target data can be quickly and accurately identified. The accuracy of the recognition results provides indispensable information support for many subsequent applications. In intelligent monitoring systems, the application of human behavior recognition is particularly critical. It can help the monitoring system to achieve automated monitoring, accurately capture and alarm abnormal behaviors, thereby effectively improving public safety and prevention capabilities. In the field of sports training, human behavior recognition also plays an important role. Coaches and athletes can use this to conduct a detailed analysis of the athletes' movements, accurately locate technical shortcomings, and then develop more targeted training plans to promote continuous improvement in sports performance. In addition, the application prospects of human behavior recognition are far more than this. It has a wide range of potential applications in many fields such as human-computer interaction, virtual reality, and game entertainment.

[0111] In this embodiment, the present invention obtains an optimal behavior recognition model by constructing an LSTM network model optimized based on the crayfish optimization algorithm and inputting training data for training, performs feature extraction on the target video data, obtains a global feature representation by an inverse weighted method, obtains target data, and inputs the target data into the optimal behavior recognition model to obtain behavior categories, thereby solving the problem of inaccurate behavior recognition. The global feature representation can more comprehensively reflect the behavior information in the video, improve the accuracy and reliability of the optimal behavior recognition model, and the crayfish optimization algorithm increases the time required for LSTM network model training, improves the overall computational efficiency, and robustness, thereby further improving the accuracy of recognition.

[0112] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0113] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A human behavior recognition method based on machine learning, characterized in that: include: S1: Obtain target video data, collect video data containing different human behaviors and corresponding behavior categories as historical data; S2: Preprocessing the target video data and the historical data respectively to obtain target data and training data; The specific steps of preprocessing include: S21: extracting video frames from the video data at preset time intervals, processing the video frames to obtain enhanced video frames, and extracting features from the enhanced video frames using a convolutional neural network to obtain a feature sequence; S22: performing normalization and smoothing processing on the feature sequence to obtain an enhanced feature sequence; S23: Calculating the distance between the enhanced feature sequences, and using an inverse distance weighting method according to the distance to obtain a weighted feature; S24: Summarize the weighted features by an average aggregation method to obtain a global feature representation; S3: Constructing an LSTM network model based on the crayfish optimization algorithm, and inputting the training data for training to obtain an optimal behavior recognition model; the specific steps of the crayfish optimization algorithm optimization include: S33: Use mean square error as the fitness function of the LSTM network model; S34: Initialize the population and randomly generate individual crayfish positions. Each crayfish individual represents a LSTM network model hyperparameter group. S35: Calculate the individual fitness values ​​of the initialized population and randomly generate the environmental temperature value; S36: Setting an iterative mechanism, each time a new population is formed, randomly setting an ambient temperature, and obtaining population one or population two according to the iterative mechanism; S37: Calculate the fitness value of each individual in the population one or the population two. If the output fitness value is higher than a preset fitness threshold, output the optimal hyperparameter. Otherwise, continue iterating until the fitness value is higher than the preset fitness threshold or the maximum number of iterations is reached, and obtain the optimal hyperparameter. S4: Input the target data into the optimal recognition model to obtain the behavior category.

2. The human behavior recognition method based on machine learning according to claim 1, characterized in that: In step S21, the video frame is processed by the following specific steps: S211: Enhance the video frame using a tone transformation method; S212: Use Gaussian blur to perform noise filtering on the video frame.

3. The human behavior recognition method based on machine learning according to claim 1, characterized in that: In step S22, the smoothing process specifically includes: S221: removing abnormal values ​​in the feature sequence and supplementing missing values ​​in the feature sequence by interpolation; S222: Smoothing the feature sequence using a moving average method.

4. The human behavior recognition method based on machine learning according to claim 1, characterized in that: In step S23, the inverse distance weighted expression formula is: in, is the value of the unknown point x to be estimated, It is The data value of the known point, The unknown point x and the The distance between known points, is the exponential of the weight.

5. The human behavior recognition method based on machine learning according to claim 1, characterized in that: In step S3, the specific steps of building the LSTM network model include: S31: Setting a network architecture including an input layer, an LSTM layer, and an output layer; the input layer is used to receive the target data; the LSTM layer is used to capture the temporal dependency of the target data and identify dynamic changes in behavior; the output layer is used to convert the output of the LSTM layer into a specific behavior category; S32: Two Dropout layers are set in the network architecture; the two Dropout layers are respectively set between the input layer and the LSTM layer, and between the LSTM layer and the output layer; the two Dropout layers are used to prevent the model from overfitting.

6. The human behavior recognition method based on machine learning according to claim 1, characterized in that: In step S36, the iteration mechanism specifically includes: S361: When the ambient temperature is higher than the preset ambient temperature threshold, the individuals in the population find the location of the summer cave based on the current global optimal position and the individual historical optimal position; S362: Individuals of the population move to the location of the summer cave. If the locations of the individuals are the same, by comparing the individual fitness values, the individual with the lower fitness will randomly select the location of another crayfish to adjust its position to compete for the summer cave. When the positions of all individuals are updated, population one is obtained. S363: When the ambient temperature is lower than or equal to the preset ambient temperature threshold, using the optimal position of the individual in the current population as the food position; S364: Determine the size of the food according to the individual fitness values ​​of the current population, and select a foraging method according to the determination result to obtain population two.

7. The human behavior recognition method based on machine learning according to claim 1, characterized in that: In step S361, the summer cave location expression formula is: in, The location of the cave. is the individual's best historical position, is the previous global optimal position.

8. The human behavior recognition method based on machine learning according to claim 6, characterized in that: In step S364, the formula for determining the size of the food is: in, It is the identification value of food size. is the food factor, which is a constant, is a random number, between, The current individual's fitness value, The fitness value of food, when When , the food is judged to be larger, , the food is judged to be small.

Citation Information

Patent Citations

  • Building indoor point cloud segmentation method based on local feature enhanced Point Net + + network

    CN115115839A

  • Rehabilitation training data processing method and device

    CN119580943A