A model debugging method, image recognition method and computer equipment
By using the error correction influence coefficient in the image learning sample library to adjust the image action category detection error, the problem of insufficient recognition accuracy and generalization ability caused by the uneven distribution of action categories in the traditional method is solved, and the debugging quality and recognition of the model are improved. Accuracy.
Patent Information
- Application Number
- CN202411028897.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Traditional image action category detection methods are difficult to achieve ideal recognition accuracy and generalization capabilities when faced with complex and changeable actual scenes, especially due to the diversity of data and the uneven distribution of action categories, which causes the model to be biased towards recognition during the training process. A large number of action categories ignores a small number of action categories, thus affecting the final recognition performance.
By using the error correction influence coefficient in the image learning sample library, combined with the feature information of the image learning sample and the prior information of the action category, the image action category detection error is adjusted to correct the model parameters and improve the debugging quality and recognition accuracy of the model.
It improves the debugging quality and output accuracy of the image action category detection model, enhances the generalization ability and robustness of the model, and can more accurately identify complex action categories, especially when dealing with unbalanced action category distribution.
Smart Images

Figure CN118552829B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to but is not limited to the fields of data processing and artificial intelligence technology, and in particular to a model debugging method, an image recognition method and a computer device. Background Art
[0002] With the rapid development of computer vision technology, image action category detection, as an important branch, has shown great application potential in many fields such as sports analysis, video surveillance, and human-computer interaction. The core of image action category detection is to build a model that can accurately identify the action category of people or objects in the image. However, in practical applications, due to the diversity and complexity of image data and the uneven distribution of different action categories in terms of sample numbers, traditional image action category detection methods often fail to achieve ideal recognition accuracy and generalization capabilities. Existing image action category detection methods usually directly debug model parameters based on the difference between the model prediction results and the true label (i.e., detection error). This method may perform well when processing data sets with balanced sample numbers and simple features, but its limitations gradually emerge when facing complex and changeable actual scenarios. In particular, when there are a large number of difficult-to-identify advanced learning examples (i.e., difficult samples) in the data set, traditional error calculation methods often fail to pay enough attention to these examples, resulting in insufficient learning of these examples by the model during training, which in turn affects the final recognition performance.
[0003] In addition, the uneven distribution of sample numbers of different action categories is also an important factor that restricts the accuracy of image action category detection. In practical applications, the number of samples of some common action categories may be much larger than that of other action categories, causing the model to tend to recognize action categories with a larger number during training, while ignoring action categories with a smaller number. This imbalance not only reduces the generalization ability of the model, but may also lead to misjudgment and omission of the model in practical applications. Summary of the invention
[0004] In view of this, the present application provides a model debugging method, an image recognition method and a computer device. The technical solution of the present application is implemented as follows:
[0005] On the one hand, the present application provides a model debugging method, the method comprising: using an image action category detection model to perform image action category detection on image learning samples in an image learning sample library to obtain sample image action category detection results corresponding to each image learning sample, the image learning sample library including the image learning samples and the image action category prior information corresponding to the image learning samples; determining an error correction influence coefficient corresponding to the image learning sample based on image sample feature information of the image learning sample and the sample image action category detection result, the image sample feature information including one or more of a learning sample difficulty attribute and a priori learning sample number of the image action category prior information corresponding to the image learning sample, the learning sample difficulty attribute including basic learning samples and advanced learning samples, the priori learning sample number indicating the number of image learning samples in the image learning sample library containing the image action category prior information; determining an image action category detection error of the image learning sample based on the error correction influence coefficient, the sample image action category detection result and the image action category prior information; and debugging the image action category detection model based on the image action category detection error.
[0006] In a second aspect, the present application provides an image recognition method, which includes: performing image action category detection on the target posture image of each core object in the target video through a debugged image action category detection model, and determining the target action mark corresponding to the target posture image of each core object, wherein the target video includes one or more video time periods and target posture images of several core objects; wherein the image action category detection model is debugged based on the method described in the previous aspect; performing content excitement analysis on the target video according to the target action mark corresponding to the target posture image of each core object, and obtaining the target video content excitement analysis result.
[0007] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the program, the steps of the method described in the first and second aspects are implemented.
[0008] The beneficial effects of the present application include at least: the present application adopts an image action category detection model to perform image action category detection on image learning samples in an image learning sample library. After obtaining the sample image action category detection results of each image learning sample, the image action category detection error is not determined directly based on the sample image action category detection results and the image action category prior information. Instead, the image sample feature information of each image learning sample in the image learning sample library is considered, and the error correction influence coefficient is first determined based on the image sample feature information of the image learning sample and the sample image action category detection result. Then, the image action category detection error is determined in combination with the error correction influence coefficient, the sample image action category detection result and the image action category prior information, and then the image action category detection model is debugged based on the image action category detection error. Based on the method provided in the present application, the image action category detection error is determined by the error correction influence coefficient, and the image action category detection errors of basic learning samples and advanced learning samples can be corrected. When the number of image learning samples with different image action category prior information is unbalanced, the image action category detection error of the unbalanced prior information sample can be corrected. The image action category detection model can be debugged based on the corrected image action category detection error, which can improve the debugging quality of the image action category detection model and increase the accuracy of the image action category detection model output. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0010] Figure 1 A schematic diagram of the implementation flow of a model debugging method provided in an embodiment of the present application.
[0011] Figure 2 A schematic diagram of the implementation flow of an image recognition method provided in an embodiment of the present application.
[0012] Figure 3 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] The embodiments of the present application provide a model debugging method and an image recognition method, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device), or other device with data processing capabilities.
[0014] Figure 1A schematic diagram of the implementation flow of a model debugging method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0015] Step S100: Use an image action category detection model to perform image action category detection on image learning samples in an image learning sample library to obtain sample image action category detection results corresponding to each image learning sample. The image learning sample library includes the image learning samples and image action category prior information corresponding to the image learning samples.
[0016] In step S100, the computer device uses the image action category detection model to carefully analyze and identify each image learning sample in the image learning sample library to determine the action category contained in each image. Specifically, the image learning sample library is a database containing a large number of images and their corresponding action category prior information. These images may come from various scenes, such as sports competitions, dance performances, daily life, etc., covering a variety of action categories such as running, jumping, waving, hugging, etc. Each image is accompanied by a set of prior information that clearly indicates whether the image contains a specific action category. For example, if someone is running in an image, the corresponding "running" action category prior information will be marked as 1, while other irrelevant action categories (such as "swimming" or "dancing") will be marked as 0.
[0017] In order to perform image action category detection, the computer device first needs to load each image in the image learning sample library into the image action category detection model. This model may be a convolutional neural network (CNN) based on deep learning, which is carefully designed to capture the spatial hierarchy and action features in the image. The model contains multiple convolutional layers, pooling layers, and fully connected layers, which extract and abstract image features layer by layer, and finally output the predicted probability of each action category.
[0018] When the model processes an image, first, the image is input into the convolution layer, and the convolution kernel is used to perform convolution operations with the local area of the image to extract primary features (such as edges, textures, etc.). Next, these features are processed by the pooling layer for dimensionality reduction to reduce the amount of calculation and avoid overfitting. Then, after the alternating effects of multiple convolutional layers and pooling layers, the model can gradually extract more abstract and advanced feature representations. Finally, these features are passed to the fully connected layer for classification processing, and the predicted probability of each action category is output. For each image learning sample, the image action category detection model outputs a probability vector, in which each element corresponds to the predicted probability of an action category. For example, if the model recognizes that an image is likely to contain a running action, the predicted probability corresponding to the "running" action category will be relatively high, while the predicted probabilities of other action categories will be relatively low. The computer device records these predicted probabilities as the sample image action category detection results.
[0019] By executing step S100, the computer device can generate corresponding action category detection results for each image in the image learning sample library. These results will be used as input data for subsequent steps to calculate errors, adjust model parameters, and further optimize the performance of the image action category detection model.
[0020] Step S200: Determine the error correction influence coefficient corresponding to the image learning sample based on the image sample feature information of the image learning sample and the detection result of the sample image action category, wherein the image sample feature information includes one or more of a learning sample difficulty attribute and the number of prior learning samples of the image action category prior information corresponding to the image learning sample, the learning sample difficulty attribute includes basic learning samples and advanced learning samples, and the number of prior learning samples indicates the number of image learning samples in the image learning sample library that contain the image action category prior information.
[0021] In step S200, the computer device deeply analyzes the feature information of the image learning samples and the detection results of these samples obtained by the image action category detection model to determine the error correction influence coefficient corresponding to each image learning sample. This coefficient plays a key role in the model training process. It acts as a loss adjustment weight to help the model more intelligently handle samples of different difficulty levels and uneven sample distribution.
[0022] First, the computer equipment considers the difficulty attribute of the learning examples, which is an important factor affecting the error correction coefficient. Learning examples can be divided into basic learning examples (simple examples) and advanced learning examples (difficult examples). Basic learning examples usually have clear and clear action features, which can be easily recognized by the model, so these examples have relatively little effect on the model during training. In contrast, advanced learning examples often contain blurred, complex or occluded action features, which are difficult for the model to accurately recognize, but these examples are crucial to improving the generalization ability and robustness of the model.
[0023] In order to distinguish samples of different difficulty, the computer device can adopt a variety of strategies. For example, it can use the difference between the model's predicted probability of the sample and the true label as a measure of difficulty. The closer the predicted probability is to the true label, the simpler the sample is; conversely, the more difficult it is. In addition, other feature extraction methods can be combined, such as metrics based on image complexity or difficulty levels annotated by experts.
[0024] Next, the computer device also considers the number of prior learning samples corresponding to the prior information of the image action category in the image learning sample library. The number of prior learning samples reflects the distribution of each action category in the training set. In practical applications, the number of samples of different action categories is often unbalanced, and some action categories may have a large number of samples, while others are relatively few. This unbalanced distribution will cause the model to favor the categories with a larger number during training, thereby affecting the overall performance.
[0025] To address this problem, the computer device considers the number of prior learning samples when calculating the error correction influence coefficient. Specifically, for action categories with a small number (i.e., tail categories), the computer device assigns a higher error weight to encourage the model to pay more attention to these categories and reduce the impact of the long tail effect. On the contrary, for action categories with a large number (i.e., head categories), the error weight will be relatively low.
[0026] In the actual calculation process, the determination of the error correction coefficient can rely on the comprehensive consideration of multiple factors. An example of a possible calculation formula is as follows:
[0027] Error correction influence coefficient = f(difficulty coefficient, prior learning sample number coefficient);
[0028] The difficulty coefficient can be calculated based on the difference between the predicted probability and the true label of the sample, while the coefficient of the number of prior learning samples can be determined based on the number of samples of each action category. For example, the difficulty coefficient can be a function of the difference between a certain transformation (such as logarithmic transformation) of the predicted probability and the true label, while the coefficient of the number of prior learning samples can be the inverse of the number of samples or some smoothed inverse form.
[0029] By executing step S200, the computer device can assign a reasonable error correction influence coefficient to each image learning sample. This coefficient will be used to adjust the training error calculation of the model in subsequent steps, so that the model can pay more attention to those samples and action categories that are more critical to performance improvement during the training process. This not only helps to improve the accuracy of the model, but also enhances the generalization ability and robustness of the model.
[0030] Step S300: determining the image action category detection error of the image learning sample based on the error correction influence coefficient, the sample image action category detection result and the image action category prior information.
[0031] In step S300, the computer device comprehensively uses the error correction influence coefficient, the sample image action category detection results and the image action category prior information to accurately calculate the image action category detection error of each image learning sample. Specifically, the computer device first obtains the error correction influence coefficient calculated in step S200. This coefficient is a dynamically adjusted value, which is customized according to the difficulty attribute of the learning sample and the number of prior learning samples, aiming to balance the impact of samples of different difficulty and distribution on model training. For example, for high-level learning samples that are difficult to identify, the error correction influence coefficient will be relatively high to emphasize the importance of these samples in error calculation. Next, the computer device obtains the sample image action category detection results from the image action category detection model. These results are usually a set of probability vectors, in which each element corresponds to the predicted probability of an action category. For example, if the model believes that there is an 80% probability that an image contains a running action, the predicted probability corresponding to the running action category is 0.8.
[0032] At the same time, the computer device also accesses the image action category prior information stored in the image learning sample library. This information is known and labeled, and is used to indicate whether each image contains a specific action category. During the training process, this prior information is used as the true label and compared with the model's prediction results to evaluate the performance of the model. In order to determine the image action category detection error, the computer device adopts a calculation method combined with an error correction influence coefficient. This calculation method is designed to more accurately reflect the performance differences of the model when identifying samples of different difficulty and distribution. Specifically, the computer device will apply the error correction influence coefficient to the difference calculation between the predicted probability of each action category and the prior information.
[0033] An example of a possible calculation formula is as follows:
[0034]
[0035] Where i represents the i-th image learning example, k represents the k-th action category, and k is the total number of action categories. The error correction coefficient ik is the error correction coefficient for the i-th example in the k-th action category, the prediction probability ik is the model's predicted probability for the i-th example in the k-th action category, and the prior information ik is the prior information of the i-th example in the k-th action category (usually 0 or 1).
[0036] In practical applications, the execution of step S300 is crucial to improving the performance of the image action category detection model. By accurately calculating the detection error of each sample, the computer device can identify which samples and action categories the model performs poorly on, and then take targeted optimization measures, such as adjusting the model structure, increasing the number of training rounds, changing the learning rate, etc., to gradually improve the accuracy and robustness of the model.
[0037] Step S400: debugging the image action category detection model based on the image action category detection error.
[0038] In step S400, the computer device uses the image action category detection error calculated in step S300 to debug the image action category detection model. This step is a key link in the model training cycle. It reduces the detection error by adjusting the internal parameters of the model, thereby improving the model's ability to recognize action categories in the image. Specifically, the computer device first uses the calculated detection error as a feedback signal to evaluate the performance of the current model on the image action category detection task. This error value not only reflects the difference between the model prediction result and the true label, but also considers the impact of the difficulty and distribution of different examples on the error calculation through the error correction influence coefficient. Next, the computer device uses an optimization algorithm to update the parameters of the model to reduce the detection error. Common optimization algorithms include gradient descent, stochastic gradient descent (SGD), Adam optimizer, etc. These algorithms gradually approach the optimal solution by calculating the gradient of the error with respect to the model parameters and updating the parameters in the opposite direction of the gradient.
[0039] Taking the gradient descent method as an example, the computer device will perform the following steps to update the model parameters:
[0040] Calculate gradients: For each parameter in the model, the computer device calculates the partial derivative of the detection error with respect to that parameter, i.e. the gradient. This gradient indicates the direction in which the parameter should be adjusted to minimize the detection error.
[0041] Update parameters: Based on the calculated gradient, the computer device updates the model's parameters according to a predetermined learning rate (a hyperparameter that controls the step size of the parameter update). Specifically, the product of the learning rate and the corresponding gradient is subtracted from each parameter.
[0042] ;
[0043] in, represents the model parameters at the tth iteration, represents the learning rate, represents the gradient of the detection error with respect to the model parameters.
[0044] In practical applications, since image learning sample libraries usually contain a large number of samples, directly calculating the gradients of all samples may be very time-consuming. Therefore, computer devices often use mini-batch gradient descent or stochastic gradient descent to approximate the gradient. Specifically, it randomly selects a small batch of samples (i.e., a mini-batch) in each iteration to calculate the gradient, and updates the model parameters based on the gradient of this batch of samples.
[0045] By repeatedly executing step S400, the computer device can gradually adjust the parameters of the model to reduce the error of image action category detection. As the training process proceeds, the model's ability to recognize action categories in the image will gradually improve, and eventually reach a relatively stable state. At this point, the model can be used in actual image action category detection tasks to provide strong support for various application scenarios. It should be noted that the execution of step S400 is an iterative process, which needs to be closely coordinated with steps S100, S200 and S300 to form a complete model training cycle. In this cycle, the computer device will continuously load new image learning samples, calculate the error correction influence coefficient, determine the detection error, and debug the model based on the error until the preset stop condition is met (such as reaching the maximum number of iterations, the detection error is lower than a certain threshold, etc.). Through such a training process, the computer device can train an image action category detection model with excellent performance.
[0046] As an implementation manner, the image action category detection model is debugged by adopting two different debugging links. The step S400 of debugging the image action category detection model based on the image action category detection error may specifically include:
[0047] Step S410: In the first debugging phase, the image action category detection model is debugged based on a first image action category detection error, wherein the first image action category detection error is an image action category detection error corresponding to an image learning sample in a first image learning sample library, and the image learning sample in the first image learning sample library contains an image action category prior information.
[0048] In step S410, the computer device first loads all images in the first image learning sample library and their corresponding action category prior information. These images are used as training data to guide the learning process of the model.
[0049] Using the current image action category detection model (which may be a model that was initially trained or updated after the previous iteration), the computer device performs action category detection on each image in the first image learning sample library. The model outputs a predicted probability vector, indicating the probability that the image belongs to each possible action category. However, in this first debugging phase, since each image only contains one action category prior information, the model mainly focuses on the recognition of the "shooting" action.
[0050] Based on the method introduced in step S300, the computer device calculates the image action category detection error for each image learning example. This error is determined by comparing the model's prediction results with the image's true action category prior information (i.e., the labeled "shooting" action). At the same time, considering the difficulty and distribution of different examples, the computer device applies an error correction influence coefficient to adjust the error calculation to more accurately reflect the performance of the model in identifying these examples. An example of an error calculation formula may be:
[0051] ;
[0052] Among them, i represents the i-th image learning sample, the error correction influence coefficient i is dynamically calculated based on the sample difficulty and the number of prior learning samples, and the predicted probability shot i is the probability that the model predicts the i-th sample as a "shoot" action. Since the true label is "shoot" (which can be regarded as a probability of 1), the absolute value of 1-predicted probability shot i is used in the error calculation.
[0053] After obtaining the first image action category detection error, the computer device uses an optimization algorithm (such as gradient descent) to update the parameters of the image action category detection model. The optimization algorithm adjusts the parameters to reduce the error based on the gradient information of the error with respect to the model parameters. This process is repeated multiple times until the model reaches a certain accuracy in identifying images in the first image learning sample library or meets other stopping conditions.
[0054] Step S420: In the second debugging phase, on the premise that the image action category detection model debugged in the first debugging phase is debugged, the image action category detection model is debugged based on a second image action category detection error, wherein the second image action category detection error is an image action category detection error corresponding to an image learning sample in a second image learning sample library, and the image learning samples in the second image learning sample library contain one or more image action category prior information.
[0055] In step S420, the computer device loads all images in the second image learning sample library and their corresponding action category prior information. These images contain richer action combinations and more complex scenes, which pose a challenge to the generalization ability of the model. Using the image action category detection model that has been preliminarily optimized after the first debugging phase, the computer device performs action category detection on each image in the second image learning sample library. The model outputs a probability vector indicating the probability that the image belongs to each possible action category. Since these images may contain multiple action categories, the model needs to consider the prediction of multiple categories at the same time.
[0056] For each image in the second image learning sample library, the computer device calculates the image action category detection error based on the model's prediction results and the actual action category prior information. Since an image may contain multiple action categories, the error calculation needs to consider the difference between the predicted probability and the actual label of each category. At the same time, according to the error correction influence coefficient method mentioned above, the computer device performs differentiated processing on samples of different difficulty and distribution to more accurately reflect the model performance.
[0057] An example formula for error calculation might be a loss function commonly used in multi-label classification, such as a variant of Binary Cross-Entropy Loss, where the loss is calculated separately for each action category and summed up to get the total loss:
[0058] ;
[0059] Among them, Wik is the error correction influence coefficient, N is the number of image learning samples, k is the total number of action categories, yik is the true label (0 or 1) of the ith sample in the kth action category, pik is the probability predicted by the model that the ith sample belongs to the kth action category, and the error correction influence coefficient ik is dynamically calculated based on the sample difficulty and the number of prior learning samples.
[0060] Based on the calculated error of the second image action category detection, the computer device again uses an optimization algorithm (such as the Adam optimizer) to update the parameters of the image action category detection model. The optimization algorithm adjusts the parameters to reduce the error based on the gradient information of the error with respect to the model parameters. Since the images in the second image learning sample library are more complex and diverse, this debugging step helps the model learn more robust and generalized feature representations, improving its performance in multi-label image action category detection tasks.
[0061] As an implementation manner, in the first debugging link, the step S200, based on the image sample feature information of the image learning sample and the sample image action category detection result, determines the error correction influence coefficient corresponding to the image learning sample, which may specifically include:
[0062] Step S210: Based on the learning sample difficulty attribute of the image learning sample and the sample image action category detection result, determine the first error correction influence coefficient corresponding to the image learning sample, and the first error correction influence coefficient is used to increase the image action category detection error of the advanced learning sample.
[0063] For example, suppose you are developing a system for identifying athlete actions in sports games, such as identifying basketball players' shooting, dribbling, and defending. In this scenario, the image learning sample library contains a large number of game images with action categories annotated. Some of these images have clear actions and simple backgrounds, which are basic learning samples (simple samples); while some actions may be difficult to identify due to factors such as athlete occlusion, fast movement, and changes in perspective, and become advanced learning samples (difficult samples).
[0064] In step S210, the computer device first analyzes the difficulty attribute of each image learning sample. This can usually be preliminarily judged by observing the characteristics of the image itself (such as clarity, background complexity, degree of motion blur, etc.), but a more direct and accurate way is to use the model's prediction results for the sample to reflect its difficulty. Specifically, if the model's predicted probability for a sample is close to the true label (i.e., the image action category prior information), it means that the sample is relatively simple; conversely, if the predicted probability is significantly different from the true label, it means that the sample is difficult to identify.
[0065] Next, the computer device calculates the first error correction influence coefficient based on the difficulty attribute of the sample and the detection result of the action category of the sample image. The calculation formula of this coefficient is cleverly designed to increase the error weight of high-level learning samples so that the model pays more attention to these difficult-to-recognize samples during training.
[0066] When the image action category prior information is 1 (indicating that the image does contain a certain action category), the calculation formula for the first error correction coefficient is (1-Ti^n)^a. Here, Ti^n is the model's predicted probability of the i-th sample in the n-th action category, and a is a pre-set adjustment variable used to control the degree of error weight amplification. Since the predicted probability Ti^n of high-level learning samples is often small (because the model is difficult to accurately identify), the value of (1-Ti^n) will be relatively large, and the error weight will be further amplified through exponential operations.
[0067] When the image action category prior information is 0 (indicating that the image does not contain a certain action category), the situation is slightly different. Since the correctness of the model prediction is not very meaningful for optimizing the detection of the action category (because the image itself does not contain the action), no additional error adjustment can be performed on such samples, or a smaller weight can be used.
[0068] This setting is effective because it fully considers the different contributions of samples of different difficulty to model training. Basic learning samples have relatively limited effects on improving model performance due to their clear features and simple recognition, so it is reasonable to give them a lower weight in error calculation. Advanced learning samples contain complex features that are difficult for the model to capture, which is crucial to improving the generalization ability and robustness of the model. By increasing the error weights of these samples, the model can be forced to pay more attention to these difficult-to-recognize scenes during training, thereby learning a more comprehensive feature representation. In addition, the introduction of the adjustment variable a provides flexibility for adjusting the error weight. By adjusting the value of a, the degree of error weight amplification can be controlled to meet the needs of different tasks and data sets. For example, in the early stage of training, in order to quickly guide the model to learn basic features, a can be set to a small value; as training progresses, in order to further improve model performance, the value of a can be gradually increased to make the model more focused on those difficult-to-recognize samples.
[0069] Step S210 effectively solves the problem of uneven contribution of samples of different difficulty levels during model training by introducing the first error correction influence coefficient. This strategy not only improves the model's ability to recognize complex scenes, but also accelerates the model's convergence speed, enabling it to reach optimal performance faster.
[0070] Step S220: Determine the second error correction influence coefficient corresponding to the image learning sample based on the number of prior learning samples of the image action category prior information and the number of first prior information types in the first image learning sample library, the number of the first prior information types represents the number of types of prior information contained in the first image learning sample library, and the second error correction influence coefficient is inversely correlated with the number of prior learning samples.
[0071] Step S220 allocates a second error correction influence coefficient to each image learning sample based on the number of prior learning samples of the image action category prior information and the number of prior information types in the first image learning sample library. The introduction of this coefficient is intended to solve the problem of uneven sample distribution, especially the difference in quantity between the head prior information and the tail prior information, and the co-occurrence migration problem that may exist in multi-label image learning samples.
[0072] For example, suppose you are training an image action category detection model for identifying pedestrian actions (such as walking, running, riding a bicycle, etc.) in traffic scenes. In this scenario, the first image learning sample library contains a large number of pedestrian images with action categories annotated. However, due to the complexity of actual traffic scenes, the number of samples of different action categories may vary significantly. For example, "walking", as the most common action, may have far more samples than "running" or "riding a bicycle". This unbalanced distribution of samples will cause the model to tend to identify a larger number of action categories during training, while ignoring a minority of categories, thus affecting the generalization ability of the model.
[0073] In step S220, the computer device first counts the number of prior learning samples of each action category, that is, the number of images labeled as the action category in the first image learning sample library. At the same time, it also records the total number of types of prior information contained in the first image learning sample library, that is, the total number of different action categories.
[0074] Next, the computer device calculates the second error correction influence coefficient corresponding to each image learning sample based on this information. The calculation of this coefficient takes into account two key factors: one is the number of prior learning samples of the action category, and the other is the total number of prior information types. Specifically, for a smaller number of action categories (tail prior information), the computer device assigns a higher error weight to encourage the model to pay more attention to these categories during training; and for a larger number of action categories (head prior information), the error weight is appropriately reduced to avoid overfitting of the model. The possible calculation formula can be:
[0075] ;
[0076] Where W2 is the second error correction influence coefficient, M represents the total number of prior information types contained in the first image learning sample library, and e s represents the number of prior learning samples corresponding to the action label s in the first image learning sample library. This formula directly reflects the inverse correlation between the second error correction coefficient and the number of prior learning samples: s When it is smaller (i.e., tail prior information), W2 is larger and the error weight increases; when e s When it is larger (i.e., head prior information), W2 is smaller and the error weight is reduced.
[0077] Through the second error correction influence coefficient introduced in step S220, the computer device can dynamically adjust the error weights of samples of different action categories during the model training process, thereby effectively alleviating the problem of uneven distribution of samples. This strategy not only improves the model's recognition ability for minority category actions, but also enhances the generalization performance and robustness of the model. In practical applications, the calculation formula and parameter settings can be flexibly adjusted according to the characteristics of specific tasks and data sets to achieve the best training effect.
[0078] Based on this, the step S300, based on the error correction influence coefficient, the sample image action category detection result and the image action category prior information, determines the image action category detection error of the image learning sample, which may specifically include: determining the first image action category detection error of the image learning sample based on the first error correction influence coefficient, the second error correction influence coefficient, the sample image action category detection result and the image action category prior information.
[0079] Suppose you are training an image action category detection model for identifying the actions of athletes in track and field competitions (such as starting, sprinting, hurdling, etc.). In this scenario, the image learning sample library contains a large number of athlete competition images with action categories annotated. Due to the complexity of the competition scene, the samples of different action categories may vary significantly in difficulty and quantity. Therefore, during the training process, it is necessary to balance these differences through error correction influence coefficients to ensure that the model can fully and accurately learn the characteristics of various actions.
[0080] In step S300, the computer device first obtains the first error correction influence coefficient and the second error correction influence coefficient of each image learning sample. These two coefficients respectively reflect the influence of the difficulty attribute of the sample and the prior information distribution on the error calculation. Then, the computer device combines the sample image action category detection result (i.e., the model's predicted probability vector for the sample) and the image action category prior information (i.e., the sample's true action label) to calculate the image action category detection error.
[0081] A possible calculation formula is to multiply the first error correction influence coefficient and the second error correction influence coefficient to obtain the comprehensive error correction influence coefficient, and then apply this coefficient to the basic error calculation (such as cross entropy loss). Specifically, for each image learning example i and each action category k, the image action category detection error can be expressed as:
[0082] ;
[0083] in, is the first image action category detection error, W1i is the first error correction influence coefficient, W2i is the second error correction influence coefficient, yik is the true label (0 or 1) of image learning example i on action category k, p ik is the probability that the model predicts that the image learning example i is action category k.
[0084] Through the calculation in step S300, the computer device can accurately evaluate the performance of each image learning example in the image action category detection task, and dynamically adjust the weights of different examples in the error calculation through the error correction influence coefficient. This strategy not only solves the problem of uneven distribution of sample difficulty and quantity, but also improves the model's recognition ability and generalization performance for complex scenes. In practical applications, the calculation formula and parameter settings of the error correction influence coefficient can be flexibly adjusted according to the characteristics of specific tasks and data sets to achieve the best training effect.
[0085] As an implementation manner, in the second debugging link, the step S200, based on the image sample feature information of the image learning sample and the sample image action category detection result, determines the error correction influence coefficient corresponding to the image learning sample, including:
[0086] Step S201: Based on the learning sample difficulty attribute of the image learning sample and the sample image action category detection result, determine the first error correction influence coefficient corresponding to the image learning sample, and the first error correction influence coefficient is used to increase the image action category detection error of the advanced learning sample.
[0087] Step S201 determines the first error correction influence coefficient based on the difficulty attribute of the image learning sample and the detection result of the sample image action category, so as to enhance the model's attention to the advanced learning samples (i.e., difficult samples). This step is designed to optimize the model training process and ensure that the model can more effectively learn and recognize those difficult-to-recognize image action categories.
[0088] Suppose you are training an image action category detection model for identifying different actions of athletes on a track and field field (such as starting, running, jumping, etc.). In actual training data, starting actions are often considered basic learning examples (simple examples) because the athlete's posture is relatively fixed and the background is simple, while jumping actions may be considered advanced learning examples (difficult examples) due to the high-speed movement of the athlete's body, rapid changes in posture, and complex background.
[0089] In step S201, the computer device first analyzes the difficulty attribute of each image learning sample. Although the difficulty attribute itself may be a subjective evaluation, in practical applications, it can be indirectly inferred by observing the prediction results of the model. Specifically, if the model's predicted probability for a sample is highly consistent with the true label, then the sample is likely to be a basic learning sample; conversely, if the predicted probability is significantly different from the true label, then the sample is likely to be an advanced learning sample.
[0090] Next, the computer device calculates the first error correction influence coefficient based on the sample image action category detection result (i.e., predicted probability) and the image action category prior information (i.e., true label). Taking jumping action as an example, suppose there is an image learning sample of jumping action, whose true label is 1 (indicating that the image contains jumping action), and the model's predicted probability Tx for this sample is n (n is the category index corresponding to the jumping action) is 0.4 (indicating that the confidence of the model in identifying the action is low). In this case, (1-Tx n ) a The first error correction influence coefficient is determined by a calculation formula, wherein a is a preset adjustment variable used to control the degree of error weight amplification.
[0091] This setting is because the different contributions of samples of different difficulty to model training are fully considered. Basic learning samples have relatively limited effects on improving model performance due to their clear features and simple recognition, so it is reasonable to give them a lower weight in error calculation. Advanced learning samples contain complex features that are difficult for the model to capture, which is crucial to improving the generalization ability and robustness of the model. By increasing the error weights of these samples, the model can be forced to pay more attention to these difficult-to-recognize scenes during training, thereby learning a more comprehensive feature representation. In addition, the introduction of the adjustment variable a provides flexibility for adjusting the error weight. By adjusting the value of a, the degree of error weight amplification can be controlled according to the characteristics of specific tasks and data sets to achieve the best training effect. For example, in the early stage of training, in order to quickly guide the model to learn basic features, a can be set to a small value; as the training progresses, in order to further improve the model performance, the value of a can be gradually increased so that the model focuses more on those difficult-to-recognize samples.
[0092] In summary, step S201 effectively solves the problem of uneven contribution of samples of different difficulty levels during model training by introducing the first error correction influence coefficient, and provides strong support for improving the performance of the image action category detection model.
[0093] Step S202: Determine a second error correction influence coefficient corresponding to the image learning sample based on the number of sample prior information types contained in the image learning sample, the number of prior learning samples of the image action category prior information, and the number of second prior information types in the second image learning sample library.
[0094] Suppose you are training an image action category detection model for identifying pedestrian actions in traffic scenes (such as walking, running, cycling, etc.). In this scene, many images may contain multiple action categories at the same time (such as a person walking and talking on the phone at the same time), forming multi-label image learning samples. In addition, since different actions appear at different frequencies in traffic scenes, the distribution of samples for each type of action is often uneven, causing the model to tend to identify a larger number of action categories (head prior information) during training, while ignoring a smaller number of action categories (tail prior information).
[0095] In step S202, the computer device determines the number of types of sample prior information contained in each image learning sample. This number determines whether the sample is a single prior information sample or a multiple prior information sample.
[0096] For samples that only contain one action category prior information (single prior information sample), the calculation of the second error correction influence coefficient is similar to the first debugging link, and can be determined based on the number of prior learning samples of the action category and the total number of prior information types in the second image learning sample library. An optional calculation formula is as follows:
[0097] ;
[0098] For samples containing prior information of multiple action categories (multiple prior information samples), the calculation process is more complicated. First, the computer device calculates the prior information influence coefficient t=1 / e based on the number of prior learning samples for each action category. s This coefficient reflects the distribution of different action categories in the sample library: the action category with more prior learning samples (head prior information) has a lower influence coefficient; conversely, the action category with fewer prior learning samples (tail prior information) has a higher influence coefficient.
[0099] Next, the computer device identifies the action category with the least number of prior learning samples (i.e., tail prior information) and determines its corresponding prior information influence coefficient as t m (i.e., the maximum value among all t). Then, based on the total number of prior information types M in the second image learning sample library and the prior information influence coefficient of each action category, the second error correction influence coefficient W2 is calculated. An optional calculation formula is:
[0100] W2=(1 / M)·(2·t m -∑(1 / e s ));
[0101] This formula is designed to balance the imbalanced distribution between head prior information and tail prior information by increasing the error weight of tail prior information, and taking into account the co-occurrence migration phenomenon between multiple labels.
[0102] Step S202 effectively solves the problem of uneven sample distribution and co-occurrence migration in multi-label image learning samples by introducing the second error correction influence coefficient. The design of this step not only improves the model's recognition ability for minority category actions, but also enhances the generalization performance and robustness of the model. In practical applications, the calculation formula and parameter settings can be flexibly adjusted according to the characteristics of specific tasks and data sets to achieve the best training effect.
[0103] Based on this, the step S300 determines the image action category detection error of the image learning sample based on the error correction influence coefficient, the sample image action category detection result and the image action category prior information, including: determining the second image action category detection error of the image learning sample based on the first error correction influence coefficient, the second error correction influence coefficient, the sample image action category detection result and the image action category prior information.
[0104] In the second debugging phase, step S300 is a core step in the model training process, which is responsible for accurately calculating the second image action category detection error of each image learning sample based on the error correction influence coefficient, the sample image action category detection result and the image action category prior information.
[0105] Suppose you are training an image action category detection model to identify different actions of athletes in gymnastics competitions (such as jumping on a balance beam, spinning, etc.). In this scenario, the image learning sample library contains a large number of gymnastics competition images with action categories annotated. These images may contain multiple action categories at the same time, and the number of samples of different action categories is unevenly distributed. In addition, due to the complexity and diversity of gymnastics movements, the model may encounter great difficulties in identifying some advanced movements.
[0106] The calculation formula of the second image action category detection error
[0107] In step S300, the computer device calculates the second image action category detection error of each image learning sample according to the first error correction influence coefficient, the second error correction influence coefficient, the sample image action category detection result and the image action category prior information. A possible calculation formula is as follows:
[0108] ;
[0109] Among them, C2ik is the second error correction influence coefficient, i represents the i-th image learning sample, k represents the total number of action categories, and y ik is the true label (0 or 1) of image learning example i on action category k, p ik is the probability that the model predicts that the image learning example i is action category k.
[0110] Step S300 achieves accurate calculation of the image action category detection error of the image learning sample by introducing the first error correction influence coefficient and the second error correction influence coefficient. This step not only takes into account the impact of the difficulty attribute of the sample on the error calculation, but also solves the problem of uneven distribution of samples in multi-label image learning samples. By accurately calculating the detection error of each sample in each action category, the computer equipment can provide strong data support for subsequent model parameter adjustment and optimization, thereby further improving the performance and generalization ability of the image action category detection model.
[0111] As an implementation manner, the step S202, based on the number of sample prior information types contained in the image learning sample, the number of prior learning samples of the image action category prior information, and the number of second prior information types in the second image learning sample library, determines the second error correction influence coefficient corresponding to the image learning sample, which may specifically include:
[0112] Step S2021: When the number of sample prior information types contained in the image learning sample is equal to 1, determine the second error correction influence coefficient corresponding to the image learning sample based on the number of prior learning samples of the image action category prior information and the number of second prior information types in the second image learning sample library.
[0113] Step S2021 focuses on processing those image learning samples that only contain prior information of a single action category (i.e., single prior information samples). In this case, the computer device calculates the second error correction influence coefficient corresponding to each single prior information sample based on the number of prior learning samples of the image action category prior information and the total number of prior information types in the second image learning sample library.
[0114] Suppose you are training an image action category detection model for identifying different actions of athletes in track and field competitions (such as starting, sprinting, jumping, etc.). In this scenario, the image learning sample library contains a large number of athlete competition images with action categories annotated. Among them, some images only contain prior information of one action category, such as an image with only the action of "starting" annotated.
[0115] For such a single prior information example, the computer device performs the following calculation process to determine the second error correction influence coefficient:
[0116] First, the computer device counts the number of prior learning samples of each action category in the second image learning sample library. Taking the "starting" action as an example, it is assumed that there are nk images in the second image learning sample library that are labeled as the "starting" action. Next, the computer device counts the total number of types of prior information contained in the second image learning sample library, that is, the total number of different action categories. Assume that there are a total of M different action categories. Finally, according to the formula W2=(1 / M)·(2·t m -∑(1 / e s )), the computer device calculates the second error correction influence coefficient corresponding to each single prior information sample. In this example, for the image learning sample containing only the prior information of the "starting" action, its second error correction influence coefficient W will be (1 / M) and (1 / e s )
[0117] Assume that M=5 (indicating that there are 5 different action categories: starting, sprinting, jumping, throwing, and hurdling), and the number of prior learning samples of the "starting" action es=200. For an image learning sample that only contains prior information of the "starting" action, the second error correction influence coefficient is 0.001.
[0118] This coefficient reflects the relative scarcity (or abundance) of the "starting" action in the second image learning sample library, as well as its distribution relationship with other action categories. Since the number of samples of the "starting" action is relatively large (although not the largest), its corresponding second error correction coefficient is not particularly large, but it can still ensure that the model pays appropriate attention to this action category during training.
[0119] Step S2021 calculates the appropriate second error correction influence coefficient for a single prior information sample by considering the number of prior learning samples and the total number of prior information types. This step is designed to balance the contribution of different action category samples during the training process to ensure that the model can fully and accurately learn the feature representations of various actions. In practical applications, this step is of great significance for improving the performance and generalization ability of image action category detection models.
[0120] Step S2022: When the number of types of sample prior information contained in the image learning sample is greater than 1, determine the prior information influence coefficient of each image action category prior information according to the number of prior learning samples of each image action category prior information, and determine the image action category prior information with the least number of prior learning samples as the target image action category prior information; determine the second error correction influence coefficient corresponding to the image learning sample based on the number of the second prior information types and the difference in influence coefficient between the prior information influence coefficient of the target image action category prior information and the prior information influence coefficient of the remaining image action category prior information.
[0121] Step S2022 is used to process image learning samples containing multiple action category prior information (i.e., multiple prior information samples). Due to the common co-occurrence migration problem in multi-label image learning samples, the computer device needs to adopt a more sophisticated strategy to determine the second error correction influence coefficient of each sample to ensure that the model can learn the characteristics of different action categories in a balanced manner during the training process.
[0122] Suppose you are training an image action category detection model for identifying pedestrian actions (such as walking, running, riding a bicycle, etc.) in traffic scenes. In this scene, many images may contain multiple action categories at the same time, such as a person may be walking while talking on the phone or carrying an object. These multiple prior information examples bring challenges to model training because the number of examples of different action categories is often unbalanced, and there may be complex co-occurrence relationships between actions.
[0123] For multiple prior information samples, the computer device will perform the following steps to determine the second error correction influence coefficient: First, the computer device determines the prior information influence coefficient (i.e., weight) of each action category based on the number of prior learning samples. A commonly used calculation method is m=1 / nk, where nk represents the number of prior learning samples corresponding to the action label k in the second image learning sample library. This method ensures that the action category with more prior learning samples (such as "walking") has a lower prior information influence coefficient; conversely, the action category with fewer prior learning samples (such as "riding a bicycle") has a higher prior information influence coefficient.
[0124] Next, the computer device determines the action category prior information with the least number of prior learning samples as the target image action category prior information. In the multi-prior information samples, these tail prior information usually need special attention from the model because they are crucial to improving the overall performance of the model.
[0125] Finally, based on the number of second prior information types M (i.e., the total number of different action categories contained in the second image learning sample library) and the prior information influence coefficient t of the target image action category prior information,m The computer device determines the second error correction influence coefficient W2 corresponding to each multi-prior information sample by calculating the difference between the prior information influence coefficient of the prior information of the remaining action categories (i.e., the maximum value among all t). An optional calculation formula is W2=(1 / M)·(2·t m -∑(1 / e s )). This formula is designed to balance the contribution of different action categories by increasing the error weight of the tail prior information, thereby solving the problems of uneven distribution of samples and co-occurrence migration.
[0126] Assume that the second image learning sample library contains M=5 different action categories (walking, running, riding a bicycle, making phone calls, carrying items), and the number of prior learning samples is e1=1000, e2=500, e3=100, e4=200, e5=50. Then the corresponding prior information influence coefficients are t1=0.001, t2=0.002, t3=0.01, t4=0.005, t5=0.02. In this example, "riding a bicycle" (e3=100) is the action category with the least number of prior learning samples, so its corresponding prior information influence coefficient t3 is also the highest, and is determined as the target image action category prior information.
[0127] Substituting these values into the calculation formula of W2, we can get the second error correction influence coefficient corresponding to each multi-prior information sample. This coefficient will be used in subsequent training error calculations to guide the model to pay more attention to those difficult-to-identify tail prior information action categories.
[0128] Step S2022 effectively solves the problem of uneven sample distribution and co-occurrence migration in multi-label image learning samples by introducing the concepts of prior information influence coefficient and second error correction influence coefficient. The design of this step not only improves the model's ability to recognize minority category actions, but also enhances the generalization performance and robustness of the model. In practical applications, this strategy is of great significance for improving the training effect of image action category detection models.
[0129] As an implementation manner, the step S100, using the image action category detection model to perform image action category detection on the image learning samples in the image learning sample library to obtain the sample image action category detection results corresponding to each image learning sample, may specifically include:
[0130] Step S110: loading each image learning sample in the image learning sample library into the image feature learning component in the image action category detection model, and obtaining the sample image semantics corresponding to each image learning sample output by the image feature learning component;
[0131] Step S120: Loading the sample image semantics into the micro-motion learning component in the image action category detection model to obtain the sample image action category detection results corresponding to each image learning sample output by the micro-motion learning component.
[0132] Suppose that an intelligent surveillance system is being developed, which aims to automatically identify people's actions in public places, such as walking, running, talking, etc., for security monitoring or behavior analysis. In order to train a model that can accurately identify these action categories, a large number of image learning sample libraries with annotated action categories are built. These images cover different scenes, lighting conditions, viewing angles, and occlusion situations to ensure the generalization ability of the model.
[0133] In step S110, the computer device is responsible for loading each image learning sample in the image learning sample library into the image feature learning component in the image action category detection model. The main task of this component is to extract key features in the image to provide a basis for subsequent action category recognition.
[0134] The image feature learning component can use a convolutional neural network (CNN) as its core architecture. CNN is a deep learning model that is particularly suitable for image processing. It can automatically learn the hierarchical feature representation in images through a combination of convolutional layers, pooling layers, and fully connected layers.
[0135] When an image is loaded into a CNN, it first passes through a series of convolutional layers. Each convolutional layer contains multiple convolutional kernels (also called filters) that slide over the image and perform convolution operations to extract local features (such as edges, textures, etc.). Subsequently, the pooling layer downsamples the output of the convolutional layer to reduce the amount of computation and avoid overfitting. By alternating the stacking of multiple convolutional layers and pooling layers, CNN is able to gradually extract higher-level and more abstract feature representations.
[0136] Finally, the image feature learning component will output the semantics of the sample image corresponding to each image learning sample. These semantic information usually exist in the form of feature vectors, which encode the abstract representation of the key information in the image and provide the data basis for subsequent action category recognition.
[0137] In step S120, the computer device loads the sample image semantics extracted in step S110 into the micro-action learning component in the image action category detection model. The main task of this component is to further identify specific action categories based on image semantic information.
[0138] The micro-action learning component can use a recurrent neural network (RNN) or its variants (such as long short-term memory network LSTM, gated recurrent unit GRU) as its core architecture. RNNs are particularly suitable for processing sequence data because they can capture temporal dependencies in the data. In image action category detection, although a single image itself is not a sequence data, the image semantic feature vector can be regarded as a single element of a sequence, and the entire image learning sample library constitutes a collection of feature sequences. Through RNN, the model can learn the intrinsic connection between different image semantic features, so as to more accurately identify the action category. In practical applications, since image action category detection usually does not need to consider temporal continuity (unlike video action recognition), the micro-action learning component is more likely to use a fully connected layer (FC) or a network structure based on the attention mechanism to process the image semantic feature vector. The fully connected layer can learn the nonlinear mapping relationship between the feature vector and the action category; and the attention mechanism can help the model pay more attention to the most critical part of the image for action recognition.
[0139] When the sample image semantics are loaded into the micro-action learning component, they are first processed through a series of fully connected layers or attention layers. These layers transform and combine the feature vectors to extract key information related to the action category. Subsequently, the model outputs a probability vector representing the predicted probability of each action category. This probability vector is the concrete embodiment of the action category detection results of the sample image.
[0140] Assume that there is an image learning sample library that contains images of three action categories: walking, running, and talking. For an image learning sample labeled "walking", the image semantic feature vector extracted by CNN in step S110 may encode key information such as the person's posture and leg movements. Then, in step S120, the probability vector obtained after processing these feature vectors through a fully connected layer or an attention mechanism may be [0.9, 0.05, 0.05], where the first element 0.9 indicates that the model predicts that the image has the highest probability of belonging to the "walking" action category.
[0141] Through the implementation of step S100 - including steps S110 and S120 - the computer device can use the image action category detection model to extract features and identify action categories for each sample in the image learning sample library. This process not only demonstrates the powerful capabilities of deep learning models in the field of image processing, but also provides valuable data support for subsequent model training and optimization. In practical applications, the appropriate model architecture and parameter settings can be selected according to the characteristics of specific tasks and data sets to achieve the best training effect.
[0142] Based on the image action category detection model obtained by the above debugging, the embodiment of the present application also provides an image recognition method, such as Figure 2 Specifically, the method may include:
[0143] Step S10: performing image action category detection on the target posture images of each core object in the target video through the debugged image action category detection model to determine the target action label corresponding to the target posture image of each core object, wherein the target video includes one or more video time periods and target posture images of several core objects.
[0144] Step S10 is a core part of the image recognition method, which uses the debugged and optimized image action category detection model to perform detailed action category detection on the core objects in the target video. This process requires not only that the model has high accuracy and robustness, but also that it can handle complex and changeable scenes and actions in the video.
[0145] Suppose you are developing an intelligent sports analysis system that aims to automatically identify and analyze athlete actions in sports event videos, such as shooting, dribbling, and defense in basketball games. In this scenario, the target video is a basketball game recording containing multiple video time periods, and the core objects are the athletes in the video. Each athlete will show different action postures in different time periods, and these posture images will become the objects for action category detection.
[0146] The computer device first pre-processes the target video to extract the target pose images of each core object (i.e., athlete). This step may include sub-processes such as video segmentation, object detection, and tracking. Video segmentation divides a long video into multiple time periods that are easy to process; object detection uses object detection algorithms (such as YOLO, Faster R-CNN, etc.) to identify the athletes in the video; object tracking ensures that the same athlete can be continuously tracked in different time periods and extracts its pose images at each time point.
[0147] The target pose image of each core object obtained after preprocessing will be loaded into the debugged image action category detection model. This model may be a carefully designed convolutional neural network (CNN), which contains convolutional layers and pooling layers for extracting image features, as well as fully connected layers for classification. After receiving the pose image, the model will automatically extract the key features in the image and output a probability vector through the fully connected layer, indicating the probability that the image belongs to different action categories.
[0148] The computer device determines the target action tag corresponding to the target posture image of each core object based on the probability vector output by the model. This is usually achieved by selecting the action category corresponding to the maximum value in the probability vector. For example, if the probability vector output by the model for a certain athlete's shooting posture image is [0.1, 0.85, 0.05], the computer device determines the target action tag of the posture image as "shooting".
[0149] For each core object in the target video, the computer device will repeat the above process to obtain its action sequence in different time periods. Then, these action sequences will be integrated to form a comprehensive analysis of the action performance of each core object in the entire game. In addition, the computer device can further analyze advanced features such as action coordination between different athletes and changes in game rhythm, providing more in-depth tactical guidance for coaches and athletes.
[0150] In step S10, the debugged image action category detection model is used to detect the action category of the core object in the target video, thereby achieving accurate extraction and analysis of the action information in the video.
[0151] Step S20: performing content wonderfulness analysis on the target video according to the target action mark corresponding to the target posture image of each core object to obtain a result of the target video content wonderfulness analysis.
[0152] Suppose you are developing a video sharing platform for sports fans. The platform not only provides live broadcasts and replays of sports events, but also allows users to upload their own sports videos and share them with others. In order to improve the user experience, the platform needs a mechanism to automatically evaluate the content of the video so that more attractive videos can be recommended to more users. In this scenario, the target video can be a basketball game video uploaded by the user, a skateboarding skill demonstration, a football goal collection, etc., and the core object is the athlete, skateboarder, etc. in the video.
[0153] In step S10, the computer device has performed image action category detection on the target posture image of each core object and determined the corresponding target action tag. In step S20, these action tags need to be integrated according to the time sequence in which they appear in the video to form an action sequence for each core object. For example, for a video of a basketball game, the action sequences of each player's shooting, dribbling, and defense can be obtained.
[0154] Next, the computer device needs to evaluate the importance of each action tag. The importance of this action depends not only on the nature of the action itself (such as the hit rate of a shot, the difficulty coefficient of a skateboarding action, etc.), but may also be related to the context of the action in the video (such as a buzzer-beater at a critical moment, a wonderful goal after continuous passing, etc.). To achieve this, the platform can pre-define a set of action importance scoring criteria and fine-tune them in combination with expert knowledge or user feedback.
[0155] With the importance score of each action, the computer device can start to calculate the content excitement of the target video. A simple method is to accumulate or weighted average the importance scores of all actions of all core objects in the video. But more sophisticated methods may consider factors such as the coherence between actions, changes in scenes, and emotional reactions of the audience. For example, a continuous dribbling goal action may get a higher excitement score than an isolated shooting action.
[0156] Finally, the computer device presents the calculated content excitement in a visual form, such as excitement score, wonderful clip preview, action highlight collection, etc. These results can not only help the platform automatically recommend high-quality video content to users, but also serve as a quality reference for users to upload videos, encouraging users to upload more exciting videos.
[0157] Taking a video of a basketball game as an example, the computer device first identifies the key players in the video and their action sequences (such as player A's continuous dribbling, player B's buzzer-beating three-pointer, etc.). Then, each action is scored according to the action importance scoring criteria (such as buzzer-beating shots get higher scores). Next, the scores of all actions are accumulated or weighted averaged to obtain the content excitement score of the entire video. Finally, a excitement analysis result page containing a preview of the highlights and a collection of highlights is generated for users to browse and share. In this process, the computer device not only uses the powerful ability of the image action category detection model to identify the action category in the video, but also combines expert knowledge and user feedback to evaluate the importance of the action, thereby achieving a comprehensive analysis of the excitement of the video content. This method not only improves the intelligence level of the video sharing platform, but also provides users with a more personalized and high-quality viewing experience.
[0158] As an implementation manner, the step S20, performing content wonderfulness analysis on the target video according to the target action mark corresponding to the target posture image of each core object to obtain the target video content wonderfulness analysis result, may specifically include:
[0159] Step S21: generating the action evolution optical flow information of each core object in the same video time period according to the target action mark corresponding to the target posture image of each core object in the same video time period and the action reasoning confidence corresponding to the target action mark, wherein the action reasoning confidence is the result obtained by performing image action category detection on the target posture image based on the image action category detection model;
[0160] Step S22: performing content wonderfulness analysis on the target video according to the action evolution optical flow information corresponding to each core object, and obtaining the content wonderfulness analysis result of the target video.
[0161] Suppose you are developing a content excitement evaluation system for an online sports live broadcast platform. The platform receives a large number of sports event videos uploaded by users every day, including football, basketball, tennis and other sports. In order to quickly filter out the most exciting parts from the numerous videos for recommendation, it is necessary to analyze the video content in detail. In this scenario, the core object is the athlete in the video, and the target video is the sports event video uploaded by the user.
[0162] In step S10, the computer device has used the debugged image action category detection model to perform action category detection on the target posture images of each core object (athlete) in the target video, and obtained the action reasoning confidence corresponding to each action tag. This confidence indicates the model's prediction degree that a posture image belongs to a specific action category, and its value range is usually between 0 and 1. For example, in a basketball game, a shooting action may correspond to a confidence of 0.95, indicating that the model is highly confident that the posture image shows a shooting action.
[0163] In step S21, the computer device will focus on multiple core objects and their action tags within the same video time period. It will first identify the action sequences of all core objects within these time periods and collect the action reasoning confidence corresponding to each action tag. The device will then use this information to construct the action evolution optical flow information of each core object within the time period.
[0164] The action evolution optical flow information is a dynamic representation that not only records the action categories of the core object at different time points, but also reflects the continuity and change trend between these actions. In order to construct this information, the computer device can use the optical flow method or similar technology to track the motion trajectory of the core object between video frames, and combine action tags and confidence to annotate the action category and confidence level at each trajectory point.
[0165] Take a basketball game as an example. Suppose that within a certain video time period, player A performs continuous dribbling, breakthrough, and shooting. The computer device will first identify these actions and obtain their corresponding action reasoning confidence (such as 0.85 for dribbling, 0.90 for breakthrough, and 0.95 for shooting). Then, the device will use the optical flow method to track the movement trajectory of player A and mark each action category and confidence at the corresponding position of the trajectory. In this way, an optical flow trajectory containing action evolution information is formed, which intuitively shows the continuity and changes of player A's actions within the time period.
[0166] Continuing with the scenario of the online sports live broadcast platform mentioned above, we now have the optical flow information of the action evolution of each core object in the video time period. Next, the computer device will use this information to analyze the content of the target video.
[0167] Before analyzing the excitement of the content, the computer equipment needs to predefine a set of evaluation indicators to measure the excitement of the video. These indicators may include the difficulty coefficient of the action, the criticality (such as buzzer beaters, reversal scores, etc.), coherence, innovation, and the emotional response of the audience. Different sports may have different evaluation focuses. For example, in a basketball game, buzzer beaters and consecutive breakthroughs may be regarded as highly exciting clips; while in a tennis game, it may be wonderful saves and winning points.
[0168] With the evaluation index, the computer device can start to analyze the excitement of the target video based on the action evolution optical flow information. It will first traverse all time periods and core objects in the video and extract the action evolution optical flow information in each time period. Then, the device will quantify and score this information according to the predefined evaluation index.
[0169] During the scoring process, the device may consider the combined impact of multiple factors. For example, a difficult shooting action (such as a buzzer-beater from outside the three-point line) may receive a higher difficulty coefficient and criticality score; while a series of coherent breakthroughs and scoring actions may receive additional points due to their smooth coherence. In addition, the device may also use natural language processing (NLP) technology to analyze the emotional vocabulary in the audience's comments and barrage to obtain the audience's emotional response score to the video clip.
[0170] Finally, the computer device will summarize and weight the scores of all time periods and core objects (weighted according to factors such as the length of the time period and the importance of the core object) to obtain the content excitement score of the entire target video. In addition, the device can also generate an analysis result page containing a preview of the highlights, a collection of highlights, and a detailed score report for users to browse and share.
[0171] Taking a basketball game video as an example, the computer device may identify multiple highlights during the analysis process, such as player A's consecutive breakthrough scores, player B's buzzer-beater from outside the three-point line, and player C's aerial relay dunk. For each clip, the device will score it based on factors such as the difficulty, criticality, and coherence of its movements, and generate a corresponding highlight score and description. Finally, the device will sort these clips from high to low according to the highlight score, and generate an analysis result page containing highlights and a score report. Users can quickly understand the highlights of the video by browsing this page and share it with others.
[0172] In summary, step S20 achieves a comprehensive evaluation and ranking of the target video content by generating motion evolution optical flow information and performing content analysis. This process not only improves the intelligence level of the video sharing platform, but also provides users with a more personalized and high-quality viewing experience. At the same time, it also demonstrates the broad application prospects of computer vision and machine learning technologies in the field of video processing and analysis.
[0173] As an implementation manner, the step S21 generates the action evolution optical flow information of each core object in the video time period according to the target action mark corresponding to the target posture image of each core object in the same video time period and the action reasoning confidence corresponding to the target action mark, which may specifically include:
[0174] Step S211: when the target posture image includes a target action tag, determining an action score of the target posture image based on the action reasoning confidence corresponding to the target action tag;
[0175] Step S212: when the target posture image includes a plurality of target action tags, determining the action significance of each target action tag according to the action reasoning confidence corresponding to each target action tag;
[0176] Step S213: determining the action score of the target posture image based on the action reasoning confidence corresponding to the target action mark with the largest obvious action amplitude;
[0177] Step S214: generating the action evolution optical flow information of the core object in the video time period based on the sequence order of each target posture image of the core object in the video time period and the action score.
[0178] Step S21 is an important pre-step for content excitement analysis in the image action recognition method. It is responsible for generating action evolution optical flow information based on the target posture images of the core object in the video in the same time period and its corresponding action tags and action reasoning confidence. This information is crucial for the subsequent content excitement evaluation because it provides detailed time series data on the changes in the core object's actions. The following is a detailed explanation of each sub-step S211, S212, S213 and S214 in step S21, which is explained in conjunction with specific application scenarios.
[0179] Suppose you are developing a video highlight extraction function for a professional sports analysis platform. The platform needs to be able to automatically identify and analyze the highlights in sports event videos, such as exciting goals in football games, key breakthroughs in basketball games, etc. In this scenario, the target video is a sports event recording containing multiple video time periods, and the core objects are the athletes in the video. Each athlete will show different action postures in each time period, and these posture images and their corresponding action tags and action reasoning confidence will become the basis for generating action evolution optical flow information.
[0180] When the target posture image contains only one target action tag (i.e., the athlete's action in the image is single), the computer device will directly determine the action score of the target posture image based on the action reasoning confidence corresponding to the action tag. The action reasoning confidence is the prediction confidence given by the image action category detection model when identifying the action category of the target posture image, and its value range is usually between 0 and 1. In order to convert the confidence into a more intuitive scoring form, the computer device can use a simple linear transformation method, such as multiplying the confidence by 100 and rounding it, so as to obtain an integer score between 0 and 100.
[0181] Assume that during a video period of a basketball game, there is an image of a player shooting a basketball, and the confidence of the image action category detection model in identifying the image as a "shooting" action is 0.93. According to the rule of step S211, the computer device multiplies 0.93 by 100 and rounds it to the integer, and obtains an action score of 93 for the target posture image. This score reflects the model's high degree of confidence in the shooting action, and indirectly reflects the potential contribution of the shooting action to the excitement of the video content.
[0182] In practical applications, target pose images may contain multiple target action labels, especially when athletes perform complex movements or interact with other athletes. For example, in a basketball game, a player may show both "dribbling" and "turning" in the same image. In order to more accurately assess the contribution of these movements to the excitement of the video content, the computer equipment needs to be able to distinguish the apparent magnitude of different movements.
[0183] When the target posture image contains multiple target action tags, the computer device determines the action noticeability of each action based on the action reasoning confidence corresponding to each action tag. Action noticeability is a relative indicator used to measure the visual prominence and importance of each action when multiple actions coexist. One possible method is to use action reasoning confidence directly as a quantitative basis for action noticeability. However, this method may not fully reflect the visual differences and importance differences between actions. Therefore, a more sophisticated method may combine expert knowledge or user feedback to define a set of scoring criteria for action noticeability and adjust them according to action reasoning confidence. For the sake of simplicity, it can be assumed that a simplified method is used to calculate the action noticeability: the action reasoning confidence is normalized to eliminate the influence of the absolute value difference of confidence between different actions. The normalized confidence can be regarded as the relative value of the action noticeability.
[0184] Assume that in an image of a target posture in a basketball game, the model recognizes two action markers, "dribbling" and "turning", and the corresponding action reasoning confidences are 0.75 and 0.85, respectively. The computer device first normalizes these two confidences (such as using the minimum-maximum normalization method), and the normalized confidences are 0.43 ((0.75-0.75) / (0.85-0.75)) and 0.57 ((0.85-0.75) / (0.85-0.75)), respectively. Note that the normalization formula here is only an example and needs to be adjusted according to the specific situation in actual application. The normalized confidence reflects the degree to which the "turning" action is more visually obvious than the "dribbling" action.
[0185] However, it should be noted that the above normalization method is logically unreasonable (because both the denominator and the numerator contain the same number, resulting in the result not reflecting the actual situation). In practical applications, an independent normalization method that does not depend on other action confidences in the same image is usually used, or the confidence is directly used as a preliminary estimate of the apparent magnitude of the action. In order to meet the requirements of the question and give a reasonable example, it is assumed that the action reasoning confidence is directly used as the quantitative value of the apparent magnitude of the action (further adjustment may be required in more complex application scenarios).
[0186] Therefore, in this example, the action of "dribbling" has an action magnitude of 0.75, and the action of "turning" has an action magnitude of 0.85. These two values will be used for subsequent action score calculations. After determining the action magnitude of each action in the target pose image, the computer device needs to select a suitable action score to represent the contribution of the entire image to the excitement of the video content. Since the image may contain multiple actions, and the magnitude of these actions varies, it may not be accurate to directly take the average confidence of all actions as the score. On the contrary, it may be more reasonable to select the action with the largest action magnitude as the representative because it is more visually prominent and important. The computer device traverses all action markers in the target pose image and finds the action with the largest action magnitude. Then, it determines the action score of the target pose image based on the action reasoning confidence corresponding to the action. This score will serve as an important basis for the subsequent generation of action evolution optical flow information.
[0187] Continuing with the above example of the basketball game, in a target posture image containing two actions, "dribbling" and "turning around", it has been determined that the action significance of "dribbling" is 0.75, and the action significance of "turning around" is 0.85. Therefore, the action of "turning around" is the most obvious action in this image. The computer device will determine the action score of the target posture image based on the action reasoning confidence of 0.85 corresponding to the action of "turning around". Similarly, in order to obtain an intuitive integer score form, 0.85 can be multiplied by 100 and rounded to 85 points as the action score of the image.
[0188] After determining the action score of each target pose image, the computer device needs to combine these scores with the action sequence of the core object in the video time period to generate action evolution optical flow information. Action evolution optical flow information is a dynamic representation method that not only records the action category and score of the core object at different time points, but also reflects the continuity and change trend between these actions. This is crucial for subsequent content excitement analysis because it provides important clues about the dynamic changes of video content.
[0189] First, the computer device traverses all time periods and core objects in the target video to extract all target posture images of the core objects in each time period and their corresponding action scores. Then it will use the optical flow method or similar technology to track the motion trajectory of the core object between video frames. During the tracking process, the device will mark the action score of each time point on the corresponding trajectory point to form an optical flow trajectory containing action evolution information. The construction of the optical flow trajectory needs to consider multiple factors including the movement speed, direction, acceleration, etc. of the core object. In order to simplify the explanation, it can be assumed that an optical flow estimation algorithm based on feature point matching is used to calculate the motion vector of the core object between adjacent frames. Then the device will interpolate and smooth the action score along the trajectory line according to these motion vectors to obtain continuous and smooth action evolution optical flow information.
[0190] However, it should be noted that in practical applications, the computational complexity of the optical flow method is high and it is sensitive to noise and occlusion. Therefore, in actual deployment, it may be necessary to use a more efficient algorithm or combine it with other technologies (such as the optical flow prediction network in deep learning) to improve computational efficiency and robustness.
[0191] In order to more intuitively display the action evolution optical flow information, the computer equipment can also visualize it. For example, the optical flow trajectory can be represented by lines of different colors, where the depth or brightness of the color can reflect the action score; at the same time, the action category and specific score value can be marked at the key points of the trajectory line so that users can better understand the dynamic change process of the video content.
[0192] Continuing with the above example of basketball game, assume that all the target posture images of player A and their corresponding action scores in a certain time period in the video have been obtained. Now the computer device will use the optical flow method to track the movement trajectory of player A in this time period and mark the action score at each time point on the trajectory line. Assume that player A performs continuous dribbling, breakthrough and shooting actions in this time period, and these actions correspond to different score values (such as dribbling 70 points, breakthrough 85 points, shooting 95 points). Then the computer device will generate an optical flow trajectory line containing these action scores, where breakthrough and shooting actions may be represented by brighter or darker colors on the trajectory line due to their higher scores, while dribbling actions may be represented by lighter colors. In addition, the device can also mark specific action categories and score values at key points of the trajectory line, such as "breakthrough 85 points", "shooting 95 points", etc., so that users can clearly see the evolution of player A's actions in this time period and the changing trend of their excitement.
[0193] In summary, step S21 realizes the generation of the action evolution optical flow information of the core object in the target video through a series of detailed sub-steps. This process not only considers the case of a single action marker, but also handles the complex situation when multiple action markers coexist; at the same time, it also combines multiple factors such as action reasoning confidence and action obvious amplitude to comprehensively evaluate the action score of the target posture image, thereby ensuring that the generated action evolution optical flow information is both accurate and comprehensive. This provides a solid data foundation and support for the subsequent content excitement analysis.
[0194] As an implementation manner, the step S212, determining the apparent amplitude of each target action mark according to the action reasoning confidence corresponding to each target action mark, may specifically include:
[0195] Step SA2121: normalizing the action reasoning confidence corresponding to each target action mark to obtain the action obvious amplitude of each target action mark, wherein the action obvious amplitude is positively correlated with the action reasoning confidence;
[0196] Or, as another implementation, it may include:
[0197] Step SB2121: determining the action significance coefficient corresponding to each target action mark according to the action reasoning confidence and confidence decision threshold corresponding to each target action mark;
[0198] Step SB2122: Determine the action noticeability amplitude of each target action mark according to the action noticeability coefficient corresponding to each target action mark, wherein the action noticeability amplitude is positively correlated with the action noticeability coefficient.
[0199] Step SA2121: Normalization operation to determine the apparent amplitude of the action
[0200] Suppose you are developing an automatic editing function for a sports video editing software, which can automatically extract highlights based on the excitement of the athletes' movements in the video. In this scenario, the target video is a recording of an athlete's game or training, and the core object is the athlete in the video. Each athlete will show different action postures in each time period, and these posture images and their corresponding action tags and action reasoning confidence will become the basis for evaluating the obvious amplitude of the action.
[0201] Normalization is a process of adjusting the numerical range of data to a specific interval (usually 0 to 1). In step SA2121, the computer device normalizes the action reasoning confidence corresponding to each target action tag to eliminate the influence of the absolute value difference of the confidence between different actions, thereby obtaining a relatively consistent action apparent amplitude index. The purpose of normalization is to make the apparent amplitudes between different actions comparable, which is convenient for subsequent analysis and processing.
[0202] There are many normalization methods, the most common ones are minimum-maximum normalization, Z-score normalization, etc. In step SA2121, since the main focus is on the relative size of the action reasoning confidence rather than its absolute distribution, it is more appropriate to use the minimum-maximum normalization method.
[0203] For each target action marker in the target pose image, the computer device will perform the following steps to determine its motion significance:
[0204] First, the action reasoning confidence corresponding to all target action tags in the target pose image is obtained from the image action category detection model. Then, the minimum and maximum values of these confidences are calculated. These two values will be used for subsequent normalization calculations. Next, each action reasoning confidence is converted to a normalized value using the minimum-maximum normalization formula. This normalized value is regarded as the apparent amplitude of the action of the target action tag.
[0205] Assume that in an image of a target posture in a basketball game, the model recognizes two action tags, "dribbling" and "turning past the opponent", with corresponding action reasoning confidences of 0.7 and 0.9 respectively. The computer device will perform the following normalization operations:
[0206] First, determine the minimum and maximum values: the minimum value is 0.7 and the maximum value is 0.9. Then, apply the normalization formula to calculate the apparent amplitude of the "Dribble" action: Apparent amplitude of Dribble = (0.7 - 0.7) / (0.9 - 0.7) = 0. Since the confidence of the "Dribble" action is the minimum value in this image, its normalized apparent amplitude is 0 (in practical applications, in order to avoid division by 0, a small positive number ε is usually added to the denominator).
[0207] Similarly, the apparent amplitude of the “turning and passing” action is calculated: apparent amplitude of the “turning and passing” action = (0.9 -0.7) / (0.9 - 0.7) = 1. Since the confidence of the “turning and passing” action is the maximum value in this image, its normalized apparent amplitude is 1.
[0208] However, it should be noted that although the above normalized results reflect the confidence advantage of the "turning past the opponent" action over the "dribbling" action, they may be too absolute in practical applications. Because even if the confidence of the two actions is not much different, their contributions to the excitement of the video content may be different. Therefore, in some cases, a more complex method may be needed to determine the apparent amplitude of the action.
[0209] As an alternative to step SA2121, steps SB2121 and SB2122 provide a method for determining the magnitude of action significance based on a confidence decision threshold. This method introduces an additional parameter (i.e., confidence decision threshold) to more flexibly evaluate the importance of an action. The following is a detailed explanation of these two steps.
[0210] Continuing the above-mentioned sports video editing software application scenario, steps SB2121 and SB2122 are now used to determine the apparent amplitude of each target action marker. This method is particularly suitable for scenarios that require more refined control of action evaluation criteria.
[0211] The confidence decision threshold is a preset threshold used to distinguish high-confidence and low-confidence action reasoning results. In step SB2121, the computer device will use this threshold to evaluate the confidence level of each target action tag and determine its action obviousness coefficient accordingly. The action obviousness coefficient is a value within a certain interval (such as [-1, +∞)) that is used to quantify the obviousness of the action relative to the threshold.
[0212] For each target action marker in the target pose image, the computer device performs the following steps to determine its action noticeability coefficient:
[0213] First, according to the needs of the application scenario and the characteristics of the model performance, a suitable confidence decision threshold is preset. This value should be able to distinguish the more reliable and unreliable parts of the model recognition results. Then, for each target action tag, the action obvious coefficient is calculated based on the relationship between its action reasoning confidence and the confidence decision threshold. One possible calculation method is:
[0214] ;
[0215] Note that when the action reasoning confidence is lower than the confidence decision threshold, the action noticeability coefficient may be negative or zero (depending on whether negative values are allowed and how to handle this situation). However, in practical applications, it may be more inclined to regard negative values as invalid or low-obvious actions and filter out these actions by setting a minimum noticeability coefficient threshold. After determining the action noticeability coefficient of each target action marker, the computer device will execute step SB2122 to determine its action noticeability amplitude. Since the action noticeability amplitude needs to be positively correlated with the action noticeability coefficient, the action noticeability coefficient can be directly used as a quantized value of the action noticeability amplitude (or after appropriate scaling and translation to meet specific numerical range requirements).
[0216] However, it should be noted that in some cases, directly using the action noticeability coefficient as the action noticeability amplitude may not be intuitive or easy to understand. Therefore, in practical applications, it may be necessary to further process or convert the action noticeability coefficient to obtain a more satisfactory action noticeability amplitude representation. Assume that in the same basketball game target posture image, the model recognizes that the action reasoning confidences corresponding to the two action tags "dribbling" and "turning past the opponent" are 0.75 and 0.95 respectively, and the confidence decision threshold is set to 0.8.
[0217] For the "Dribble" action: ;
[0218] Since the action reasoning confidence is lower than the confidence decision threshold, the action noticeability coefficient is negative. In practical applications, it may be regarded as a low-obvious or invalid action, and the action may be filtered out by setting a minimum noticeability coefficient threshold (such as 0) or its action noticeability amplitude may be set to a small positive value.
[0219] For the "turn and pass" action: ;
[0220] Since the action reasoning confidence is higher than the confidence decision threshold, the action noticeability coefficient is positive and relatively large, reflecting the noticeability of the action relative to the threshold. In practical applications, this value can be directly used as a quantitative value of the action noticeability (or after appropriate scaling and translation to meet specific numerical range requirements).
[0221] In summary, steps SB2121 and SB2122 provide a more flexible and sophisticated method to evaluate the apparent magnitude of each target action marker in the target posture image by introducing the confidence decision threshold. This method not only considers the absolute value of the action reasoning confidence, but also distinguishes the importance of actions at different confidence levels by setting a reasonable threshold, thereby providing more accurate and useful information for subsequent content excitement analysis.
[0222] As an implementation manner, the step S22, performing content wonderfulness analysis on the target video according to the action evolution optical flow information corresponding to each core object to obtain the content wonderfulness analysis result of the target video, may specifically include:
[0223] Step S221: determining the frequency of motion changes of each core object in the video time period according to the motion evolution optical flow information corresponding to each core object;
[0224] Step S222: evaluating the object action wonderfulness of each core object based on the action change frequency to obtain the object action wonderfulness of each core object;
[0225] Step S223: obtaining the target video content excitement analysis result according to the object action excitement of each core object.
[0226] In the overall framework of the image action recognition method, step S22, as the core link of content excitement analysis, undertakes the important task of converting abstract action evolution optical flow information into specific and quantifiable video content excitement evaluation. This step not only requires the computer equipment to accurately capture the action change characteristics of the core object in the video, but also needs to be able to comprehensively evaluate the excitement of the video by integrating these characteristics. The following is a detailed explanation of each sub-step S221, S222 and S223 in step S22.
[0227] Suppose that a video content recommendation system is being developed for a professional sports live broadcast platform. The platform needs to be able to automatically select the most entertaining and exciting clips from a large number of game videos and recommend them to users. In this scenario, the target video is a recording of various sports events, and the core object is the athlete, team, etc. in the video. Through the action evolution optical flow information generated in step S21, the detailed trajectory of the action change of the core object in the video has been mastered. Next, the task of step S221 is to determine the frequency of action changes of each core object in the video time period based on this information. The frequency of action change refers to the speed and diversity of the action change of the core object in the video time period. A core object that frequently changes actions and has a rich variety of actions can often attract the attention of the audience, so its action change frequency is also high. On the contrary, if a core object has fewer action changes or a single action type in the video time period, its action change frequency is low. In order to quantify the frequency of action changes, the computer device can use a variety of methods for analysis. The following is a possible implementation:
[0228] First, a series of key frames are extracted from the motion evolution optical flow information. Key frames are frame images at important time points in the video that can represent the motion changes of the core object. By comparing the differences in the core object motion between adjacent key frames, the speed and diversity of the motion changes can be roughly determined.
[0229] For adjacent key frames, the computer device can use image feature extraction algorithms (such as SIFT, SURF, etc.) to extract the feature points of the core object, and use feature matching algorithms to calculate the difference between the two frames. The greater the difference, the more obvious the change in the action; otherwise, it means that the change in the action is small.
[0230] After obtaining the motion differences of adjacent key frames, the computer device can further count the number of motion changes of the core object and the number of different motion types in the entire video time period. The more motion changes and the richer the motion types, the more frequent the motion changes.
[0231] Finally, the computer device takes into account factors such as the number of action changes, the number of action types, and the degree of action difference, and calculates the frequency of action changes of the core object through weighted average or other complex evaluation models. This value is usually a floating point number between 0 and 1, which is used to indicate the frequency of action changes.
[0232] Take a basketball game as an example. Assume that the core object of attention is a certain player. In a critical period of the game (such as the last few minutes of the fourth quarter), the player dribbled, broke through, passed, and shot many times. After extracting key frames, calculating the difference in actions, and counting the number and type of action changes, the computer equipment concluded that the player's action changes were frequent during this period. This reflects the player's active performance and superb skills at critical moments of the game, and is also an important part of the excitement of the video content.
[0233] After determining the frequency of action changes of each core object, the next step is to evaluate the object action excitement based on this information. The object action excitement refers to the comprehensive evaluation of the core object's actions in terms of viewing, skill, and importance during the video time period. This step is crucial for accurately evaluating the excitement of the video content.
[0234] The excitement of an object's action is a comprehensive evaluation index that combines multiple factors such as the difficulty, viewing experience, innovation, and importance of the action in a competition or performance. An exciting action can often bring a strong visual impact and emotional experience to the audience, thereby enhancing the viewing value of the entire video.
[0235] In order to evaluate the wonderfulness of the object's action, the computer device can use the following steps:
[0236] First, feature information related to the object's motion is extracted from the motion evolution optical flow information. This feature information may include the speed, acceleration, trajectory complexity, motion type, etc. This information will serve as the basic data for subsequent evaluation.
[0237] Define a complete set of excitement evaluation criteria based on the needs of the application scenario and the data in the expert knowledge base. These criteria may include the difficulty coefficient of the action, the viewing score, the innovation bonus items, and the key bonus items. For example, in a basketball game, a difficult three-pointer may have a higher excitement score than an ordinary layup.
[0238] For each action of each core object, the action feature score is calculated based on the excitement evaluation criteria and the extracted action feature information. This process may require the combination of machine learning algorithms or expert systems to achieve automated scoring.
[0239] After obtaining the characteristic score of each action, the computer device performs weighted average or other forms of comprehensive processing on these scores to obtain the overall action excitement score of the core object. This score will serve as an important basis for subsequent video content excitement analysis.
[0240] Continuing with the example of a basketball game, let's assume that the core object of attention is a player who is good at breaking through. During a critical period of the game, the player performed many wonderful breakthrough actions in succession, including difficult skills such as changing direction and dribbling behind the back. The computer equipment collects characteristic information such as the speed, acceleration, and trajectory complexity of these actions, and after calculating them in combination with the excitement evaluation criteria, it is concluded that the excitement of the player's actions during this period is high. This reflects the player's outstanding performance and superb skills in the game, and is also an important highlight of the excitement of the video content.
[0241] After completing the evaluation of the frequency of action changes and the excitement of the object actions of each core object, the computer device will enter step S223, that is, to obtain the overall content excitement analysis result of the target video based on this information. This step is the key link to integrate the individual evaluation results into an overall evaluation, and is also the final output of the entire image action recognition method.
[0242] The video content excitement analysis result is a comprehensive evaluation result of the target video in terms of viewing, skill, importance, etc. It is calculated based on the frequency of action changes of each core object in the video and the excitement of the object action, which can reflect the overall excitement and attractiveness of the video content.
[0243] In order to obtain the video content wonderfulness analysis results, the following steps can be taken:
[0244] First, the frequency of action changes and the object action excitement scores of each core object are integrated. This process may need to consider the importance differences of different core objects in the video (such as the difference between the main players and substitute players) and achieve it through weighted averaging or other forms of weight distribution.
[0245] After integrating the individual evaluation results, the computer device will calculate the overall wonderfulness score of the video according to the preset scoring rules and weight coefficients. This score will serve as a quantitative representation of the wonderfulness analysis results of the video content.
[0246] Finally, the computer equipment integrates the overall wonderfulness score and other relevant information (such as key segment preview, core object performance analysis, etc.) to generate a detailed analysis result report. This report will serve as an important reference for users to understand the wonderfulness of the video content.
[0247] Taking a complete basketball game video as an example, the computer device evaluates the frequency of action changes and the excitement of the object actions of each core object (such as players and teams) in the video through steps S221 and S222. After integrating these individual evaluation results, the computer device calculates the overall excitement score of the entire game video and generates a detailed analysis result report. This report not only contains a quantitative representation of the overall excitement score, but also displays key clip previews in the game, core player performance analysis, etc. Users can quickly understand the excitement and highlights of the game by browsing this report, so as to make more informed viewing choices.
[0248] In summary, step S22 achieves a comprehensive analysis and quantitative evaluation of the content quality of the target video by determining the frequency of action changes, evaluating the object action quality, and integrating individual evaluation results. This process not only improves the accuracy and objectivity of video content evaluation, but also provides users with a more personalized and valuable viewing experience.
[0249] Figure 3 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the hardware entity of the computer device 1000 includes: a processor 1001 and a memory 1002, wherein the memory 1002 stores a computer program that can be run on the processor 1001, and the processor 1001 implements the steps in the method of any of the above embodiments when executing the program.
[0250] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A model debugging method, characterized in that: The method comprises: Using an image action category detection model to perform image action category detection on image learning samples in an image learning sample library to obtain sample image action category detection results corresponding to each image learning sample, wherein the image learning sample library includes the image learning samples and image action category prior information corresponding to the image learning samples; Determine the error correction influence coefficient corresponding to the image learning sample based on the image sample feature information of the image learning sample and the detection result of the sample image action category, wherein the image sample feature information includes one or more of a learning sample difficulty attribute and a number of prior learning samples of the image action category prior information corresponding to the image learning sample, wherein the learning sample difficulty attribute includes a basic learning sample and an advanced learning sample, and the number of prior learning samples indicates the number of image learning samples in the image learning sample library that contain the image action category prior information; Determining an image action category detection error of the image learning sample based on the error correction influence coefficient, the sample image action category detection result, and the image action category prior information; debugging the image action category detection model based on the image action category detection error; The image action category detection model is debugged by two different debugging steps, and the debugging of the image action category detection model based on the image action category detection error includes: In a first debugging step, the image action category detection model is debugged based on a first image action category detection error, where the first image action category detection error is an image action category detection error corresponding to an image learning sample in a first image learning sample library, where the image learning sample in the first image learning sample library includes an image action category prior information; In the second debugging phase, under the premise of the image action category detection model debugged in the first debugging phase, the image action category detection model is debugged based on a second image action category detection error, wherein the second image action category detection error is an image action category detection error corresponding to an image learning sample in a second image learning sample library, and the image learning sample in the second image learning sample library contains one or more image action category prior information; In the first debugging phase, the error correction influence coefficient corresponding to the image learning sample is determined based on the image sample feature information of the image learning sample and the sample image action category detection result, including: Determine a first error correction influence coefficient corresponding to the image learning sample based on the learning sample difficulty attribute of the image learning sample and the sample image action category detection result, wherein the first error correction influence coefficient is used to increase the image action category detection error of the advanced learning sample; Determining a second error correction influence coefficient corresponding to the image learning sample based on the number of prior learning samples of the image action category prior information and the number of first prior information types in the first image learning sample library, wherein the number of the first prior information types represents the number of types of prior information included in the first image learning sample library, and the second error correction influence coefficient is inversely correlated with the number of prior learning samples; The step of determining the image action category detection error of the image learning sample based on the error correction influence coefficient, the sample image action category detection result, and the image action category prior information includes: Determining the first image action category detection error of the image learning sample based on the first error correction influence coefficient, the second error correction influence coefficient, the sample image action category detection result, and the image action category prior information; In the second debugging phase, the error correction influence coefficient corresponding to the image learning sample is determined based on the image sample feature information of the image learning sample and the sample image action category detection result, including: Determine a first error correction influence coefficient corresponding to the image learning sample based on the learning sample difficulty attribute of the image learning sample and the sample image action category detection result, wherein the first error correction influence coefficient is used to increase the image action category detection error of the advanced learning sample; Determine a second error correction influence coefficient corresponding to the image learning sample based on the number of sample prior information types contained in the image learning sample, the number of prior learning samples of the image action category prior information, and the number of second prior information types in the second image learning sample library; The step of determining the image action category detection error of the image learning sample based on the error correction influence coefficient, the sample image action category detection result, and the image action category prior information includes: Determining a second image action category detection error of the image learning sample based on the first error correction influence coefficient, the second error correction influence coefficient, the sample image action category detection result, and the image action category prior information; The determining of the second error correction influence coefficient corresponding to the image learning sample based on the number of sample prior information types contained in the image learning sample, the number of prior learning samples of the image action category prior information, and the number of second prior information types in the second image learning sample library includes: When the number of sample prior information types included in the image learning sample is equal to 1, determining the second error correction influence coefficient corresponding to the image learning sample based on the number of the prior learning samples of the image action category prior information and the number of the second prior information types in the second image learning sample library; When the number of types of sample prior information contained in the image learning sample is greater than 1, the prior information influence coefficient of each image action category prior information is determined according to the number of the prior learning samples of each image action category prior information, and the image action category prior information with the least number of prior learning samples is determined as the target image action category prior information; based on the number of the second prior information types and the difference in influence coefficient between the prior information influence coefficient of the target image action category prior information and the prior information influence coefficient of the remaining image action category prior information, the second error correction influence coefficient corresponding to the image learning sample is determined.
2. The method according to claim 1, characterized in that The image action category detection model is used to perform image action category detection on the image learning samples in the image learning sample library to obtain sample image action category detection results corresponding to each image learning sample, including: Loading each image learning sample in the image learning sample library into the image feature learning component in the image action category detection model to obtain the sample image semantics corresponding to each image learning sample output by the image feature learning component; The sample image semantics are loaded into the micro-motion learning component in the image action category detection model to obtain the sample image action category detection results corresponding to each image learning sample output by the micro-motion learning component.
3. An image recognition method, characterized in that: The method comprises: Performing image action category detection on the target posture images of each core object in the target video through the debugged image action category detection model to determine the target action tag corresponding to the target posture image of each core object, wherein the target video includes one or more video time periods and target posture images of several core objects; wherein the image action category detection model is debugged based on the method of claim 1 or 2; The target video is analyzed for content excitement according to the target action tags corresponding to the target posture images of the core objects to obtain a target video content excitement analysis result.
4. The method according to claim 3, characterized in that The target video is analyzed for content excitement based on the target action mark corresponding to the target posture image of each core object to obtain the target video content excitement analysis result, including: Generate action evolution optical flow information of each core object in the same video time period according to the target action label corresponding to the target posture image of each core object in the same video time period and the action reasoning confidence corresponding to the target action label, wherein the action reasoning confidence is a result obtained by performing image action category detection on the target posture image based on the image action category detection model; The target video is analyzed for content excellence based on the action evolution optical flow information corresponding to each core object to obtain a result of the target video content excellence analysis.
5. The method according to claim 4, characterized in that The method of generating the action evolution optical flow information of each core object in the video time period according to the target action mark corresponding to the target posture image of each core object in the same video time period and the action reasoning confidence corresponding to the target action mark comprises: When the target posture image includes a target action tag, determining an action score of the target posture image based on an action reasoning confidence corresponding to the target action tag; When the target posture image includes a plurality of target action tags, determining the apparent action amplitude of each target action tag according to the action reasoning confidence corresponding to each target action tag; Determining an action score of the target posture image based on an action reasoning confidence corresponding to a target action marker having the largest obvious action amplitude; Based on the sequence order of each target posture image of the core object in the video time period and the action score, generating the action evolution optical flow information of the core object in the video time period; The step of determining the apparent amplitude of each target action mark according to the action reasoning confidence corresponding to each target action mark includes: Normalizing the action reasoning confidence corresponding to each target action mark to obtain the action obvious amplitude of each target action mark, wherein the action obvious amplitude is positively correlated with the action reasoning confidence; or; According to the action reasoning confidence and confidence decision critical value corresponding to each target action mark, the action obvious coefficient corresponding to each target action mark is determined; according to the action obvious coefficient corresponding to each target action mark, the action obvious amplitude of each target action mark is determined, and the action obvious amplitude is positively correlated with the action obvious coefficient.
6. The method according to claim 4, characterized in that The target video is analyzed for content excitement based on the action evolution optical flow information corresponding to each core object to obtain the target video content excitement analysis result, including: Determine the frequency of motion changes of each core object in the video time period according to the motion evolution optical flow information corresponding to each core object; Based on the frequency of action changes, the object action excitement of each core object is evaluated to obtain the object action excitement of each core object; The target video content excitement analysis result is obtained according to the object action excitement of each core object.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps in the method according to any one of claims 1 to 6 are implemented.
