A physical, chemical and biological experiment video description method based on large-scale video-language model and related equipment
By introducing the target frame and hand key point information in the physical and chemical biology operation examination, combined with the self-attention calculation of the video backbone model and the large language model, the problem of low hand operation action recognition accuracy is solved and a higher level is achieved. Experimental description accuracy and consistency.
Patent Information
- Application Number
- CN202410151644.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-02-02
AI Technical Summary
In the existing technology, the accuracy of hand operation movement recognition in physical and chemical biology operation examinations is not high, and it is easily interfered by external factors, such as lighting and scene changes.
A video description method for physical, chemical and biological experiments based on a large-scale video-language model is adopted. By introducing target frame information and hand key point information, combined with the pre-trained video backbone model and large language model, self-attention calculation is performed to generate action description information. , reduce interference from external factors.
It improves the recognition accuracy of hand operation movements, enhances the accuracy and consistency of experimental descriptions, and is suitable for physical and chemical biology experimental teaching and examination fields.
Smart Images

Figure CN118135452B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a physical, chemical and biological experiment video description method based on a large-scale video-language model and related equipment. Background Art
[0002] The physics, chemistry and biology operation test mainly tests students' operation skills and scientific knowledge in actual experiments. The test usually covers three subjects: physics, chemistry and biology, and each subject has different experimental operation requirements.
[0003] With the rapid development of artificial intelligence technology, large language models have achieved remarkable results in various fields. Large language models are deep learning models trained based on massive text data, which can generate natural language text or understand the meaning of language text. Large language models usually contain billions of parameters in scale and are trained and optimized through large-scale training data and computing resources. The most famous large language models currently include GPT-3, BERT, and XLNet.
[0004] Large language models are widely used, including but not limited to text classification, question answering, translation, conversation and other tasks. Since large language models can deeply understand the meaning of text and handle various natural language tasks, they play an important role in the field of artificial intelligence. As the technology continues to mature, the application scope of large language models will continue to expand, providing humans with more intelligent and personalized services, and further improving people's lives and production methods.
[0005] However, there is still a lack of applications related to physics, chemistry and biology operation tests in the market. In particular, the recognition accuracy of hand operation movements in physics, chemistry and biology operation tests is not high and is easily interfered by external factors (such as lighting, scene changes, etc.). Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides a physical, chemical and biological experiment video description method and related equipment based on a large-scale video-language model, which improves the accuracy of identifying hand operation actions and reduces interference from external factors by introducing target frame information and hand key point information.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] In a first aspect, the present invention provides a method for describing a physical, chemical and biological experiment video, which comprises the steps of:
[0009] Obtain video clips of physical, chemical and biological experiments;
[0010] Calling a pre-trained video backbone model to extract features from the physical, chemical and biological experiment video clips to obtain video features;
[0011] Call the cross self-attention module to the video features and three sets of randomly initialized query vectors Q h , Q o , Q v Performing self-attention calculation to obtain a first vector and a second vector, wherein the first vector includes hand and target frame information, and the second vector includes overall video information, the first vector is used to train a large language model, so as to guide the large language model to focus on hand movements and operation areas by introducing the hand and target frame information; the second vector is used to train the large language model to capture the correlation between the text vector and the video vector;
[0012] The pre-trained large language model is called to infer the second vector to generate action description information corresponding to the physical, chemical and biological experiment video clip.
[0013] In an optional implementation, the first vector is used to train a large language model, comprising the steps of:
[0014] Calling the target detection head of the target detection model to perform target and category prediction on the first vector, and performing loss calculation between the result predicted by the target detection head and the true value;
[0015] The semantic detection head of the target detection model is called to perform semantic category prediction on the first vector, and a loss calculation is performed between the prediction result of the semantic detection head and the noun text generated by calling the large language model.
[0016] In an optional implementation, the second vector is used to train a large language model, comprising the steps of:
[0017] A loss is calculated between the second vector and the sentence text generated by calling the large language model.
[0018] In an optional implementation, the loss calculation is performed between the result predicted by the target detection head and the true value, wherein the loss function L box Set it up as follows:
[0019]
[0020] Where b i represents the true target box, Represents the predicted target box information, L iou It represents the intersection and union ratio of the predicted result and the true result.
[0021] The loss calculation is performed between the result predicted by the semantic detection head and the noun text generated by calling the large language model, wherein the loss function L word Set it up as follows:
[0022]
[0023] Where n j represents the j-th noun information learned by the semantic head, n′ k represents the kth noun in the name set D that may appear in physical, chemical and biological experiments, and τ represents a temperature coefficient.
[0024] In an optional implementation, a loss calculation is performed between the second vector and the sentence text generated by calling the large language model, wherein the loss function L v2t ,
[0025]
[0026] In the formula, B represents a batch, i is a sample in the batch, and t j represents the jth sentence text feature, v represents the video feature, and τ is the temperature coefficient. By exchanging t and v in the formula, we can get L t2v .
[0027] In an optional implementation, the first vector is used to train a large language model and the second vector is used to train a large language model, wherein the loss function in the training phase can be expressed as:
[0028] L train =L v2t +L t2v +L box +γL word
[0029] γ is a hyperparameter of noun text and semantic head.
[0030] In an optional implementation, the process of calling the pre-trained large language model to infer the second vector also includes using prompt words to prompt the generation of action description information corresponding to the physical, chemical and biological experiment video clip.
[0031] In a second aspect, the present invention provides a physical, chemical and biological experiment video description device, comprising:
[0032] A data acquisition module, which is used to acquire video clips of physical, chemical and biological experiments;
[0033] A feature extraction module, which is used to call a pre-trained video backbone model to extract features from the physical, chemical and biological experiment video clips to obtain video features;
[0034] Semantic training module, which is used to call the cross self-attention module to the video features and three sets of randomly initialized query vectors Q h , Q o , Q v Performing self-attention calculation to obtain a first vector and a second vector, wherein the first vector includes hand and target frame information, and the second vector includes overall video information, the first vector is used to train a large language model, so as to guide the large language model to focus on hand movements and operation areas by introducing the hand and target frame information; the second vector is used to train the large language model to capture the correlation between the text vector and the video vector;
[0035] A description generation module is used to call the pre-trained large language model to infer the second vector and generate action description information corresponding to the physical, chemical and biological experiment video clip.
[0036] In a third aspect, the present invention further provides an electronic device, including a processor and a memory;
[0037] The memory is used to store programs;
[0038] The processor executes the program to implement the method described above.
[0039] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the method described above.
[0040] In a fifth aspect, the present invention further provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above method.
[0041] Compared with the prior art, the present invention has the following beneficial effects: the present invention applies a large-scale language model to physical, chemical and biological experiments for the first time, thereby improving the accuracy and convenience of describing the experimental process; through the method provided by the present invention, by introducing target frame information and hand key point information, the accuracy of identifying hand operation actions is improved, and external factors interference is reduced; with the help of sentence text and noun text prompts, the alignment of visual features, sentence text and noun text features is achieved, thereby improving the accuracy and consistency of the experimental description; it can be seen that the present invention has broad application prospects in the fields of physical, chemical and biological experimental teaching and examinations, and is expected to promote the innovation and development of physical, chemical and biological experimental operation evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 The present invention is a flowchart of a method for describing a physical, chemical and biological experiment video according to an embodiment of the present invention.
[0044] Figure 2 Schematic diagram of a method for describing a physical, chemical, and biological experiment video according to an embodiment of the present invention.
[0045] Figure 3 A schematic diagram of the structure of a device supporting the method according to an embodiment of the present invention.
[0046] Figure 4 A schematic diagram of an electronic device supporting a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] Example:
[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations of the embodiments of the present invention are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0050] In order to solve the problem that the existing technology has low recognition accuracy for hand operation movements in physics, chemistry and biology operation exams and is easily disturbed by external factors (such as lighting, scene changes, etc.), the existing technology is usually based on target detection and artificial logic, and fails to fully utilize the advantages of pre-trained generative large models, which may lead to the generated experimental descriptions of average quality and lack of sufficient flexibility. The description models for physics, chemistry and biology experiments still need to be improved in terms of adaptability and generalization ability.
[0051] See also Figure 1 and Figure 2 , a physical, chemical and biological experiment video description method provided by an embodiment of the present invention comprises the following steps:
[0052] Step 101: Obtain video clips of physics, chemistry and biology experiments.
[0053] In this step, video clips of physical and chemical experiments in the physical and chemical operation test can be obtained by shooting. The video clips of physical and chemical experiments can be stored in RGB video format. RGB video is a video representation method that uses the three primary colors of red, green and blue as basic color channels. Each pixel is represented by three consecutive bytes, corresponding to the intensity of red, green and blue respectively. The advantage of RGB video is that it can provide high brightness and high contrast colors, and color adjustment and synthesis can be easily performed. In addition, since the RGB format is the standard color space of computer monitors, it is also easy to process and edit in computers.
[0054] Step 102: Call the pre-trained video backbone model to extract features from the physical, chemical and biological experiment video clips to obtain video features.
[0055] In this step, the Video Backbone Model is a deep learning model for video analysis, which usually uses a Vision Transformer pre-trained with a large-scale dataset as the infrastructure. These models are designed to extract features from video frames for subsequent tasks such as target detection, tracking, and behavior recognition. The main function of the Video Backbone Model is to extract features from video frames and convert continuous frame sequences into a series of fixed-length feature vectors. These feature vectors can be used as input to further train models such as classifiers, detectors, and trackers.
[0056] Among them, the pre-trained video backbone model can use pre-trained visual large models such as TimeSformer. TimeSformer has achieved SOTA results on multiple challenging behavior recognition datasets, including Kinetics-400, Kinetics-600, Something-Something-v2, Diving-48, and HowTo100M datasets. Compared with modern 3D convolutional neural networks, TimeSformer training speed has increased by 3 times, and the inference time is only one-tenth of the former. The selected model should be a model pre-trained using large-scale datasets (such as Ego4D, a large-scale first-person perspective video dataset). These datasets contain a large number of hand and operation video images, which are helpful for effective migration to physical, chemical and biological experimental operation tasks.
[0057] Among them, during the training phase, the embodiment freezes the parameters of the backbone model. The purpose of freezing the parameters of the backbone model is to keep certain characteristics or feature extraction capabilities unchanged during the training process. Specifically, freezing the parameters of the video backbone model can prevent the model from overfitting during the training process. Overfitting refers to the phenomenon that the model performs well on the training data but performs poorly on the test data.
[0058] Step 103: Call the cross self-attention module to analyze the video features and three sets of randomly initialized query vectors Q h , Q o , Q v Perform self-attention calculation to obtain a first vector and a second vector, wherein the first vector contains hand and target frame information, and the second vector contains overall video information. The first vector is used to train a large language model to guide the large language model to focus on hand movements and operation areas by introducing the hand and target frame information; the second vector is used to train the large language model to capture the correlation between the text vector and the video vector.
[0059] In this training step, by introducing target frame information and hand key point information, the model is guided to focus on hand movements and operation areas, thereby improving the accuracy of identifying hand operation movements. At the same time, with the help of sentence text and noun text prompts, the model can align visual features, sentence text and noun text features.
[0060] After the video clips are processed by the video backbone model, a set of feature vectors F are obtained. These feature vectors F are passed through a learnable cross self-attention module Query Former (Qformer) and three sets of randomly initialized query vectors Q h (hand), Q o (object target), Q v(video video) performs self-attention calculation to obtain the first vector s and the second vector v. The first vector s (summary) represents the hand and target frame information, while the second vector v (video) represents the overall video information.
[0061] Among them, the calculation formula of self-attention is:
[0062]
[0063] In the formula, Q represents the query vector (including the Q h (hand), Q o (object target), Q v (video video)), softmax refers to the softmax activation function, and K and V are provided by the video feature F.
[0064] The cross-self-attention module is a special attention mechanism that considers the relationship between different positions in the input sequence while calculating the self-attention. The main function of this module is to enhance the model's understanding of the interdependence between different elements in the input sequence, thereby improving the model's representation ability and prediction accuracy. The basic idea of the cross-self-attention module is to divide the input sequence into several subsequences and calculate self-attention for each subsequence. At the same time, when calculating the self-attention of each subsequence, it takes other subsequences into account as contextual information, so that the representation of the current subsequence is not only related to itself, but also to other subsequences. This design enables the cross-self-attention module to better capture the long-distance dependencies and contextual information in the input sequence, thereby improving the performance of the model.
[0065] Among them, the embodiment uses Query Former (Qformer), which is an efficient multimodal learning module in the BLIP2 (Bootstrap Language and Image Pre-training) model. It acts as a bridge between the visual and language models, and realizes the effective alignment of visual information and language information. The core idea of Qformer is to use the cross-attention mechanism to enhance the model's understanding of the interdependence between different elements in multimodal data. This mechanism not only considers the relationship within the sequence, but also considers the interaction between different modalities. It helps the model learn the deep connection between vision and language in the pre-training stage, thereby improving the performance of the model in multimodal tasks such as visual question answering and image description generation.
[0066] Step 104: calling the pre-trained large language model to infer the second vector, and generating action description information corresponding to the physics, chemistry and biology experiment video clip.
[0067] In this reasoning step, only the RGB video clip information is relied upon for reasoning, without the need for target frame information. By combining the pre-trained large language model, the action description information corresponding to the input video clip can be generated.
[0068] In one embodiment, the first vector is used to train a large language model, comprising the steps of:
[0069] Step 201: call the target detection head of the target detection model to perform target and category prediction on the first vector, and calculate the loss between the result predicted by the target detection head and the true value.
[0070] Step 202: calling the semantic detection head of the target detection model to perform semantic category prediction on the first vector, and performing loss calculation between the prediction result of the semantic detection head and the noun text generated by calling the large language model.
[0071] In the above embodiment, the s vector is used to learn and optimize the target frame and hand information. The target frame information and category information can be obtained through the subsequent target detection head and semantic detection head. The specific target frame information processing method is similar to the existing open source solution DETR. The target detection head mainly focuses on objects that are in contact with the hand.
[0072] It is worth noting that the embodiment introduces hand information and target frame information based on the necessity of hand operation in physical, chemical and biological experiments. Before model training, hand and target information can be obtained through manual annotation. During manual annotation, only the hand and the target in contact with it are annotated.
[0073] By calculating the loss between the real target information, the target information predicted by the target detection head and the hand target box, the parameters of Qformer can be optimized, thereby optimizing the output of the global video query vector Qv.
[0074] The loss function of target detection is L box :
[0075]
[0076] In the formula, b i represents the true target box, Represents the predicted target box information, L iou It represents the intersection and union ratio of the predicted result and the true result.
[0077] Therefore, the video-level query vector Q v will be optimized to make the model pay more attention to the actions involved in the hands.v The output result vector v after the self-attention module is calculated with the output result vector of the pre-trained language model for loss calculation to achieve alignment of visual features and language features.
[0078] The pre-trained large language model also freezes the parameters, and its role is as described above. There are two types of text labels: one is noun text, and the other is sentence text. The prompt word can be set as needed. For example, the sentence text prompt starts with "C:", which indicates the prompt word. In the prediction stage, "C:" can be used to prompt the language model to output an action description sentence.
[0079] In the model, the noun text is aligned with the semantic head because the category information of the target box is learned. Noun alignment can be expressed as L word ::
[0080]
[0081] The formula is the cross entropy loss, n j represents the j-th noun information learned by the semantic head, n′ k represents the kth noun in the name set D that may appear in physical, chemical and biological experiments, and τ represents a temperature coefficient.
[0082] Among them, the Large Language Model is a deep learning model trained based on massive text data, which can generate natural language text or understand the meaning of language text. Figure 2 The visual model and the large language model modules are shown in Figure 2. They interact through the cross-self-attention module and finally generate the predicted action description results through the large language model. Figure 2 The part in the dashed box is marked with "For training only", which means that this part is only used in the model training process. In the inference stage, the model does not include this part.
[0083] Figure 2The "pre-trained large language model (also known as text backbone) LLM Encoder" in the article is actually part of the "pre-trained large language model (also known as text backbone) LLM" model. The two refer to the same large language model. In LLM (LargeLanguage Model), the role of the Encoder is to accept the input text sequence and convert it into a fixed-dimensional vector representation. This vector is considered to capture the semantic information of the input text and can be used for further processing, such as generating new text or classifying the input text. Specifically, the Encoder is mainly composed of a transformer encoder layer, which processes the input data through a self-attention mechanism and a feedforward neural network. The functions of the Encoder include embedding, position encoding, self-attention, feedforward neural network, layer normalization, residual connection, and attention mask. These components work together to generate an output representation that can capture the deep semantics and contextual information of the input text for downstream tasks. In the overall architecture, this large language model is responsible for processing text information and interacts with the visual model and cross-self-attention module to achieve the generation of multimodal action descriptions.
[0084] Among them, the object detection head and the semantic detection head are two important components in DETR (Detection Transformer), which are used to achieve object detection and semantic classification tasks. The object detection head is the core part of DETR and is responsible for predicting the location of the object in the image. Specifically, it usually contains a Transformer-based encoder-decoder structure, in which the encoder processes image features and the decoder outputs the location of the object. The core of this head is to predict the coordinates of the object bounding box without involving the category of the object. The object detection head captures the spatial dependencies in the image through the self-attention mechanism and position encoding, and directly predicts the geometric position of the object. The semantic detection head is another important component in DETR, which is responsible for classifying multiple candidate objects generated by the Transformer and outputting their category information. Specifically, the DETR model uses a fully convolutional neural network (FCN) as the semantic detection head, which adds a fully connected layer between the encoder and the decoder to convert the candidate objects generated by the decoder into the final category prediction. This design enables the DETR model to perform both object detection and semantic classification, realizing end-to-end learning and prediction.
[0085] In one embodiment, the second vector is used to train a large language model, including a training step: performing loss calculation between the second vector and a sentence text generated by calling the large language model.
[0086] In the above embodiment, the sentence text (including sentence information) t is aligned with the second vector (including video information) v, which is achieved by the following loss function formula. This formula is derived from the symmetric cross entropy loss in the CLIP model. It is used to measure the degree of alignment between the sentence text and the video. The loss function is L t2v At the same time, by exchanging t and v in the formula, we can get the loss function L that represents the alignment of video and sentence text v2t This symmetric loss function plays an important role in the model, helping it capture the correlation between text and video, thereby improving multimodal understanding.
[0087]
[0088] In the formula, B represents a batch, i is a sample in the batch, and t j represents the jth sentence text feature, v represents the video feature, and τ is the temperature coefficient. By exchanging t and v in the formula, we can get L t2v .
[0089] Finally, the loss function of the training phase can be expressed as:
[0090] L train =L v2t +L t2v +L box +γL word
[0091] Among them, γ is a hyperparameter of noun text and semantic head, ranging from 0 to 1.
[0092] In one embodiment, the process of calling the pre-trained large language model to infer the second vector also includes using prompt words to prompt the generation of action description information corresponding to the physical, chemical and biological experiment video clip.
[0093] In the above embodiment, in the inference stage, the second vector (containing video information) is predicted by the pre-trained large language model and the prompt word "what the current action is doing", thereby obtaining a description of the action. It is worth noting that the two pre-trained large language models in the figure are consistent, but they are drawn in different areas in the figure.
[0094] It should be noted that the pre-trained large model used by the video backbone model and the large language model can adopt different models in practice. The present invention does not specify the use of a specific model, and the specific model selection can be adjusted according to actual needs and task characteristics.
[0095] This embodiment applies a large-scale language model to physical, chemical and biological experiments for the first time, improving the accuracy and convenience of the description of the experimental process. Through the method provided in this embodiment, by introducing target frame information and hand key point information, the accuracy of identifying hand operation actions is improved, and external factors interference is reduced. With the help of sentence text and noun text prompts, the alignment of visual features, sentence text and noun text features is achieved, and the accuracy and consistency of the experimental description are improved. It can be seen that it has broad application prospects in the fields of physical, chemical and biological experimental teaching and examinations, and is expected to promote the innovation and development of physical, chemical and biological experimental operation evaluation.
[0096] Example 2
[0097] See also Figure 3 Based on the same inventive concept, the embodiment of the present invention further provides a physical, chemical and biological experiment video description device, which includes:
[0098] A data acquisition module, which is used to acquire video clips of physical, chemical and biological experiments;
[0099] A feature extraction module, which is used to call a pre-trained video backbone model to extract features from the physical, chemical and biological experiment video clips to obtain video features;
[0100] A semantic training module, which is used to call a cross self-attention module to perform self-attention calculation on the video features and three sets of randomly initialized query vectors Qh, Qo, and Qv to obtain a first vector and a second vector, wherein the first vector contains hand and target frame information, and the second vector contains overall video information. The first vector is used to train a large language model to guide the large language model to focus on hand movements and operation areas by introducing the hand and target frame information; the second vector is used to train a large language model to capture the correlation between a text vector and a video vector;
[0101] A description generation module is used to call the pre-trained large language model to infer the second vector and generate action description information corresponding to the physical, chemical and biological experiment video clip.
[0102] Since the device is a device corresponding to the physical, chemical and biological experiment video description method of the embodiment of the present invention, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation process of the above method embodiment, and the repeated parts will not be repeated.
[0103] Example 3
[0104] See also Figure 4Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the physical, chemical and biological experiment video description method as described above.
[0105] It is understandable that the memory may include a random access memory (RAM) or a read-only memory (ROM). In an optional embodiment, the memory includes a non-transitory computer-readable storage medium. The memory may be used to store instructions, programs, codes, code sets, or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data created according to the use of the server, etc.
[0106] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect the various parts of the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. In an optional embodiment, the processor can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor can integrate one or more combinations of a central processing unit (CPU) and a modem. Among them, the CPU mainly processes operating systems and applications, etc.; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor, but may be implemented separately through a chip.
[0107] Since the electronic device is the electronic device corresponding to the physical, chemical and biological experiment video description method of the embodiment of the present invention, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation process of the above method embodiment, and the repeated parts will not be repeated.
[0108] Example 4
[0109] Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the physical, chemical and biological experiment video description method as described above.
[0110] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0111] Since the storage medium is the storage medium corresponding to the physical, chemical and biological experiment video description method of the embodiment of the present invention, and the principle of solving the problem by the storage medium is similar to that of the method, the implementation of the storage medium can refer to the implementation process of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0112] Example 5
[0113] In some possible implementations, various aspects of the method of the embodiment of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the physical, chemical and biological experiment video description method according to various exemplary embodiments of the present application described above in this specification. Among them, the executable computer program code or "code" for executing each embodiment can be written in a high-level programming language such as C, C++, C#, Smalltalk, Java, JavaScript, Visual Basic, structured query language (e.g., Transact-SQL), Perl, or in various other programming languages.
[0114] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0115] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0116] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable ordinary technicians in the field to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made based on the essence of the content of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for describing a physical, chemical and biological experiment video, characterized in that: Includes steps: Obtain video clips of physical, chemical and biological experiments; Calling a pre-trained video backbone model to extract features from the physical, chemical and biological experiment video clips to obtain video features; Call the cross self-attention module to the video features and three sets of randomly initialized query vectors Q h , Q o , Q v Perform self-attention calculation to obtain a first vector and a second vector, wherein the formula for the self-attention calculation is: In the formula, Q represents the query vector, and softmax refers to the softmax activation function; The first vector includes hand and target frame information, and the second vector includes overall video information. The first vector is used to train a large language model to guide the large language model to focus on hand movements and operation areas by introducing the hand and target frame information. The first vector is used to train a large language model, including the following training steps: calling a target detection head of a target detection model to perform target and category prediction on the first vector, and performing loss calculation between the result predicted by the target detection head and the true value; calling a semantic detection head of a target detection model to perform semantic category prediction on the first vector, and performing loss calculation between the result predicted by the semantic detection head and the noun text generated by calling the large language model; performing loss calculation between the result predicted by the target detection head and the true value, wherein the loss function L box Set it up as follows: Where b i represents the true target box, Represents the predicted target box information, L iou It represents the intersection and union ratio of the predicted result and the true result; The loss calculation is performed between the result predicted by the semantic detection head and the noun text generated by calling the large language model, wherein the loss function L word Set it up as follows: Where n j represents the j-th noun information learned by the semantic head, n' k represents the kth noun in the name set D that may appear in physical, chemical and biological experiments, and τ represents a temperature coefficient; The second vector is used to train the large language model to capture the correlation between the text vector and the video vector; the second vector is used to train the large language model, including the training steps of: performing loss calculation between the second vector and the sentence text generated by calling the large language model; performing loss calculation between the second vector and the sentence text generated by calling the large language model, wherein the loss function L v2t , In the formula, B represents a batch, i is a sample in the batch, and t j represents the jth sentence text feature, v represents the video feature, τ is the temperature coefficient, and swapping t and v in the formula yields L t2v ; The first vector is used to train the large language model and the second vector is used to train the large language model, wherein the loss function in the training phase is expressed as: THE train =L v2t +L t2v +L box +γL word γ is the hyperparameter of noun text and semantic head; The pre-trained large language model is called to infer the second vector to generate action description information corresponding to the physical, chemical and biological experiment video clip.
2. The method for describing physical, chemical and biological experiment videos according to claim 1, characterized in that: The process of calling the pre-trained large language model to infer the second vector also includes using prompt words to prompt the generation of action description information corresponding to the physical, chemical and biological experiment video clip.
3. A physical, chemical and biological experiment video description device, characterized in that: include: A data acquisition module, which is used to acquire video clips of physical, chemical and biological experiments; A feature extraction module, which is used to call a pre-trained video backbone model to extract features from the physical, chemical and biological experiment video clips to obtain video features; Semantic training module, which is used to call the cross self-attention module to the video features and three sets of randomly initialized query vectors Q h , Q o , Q v Perform self-attention calculation to obtain a first vector and a second vector, wherein the formula for the self-attention calculation is: In the formula, Q represents the query vector, and softmax refers to the softmax activation function; The first vector includes hand and target frame information, and the second vector includes overall video information. The first vector is used to train a large language model to guide the large language model to focus on hand movements and operation areas by introducing the hand and target frame information. The first vector is used to train a large language model, including the following training steps: calling a target detection head of a target detection model to perform target and category prediction on the first vector, and performing loss calculation between the result predicted by the target detection head and the true value; calling a semantic detection head of a target detection model to perform semantic category prediction on the first vector, and performing loss calculation between the result predicted by the semantic detection head and the noun text generated by calling the large language model; performing loss calculation between the result predicted by the target detection head and the true value, wherein the loss function L box Set it up as follows: Where b i represents the true target box, Represents the predicted target box information, L iou It represents the intersection and union ratio of the predicted result and the true result; The loss calculation is performed between the result predicted by the semantic detection head and the noun text generated by calling the large language model, wherein the loss function L word Set it up as follows: Where n j represents the j-th noun information learned by the semantic head, n k represents the kth noun in the name set D that may appear in physical, chemical and biological experiments, and τ represents a temperature coefficient; The second vector is used to train the large language model to capture the correlation between the text vector and the video vector; the second vector is used to train the large language model, including the training steps of: performing loss calculation between the second vector and the sentence text generated by calling the large language model; performing loss calculation between the second vector and the sentence text generated by calling the large language model, wherein the loss function L v2t , In the formula, B represents a batch, i is a sample in the batch, and t j represents the jth sentence text feature, v represents the video feature, τ is the temperature coefficient, and swapping t and v in the formula yields L t2v ; The first vector is used to train the large language model and the second vector is used to train the large language model, wherein the loss function in the training phase is expressed as: THE train =L v2t +L t2v +L box +γL word γ is the hyperparameter of noun text and semantic head; A description generation module is used to call the pre-trained large language model to infer the second vector and generate action description information corresponding to the physical, chemical and biological experiment video clip.
4. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction and at least one program, and the at least one instruction and the at least one program are loaded and executed by the processor to implement the physical, chemical and biological experiment video description method as described in any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction and at least one program, and the at least one instruction and the at least one program are loaded and executed by the processor to implement the physical, chemical and biological experiment video description method as described in any one of claims 1 to 2.
