Zero-shot learning intelligent early warning method driven by multimodal deep learning
The zero-shot learning method driven by multi-modal deep learning solves the limitations of multi-modal data application in existing technologies, achieves precise analysis of surveillance videos and pedestrian behavior recognition, and improves the accuracy and accuracy of alert management. Response speed, intelligent upgrade to adapt to complex scenarios.
Patent Information
- Application Number
- CN202410884014.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Existing technologies rely on predefined target category lists in intelligent customer service systems, which limits their application in actual scenarios and cannot effectively identify and process multi-modal data under unqualified conditions.
Using a zero-shot learning method based on multi-modal deep learning, by creating and starting tasks, real-time surveillance videos are obtained, the intrusion area is delineated, multi-modal algorithms are used for detection and analysis, and target information is sent to the multi-modal inference model for in-depth analysis. Analyze, display intrusion information and categories on the front-end intelligent scheduling platform, and trigger alarm and notification processing.
It achieves seamless coverage of surveillance scenes, accurately parses video streams, extracts pedestrian dynamic information, improves the accuracy and response speed of alert management, enhances the flexibility and efficiency of security management, and can independently adapt to complex scenes to identify potential threats.
Smart Images

Figure CN118429899B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning multimodal video processing, and in particular to a zero-shot learning intelligent early warning method driven by multimodal deep learning. Background Art
[0002] Around 2000, the rise of the Internet promoted the application of cross-modal retrieval. In the early days of search engines, people used text (keywords) to search for images and videos. In recent years, image-based search and video-based search have emerged. Then, the understanding of human social behavior based on multimodal data was proposed. By analyzing the information of conference recordings, human emotions can be recognized. After 2015, tasks combining vision and language have emerged in large numbers and gradually become hot topics. The representative task is image description, that is, generating a sentence to describe the main content of a picture. Of course, tasks such as text-to-image, video-to-text, and text-to-video have also been proposed.
[0003] Many researchers have proposed many solutions. Progress in the field of open vocabulary object detection has achieved the ability to identify and locate a variety of different targets. However, the application of these methods has certain limitations. For models under unrestricted conditions, they rely on a predefined list of target categories during reasoning, which limits their application in practical scenarios.
[0004] Patent CN109033378A discloses a method for applying zero-shot learning in an intelligent customer service system, including a general model preparation stage and a general model prediction stage. The general NLU model of the enterprise is trained semi-automatically. If the application party encounters new NLU requirements in the future, it does not need new corpus sample data to classify new semantic understanding requirements; however, excessive reliance on a predefined list of target categories limits its application in actual scenarios.
[0005] In summary, a zero-shot learning method driven by multimodal deep learning is needed to address the shortcomings of the existing technology. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention provides a zero-shot learning intelligent early warning method driven by multimodal deep learning, aiming to solve the above problems.
[0007] To achieve the above object, the present invention provides the following technical solution: a zero-time learning intelligent early warning method driven by multimodal deep learning, comprising the following steps:
[0008] Step S1: Create and start a task, obtain real-time monitoring video, and start a multimodal anomaly intrusion detection task;
[0009] Step S2: Area demarcation: demarcate the intrusion area in the real-time monitoring video, use the pedestrian intrusion multimodal algorithm to perform real-time detection and analysis, and obtain pedestrian intrusion target information;
[0010] Step S3: Send the detected pedestrian intrusion target information to the multimodal reasoning model for in-depth analysis;
[0011] Step S4: Early warning display: the front-end intelligent scheduling platform displays the intrusion information according to the inference result, including the intrusion location and category;
[0012] Step S5: Notification processing. After the alarm is triggered, the system notifies and dispatches relevant staff to go to the scene for processing.
[0013] Optionally, the real-time detection and analysis of the real-time monitoring video in step S2 is:
[0014] Step S21: Obtain camera address and callback address parameters;
[0015] Step S22: Start a new process, start capturing image frames from the camera's video stream, store them in redis, and notify the listening program at the same time;
[0016] Step S23: The monitoring program receives the notification, retrieves the image frame from redis, starts to create an algorithm instance, and calls the algorithm instance to start analyzing the image frame;
[0017] Step S24: the algorithm instance analyzes the image frame according to the business logic, stores the analysis results in redis, and notifies the listening program at the same time;
[0018] Step S25: The monitoring program receives the notification, retrieves the results, and submits the analysis results to the business interface.
[0019] Optionally, the test training image data in the multimodal reasoning model in step S3 is prepared as follows:
[0020] Mobile phone image data collection: Use mobile phones to collect target images, which are divided into distant target images and near-field target images. Each type of collected image is divided into two columns and placed in a table. The first column is for near-field target images, and the second column is for distant target images. Image collectors place the collected surveillance video images or mobile phone images in the table on a daily basis, and each image is accompanied by a corresponding text description to obtain mobile phone collected image data;
[0021] Surveillance video image acquisition: In the surveillance video, find L videos containing pedestrians at different locations, different times and different weather conditions. Vi represents the i-th video. There are Ni video images in Vi. Select Mi video images from Ni video images as training and test images. Then, we can obtain video images are used as training and testing images to obtain monitoring video image data;
[0022] The image data collected by the mobile phone and the surveillance video image data are used as the test and training image data of the multimodal reasoning model.
[0023] Optionally, before the multimodal reasoning model is tested and trained, the test training image data is enhanced, and the enhancement method is:
[0024] Color transformation: perform data enhancement in the color channel space, such as closing a certain color channel or changing the brightness value;
[0025] Rotation transformation: select an angle, rotate the image left or right, and change the direction of the image content;
[0026] Add noise: a matrix of values sampled from a Gaussian distribution is added to the image;
[0027] Sharpening and blurring: Use Gaussian and Laplacian operators to process images;
[0028] Scaling transformation: the image is enlarged or reduced in proportion;
[0029] Translation transformation: moves the image in four dimensions: up, down, left, and right;
[0030] Flip transformation: flip the image along the horizontal or vertical axis;
[0031] Cropping transformation: including center cropping and random cropping;
[0032] Affine transformation: perform a linear transformation on the image followed by a translation transformation.
[0033] Optionally, the multimodal reasoning model in step S3 includes image input, image text description input, text encoder, image feature convolution network and visual language path aggregation network;
[0034] The image text description input inputs the image text description into the text encoder for feature extraction. At the same time, the image input inputs the image into the image feature convolutional network for feature extraction to obtain the corresponding features, which are processed by the visual language path aggregation network to fuse the single-modal to multi-modal information and enhance the interactive understanding between image and text.
[0035] Optionally, the multimodal pre-training method is:
[0036] The image is input into the image encoder to obtain some features, and the text is input into the text encoder to obtain some features. There are n image and text pairs in each transferring batch, and the features of n images and n texts are obtained, and then comparative learning is performed on these features.
[0037] Optionally, the multimodal zero-shot learning reasoning method is:
[0038] Step a: extract features from text and images using a pre-trained multimodal model;
[0039] Step b: using prompt template technology, convert the target category into a natural language description form to obtain a text description set;
[0040] Step c: input the text description set into a pre-trained text encoder to obtain a text feature vector corresponding to each category;
[0041] Step d, using an image encoder to extract a feature vector from the image;
[0042] Step e, calculating the cosine similarity between the feature vector of the image to be classified and the feature vectors of all the texts in step c;
[0043] Step f: Select the category corresponding to the text feature that is most similar to the feature vector of the image to be classified as the prediction result.
[0044] Optionally, the image feature convolution network includes a two-dimensional convolution layer, a batch normalization layer and a SiLU activation function.
[0045] The 2D convolution layer uses a convolution kernel of size k and a step size s of 2 to perform downsampling operations, reduce the size of the feature map and increase the number of channels;
[0046] Batch normalization layer, which is used to standardize each mini-batch of data so that the features have zero mean and unit variance to speed up the training process;
[0047] SiLU activation function is used to enhance the nonlinear expression ability of the model.
[0048] Optionally, the operation of the visual language path aggregation network includes the following steps:
[0049] Step A: Image feature aggregation: From the multi-scale image features, use the maximum pooling operation to extract the features of the 3*3 region;
[0050] Step B, text embedding update: Update the text embedding weights through a multi-head attention mechanism; the multi-head attention here acts on the updated image block features and the original text embedding itself.
[0051] Optionally, the model iteration of the multimodal reasoning model is:
[0052] Collect new data, input the data into the multimodal reasoning model, obtain the detection results, divide the detection results into true target images and false alarm target images, annotate and enhance the false alarm target images, and then train a new model based on the original model. Test the new model to check whether the accuracy meets the standard. If not, add new data and adjust the network parameters for training. If so, stop training.
[0053] Beneficial effects of the present invention:
[0054] In the present invention, relying on the existing fixed camera infrastructure, no additional hardware deployment is required, and seamless coverage of the monitoring scene is achieved. At the algorithm level, the latest computer vision and deep learning technologies are integrated, which can accurately parse the video stream, accurately extract the dynamic information of pedestrians from complex backgrounds, and conduct in-depth analysis of their behaviors. This intelligent detection system can not only keenly capture any pedestrian activity patterns that deviate from the normal, such as illegal intrusion, cross-border behavior, etc., but also effectively filter out environmental interference and false alarms, greatly improving the accuracy and response speed of alarm management.
[0055] In this invention, the perimeter warning management system builds a convenient, efficient and highly transparent information management platform, deeply integrating advanced deep learning technology to drive the intelligent upgrade and optimization operation mechanism of perimeter protection. This system not only greatly enhances the flexibility and response speed of security management, but also ensures the accuracy and breadth of perimeter monitoring, creating a comprehensive and automated warning management ecosystem for users. Through the continuous optimization and learning of deep learning algorithms, the system can autonomously adapt to various complex scenarios and realize the rapid identification and disposal of potential threats, thereby ensuring safety while also promoting a significant improvement in management efficiency.
[0056] In the present invention, once an abnormal intrusion incident is discovered, the system will not only automatically record and archive it in detail, providing accurate evidence support for the subsequent review and investigation of the management department, but will also immediately trigger the early warning process and push the alarm information to the mobile devices of relevant personnel. The instant messaging function ensures that security personnel can obtain the alarm information in the first time, arrive at the scene quickly, and take necessary measures to deal with the emergency, effectively improving the speed and efficiency of emergency response. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The present invention is a flowchart of an architecture implementation of the method of the present invention.
[0058] Figure 2 The present invention is an interface processing flow chart of the method of the present invention.
[0059] Figure 3 A diagram of the architecture of the multimodal network of the present invention.
[0060] Figure 4 An architecture diagram of an image feature convolutional network.
[0061] Figure 5 An architectural diagram of a key-value buffer decoder.
[0062] Figure 6 It is a structural diagram of the local layer in the crossover stage.
[0063] Figure 7 A structural diagram of the dark network bottleneck block.
[0064] Figure 8 A structural diagram of the local self-attention mechanism module.
[0065] Fig. 9 A framework diagram for the visual-language path aggregation network. DETAILED DESCRIPTION
[0066] In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0067] In conjunction with the instruction manual Figure 1 To Attachment Fig. 9 , this technical solution is described in detail.
[0068] A zero-shot learning intelligent early warning method driven by multimodal deep learning is applied in pedestrian abnormal intrusion detection to solve the problem of intelligent monitoring of pedestrian abnormal intrusion targets based on fixed cameras in campus perimeter security management. The method is based on the fixed-point fixed cameras that have been built for campus perimeter security management, and calls the algorithm to automatically detect abnormal pedestrian intrusion target monitoring in the monitoring screen; the method provides a convenient, fast and open information management space for campus perimeter security management, and relies on deep learning technology to realize intelligent management and efficient operation of campus perimeter security; the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0069] The present invention provides a multimodal deep learning driven zero-shot learning method for the application of pedestrian abnormal intrusion detection for field applications, wherein the algorithm flow is as follows: Figure 1As shown, the application process of the present invention is to detect abnormal pedestrian intrusion targets in the surveillance video, and then transmit the detected targets to the zero-shot learning inference model of multimodal training to predict the abnormal pedestrian intrusion at different granularities, and finally display and warn the abnormal pedestrian intrusion border position and the category of out-of-store merchandise through the scheduling platform; it includes multimodal algorithms and detection equipment, image acquisition equipment and intelligent display equipment.
[0070] Video analysis algorithm task flow, such as Figure 2 : First, the system designs an interface that receives key parameter inputs, including the URL of the camera, the algorithm category used, and the callback address. Once these parameters are received, the interface triggers a new process that aims to continuously capture image frames from the camera video stream and temporarily store these frames in a Redis database. This action then activates a listening service that monitors the arrival of new data.
[0071] Next, after receiving the notification of the new image frame, the monitoring program quickly extracts the image from Redis and starts to initialize a specific algorithm instance. This algorithm instance is based on two core technologies: convolutional neural network (CNN) for target detection, and multimodal zero-shot learning inference algorithm integrated with self-attention mechanism, which aims to achieve high-level image understanding and classification. The combination of these two algorithms is particularly suitable for accurately identifying abnormal pedestrian intrusion events in fixed-point monitoring scenarios. It can not only effectively record such behaviors, but also provide detailed data support for subsequent review and management.
[0072] After the analysis is completed, the algorithm instance will write the information containing the recognition results back to Redis and notify the listening program again. After receiving the analysis conclusion, the listening program immediately passes it to the business layer through the callback interface to achieve instant response. In this way, the management department can quickly obtain the alarm information and dispatch personnel to the scene in time, which significantly improves the monitoring efficiency and emergency response speed.
[0073] The above process focuses on the specific application scenarios of abnormal pedestrian intrusion monitoring and multimodal category reasoning. This technical framework demonstrates a high degree of flexibility and scalability, and can easily adapt to and integrate into a variety of application scenarios, far beyond the scope shown in the current examples. In actual deployment, this solution can be adjusted and optimized according to different needs and widely used in various monitoring and analysis scenarios.
[0074] Training and testing data for the multimodal model of pedestrian intrusion targets in a single video image:
[0075] Mobile phone image data collection: Image collectors use mobile phones to collect target images, which are divided into distant target images and close-up target images; each type of collected image is divided into two columns and placed in a table, with close-up target images in the first column and distant target images in the second column. Image collectors place the collected surveillance video images or mobile phone images in the table on a daily basis, and each image is accompanied by a corresponding text description.
[0076] Surveillance video image acquisition: In the surveillance video, find L videos containing pedestrians at different locations, different times and different weather conditions. Vi represents the i-th video. There are Ni video images in Vi. Select Mi video images from Ni video images as training and test images. Then, we can obtain Video images are used as training and testing images.
[0077] Data augmentation methods for training data images:
[0078] The collected basic data is enhanced by the following method:
[0079] 1). Color transformation: perform data enhancement in the color channel space, such as closing a certain color channel or changing the brightness value;
[0080] 2). Rotation transformation: Select an angle and rotate the image left or right to change the direction of the image content;
[0081] 3). Add noise: a matrix of random values sampled from a Gaussian distribution is added to the image;
[0082] 4). Sharpening and blurring: Use Gaussian operators, Laplacian operators, etc. to process images;
[0083] 5). Scaling transformation: the image is enlarged or reduced in proportion without changing the content of the image;
[0084] 6). Translation transformation: move the image in four dimensions: up, down, left, and right;
[0085] 7). Flip transformation: Flip the image about the horizontal or vertical axis;
[0086] 8). Cropping transformation: mainly center cropping and random cropping;
[0087] 9). Affine transformation: perform a linear transformation on the image and then a translation transformation;
[0088] In the training phase of neural networks, AutoAugment is widely used as an advanced data enhancement technology. It explores the optimal data enhancement strategy based on neural architecture search (NAS). This process involves using a search algorithm to customize the most effective enhancement scheme for a specific target dataset in a carefully designed set of image enhancement operations. This search space is flexible and can contain different numbers and types of image transformation sub-strategies according to the different characteristics of the dataset, ensuring that the enhancement scheme is highly targeted.
[0089] Each sub-strategy combines two different image transformation operations to bring unique changes to each training image. The process of selecting a sub-strategy is random, which further enhances the diversity of the data. Furthermore, even if a sub-strategy is selected, whether each transformation within it is executed is determined by a preset probability. This randomness introduces additional uncertainty, which helps improve the generalization ability of the model.
[0090] As a core network optimization method, data augmentation is valuable because it effectively pushes the boundaries of visual task performance by providing rich and diverse training samples generated through manual design or automatic search. This method can not only significantly improve the performance of deep learning models, but also effectively curb overfitting, that is, the model over-learns the noise in the training data rather than the generalized pattern. In addition, as the technology matures, it has become increasingly easy to implement AutoAugment and other data augmentation strategies, becoming an indispensable tool for improving model robustness and promotion capabilities.
[0091] Multimodal network architecture such as Figure 3As shown: The framework consists of three parts: text encoder, image feature convolutional network, and reparameterizable visual language path aggregation network; there are two inputs, one is image input and the other is image text description input. The dimension of the image is [n,h,w,c], and the dimension of the text is [n,l], where l refers to the sequence length. Then, they are sent to their respective text encoders and image feature convolutional networks to extract features. After obtaining the corresponding features, they are passed through a reparameterizable visual language path aggregation network (i.e., Wi and Wt). The significance of the reparameterizable visual language path aggregation network is to learn such as How to change from single modality to multimodality, after projection, do l2 normalization, and you get the final features Ie and Te for comparison. Now there are n image features and n text features. The next step is to calculate the cosine similarity. The calculated similarity is the logits to be classified in the end. Finally, the logits and labels are cross-entropy loss. The positive sample is the element on the diagonal. The dimension of logits is [n,n], and the label is np.arange(n). Two loss values are calculated, one for the image and the other for the text. Finally, the two loss values are added together to get the average. This operation is very common in contrastive learning, using a symmetric objective function; the text encoder uses the Swin-T backbone network architecture.
[0092] Multimodal model building; current computer vision systems train models to predict a fixed, pre-defined set of target categories (such as ImageNet has 1,000 categories and COCO has 80 categories). This supervision method is relatively limited because it requires additional labeled data, which limits generalization. If there are new categories, you have to collect data again. Learning directly from the original text related to the image is a promising alternative that takes advantage of a wider range of supervision sources. Given some text descriptions and some images, predict which title goes with which image. This pre-training task is an effective and scalable way to learn the optimal image representation from scratch on a dataset of 400 million (image, text) pairs collected from the Internet. And it can achieve performance similar to that of supervised baseline methods without any dataset-specific training.
[0093] Most current computer vision models focus on the recognition task of predefined target categories, such as the 1,000 categories covered by ImageNet or the 80 categories of the COCO dataset. The limitation of this type of supervised learning method is that it is highly dependent on manually labeled data, which not only limits the generalization ability of the model, but also means that when encountering new categories, the corresponding data must be collected and labeled again, increasing time and resource costs.
[0094] In contrast, a promising new approach is to let the model learn directly from the natural language text associated with the image, taking advantage of this richer and more flexible source of supervision signals. Specifically, given a set of text descriptions and images, the model is trained to match the correct image and text description pairs, and this pre-training task mechanism becomes an efficient and scalable solution. This approach shows great potential on large-scale unsupervised datasets. For example, in a dataset containing 400 million image-text pairs collected from the Internet, the model can learn from scratch and extract high-quality image feature representations.
[0095] It is particularly worth mentioning that the model trained by this unsupervised learning strategy has been able to achieve a performance level close to or even comparable to that of traditional supervised learning methods without relying on any specific data set fine-tuning. This not only demonstrates the powerful potential of multimodal learning, but also opens up a new path for building more general and adaptable visual systems in the future.
[0096] Multimodal pre-training method: The input of the model is a pair of pictures and texts. The pictures are input to the picture encoder to obtain some features, and the texts are input to the text encoder to obtain some features. There are n image and text pairs in each traning batch, so we can get the features of n pictures and n texts. Then we do contrastive learning on these features. Contrastive learning is very flexible, which requires the definition of positive and negative samples. The paired pictures and text pairs are positive samples, which describe the same thing. The elements on the diagonal of the feature matrix are all positive samples, and the elements on the non-diagonal of the matrix are all negative samples. There are n positive samples and n*nn negative samples. With positive and negative samples, the model can be trained by contrastive learning without any manual labeling. This unsupervised training method requires a large amount of training data.
[0097] Multimodal zero-shot learning reasoning method: After pre-training, only text and image features can be obtained, and there is no classification head. Here, a method using natural language is used, prompt template. For example, for the category of ImageNet, first turn it into a sentence like "A photo of a {object}". ImageNet has 1,000 categories, so 1,000 sentences are generated. Then, these 1,000 sentences can get 1,000 text features through the previously pre-trained text encoder. It is also possible to directly use category words to extract text features, but when the model is pre-trained, sentences are paired with pictures, and the effect of using words will decrease during reasoning. Send the picture to be classified into the picture encoder to obtain features, calculate the cosine similarity between the picture features and the 1,000 text features, and select the sentence corresponding to the most similar text feature, thereby completing the classification task. It is not limited to these 1,000 categories, any category is acceptable. It completely gets rid of the limitation of categorical labels, and there is no need to define a pre-defined label list during training and reasoning.
[0098] Compared with other training methods, learning from natural language supervision signals has several advantages. The first is that it is easier to expand and no longer requires data annotation. For example, when using traditional methods for classification, you need to first determine the category, then download the image, clean it, and then annotate it. Now you only need to download the pairing of images and text. The data set can be easily enlarged, and the supervision object is now text, not N-choose-1 labels. Secondly, it not only learns one representation, but also links this representation with language, thereby achieving flexible zero-shot learning transfer. When training, the image and text are tied together, and the learned features are no longer single visual features, but multimodal features.
[0099] Although large-scale image-text pairing data are abundant, they lack fine-grained annotations for each object. To leverage this data, we use an automatic annotation pipeline that employs state-of-the-art visual large language models that can provide detailed image descriptions with rich hierarchical object labels. Through this pipeline, we obtain a large-scale dataset to enhance the capabilities of multimodal network architectures in both detection and generation.
[0100] Compared with other training strategies, learning methods based on natural language supervision signals show many advantages. The first advantage is its strong scalability, which gets rid of the dependence on manually labeled data. Traditional classification tasks usually require preset categories, manual collection of pictures, and tedious data cleaning and labeling processes. The use of text supervision simplifies it to collecting pictures and pairing them with corresponding texts, which greatly promotes the expansion of the data set. It does not need to be limited to a predefined set of labels, but instead uses the rich diversity of text as a supervision signal.
[0101] In addition, this method not only promotes the learning of feature representation, but also achieves deep integration with language, bringing higher flexibility and generalization ability to the model. During the training process, the joint learning of images and texts enables the model to extract multimodal features beyond a single visual dimension, enabling the model to understand and adapt to diverse scenes and objects without special training for new categories (i.e., zero-shot transfer learning).
[0102] Although the Internet provides a vast amount of image-text pairing data, these data often lack precise annotations for the details of each object. To overcome this limitation, an automated annotation pipeline can be deployed to generate detailed image descriptions rich in multi-level object labels with the help of advanced visual-language large models. Such models are capable of producing both extensive and detailed image annotations. Further, large datasets constructed through this pipeline significantly enhance the expressiveness and accuracy of multimodal network architectures in tasks such as object detection, scene understanding, and even image generation, promoting cutting-edge progress in the field of multimodal learning.
[0103] The key steps of the pipeline are as follows: Image-text pair re-description: First, a visual large language model, specifically Instruct-BLIP, is used to re-describe 240K image-text pairs. This process refines and enriches the image content information by asking the model to output a more detailed and clear image description given the original messy image description as a prompt. Entity extraction: Next, the powerful understanding and generation capabilities of GPT-4 are used to extract entity information from the image description generated by VLLM. This step focuses on identifying directly observable and physically real objects, excluding non-entity content such as abstract concepts, emotional descriptions, and mentions of the image itself or the shooting device. The extracted entities are presented in the format of "phrase|category|parent category", such as "woman with sunglasses|woman|person". Instruction fine-tuning VLLM: The VLLM is fine-tuned using the 240K image-text pairs with entity labels obtained from the above steps to further improve its generation accuracy. The fine-tuned VLLM is then used to generate annotations for a larger dataset of 200 million image-text pairs, which significantly expands the scale of high-quality annotated data. Automatically generate bounding box annotations: Finally, an open vocabulary object detector is used to automatically generate pseudo-label bounding boxes for these data. By applying confidence score filtering, 5 million samples are selected from the processed data to form a high-quality dataset GranuCap50M for subsequent model training.
[0104] Image feature convolutional network Figure 4As shown in the figure; it consists of 5 convolution modules, 4 cross-stage local layers and a local self-attention mechanism module; the main structure of the convolution module is a two-dimensional convolution, a BatchNorm layer and a SiLU activation function.
[0105] The function of the entire convolution module is:
[0106] 1. Downsampling: The convolutional layers in each convolutional module are downsampled using a convolution kernel with a stride of 2 to reduce the size of the feature map and increase the number of channels.
[0107] 2. Non-linear representation: Batch Normalization layer and SiLU activation function are added after each convolutional layer to enhance the non-linear representation ability of the model.
[0108] Among them, Batch Normalizaton is a commonly used technology in deep learning to accelerate the training of neural networks. Batch Normalization makes the neural network more stable during the training process by standardizing each small batch of data, can use a higher learning rate, and reduces the dependence on the initialization weights. The basic idea of BatchNormalization is: standardize each small batch of data so that the mean of each feature is 0 and the variance is 1, and then adjust the distribution of the data through a learnable scaling factor and translation factor, so that the neural network is easier to train; parameter analysis: H represents the height of the input neural network, W represents the width of the input neural network, C represents the number of channels of the image feature, k represents the size of the convolution filter, s represents the step size of the two-dimensional convolution, p represents the number of peripheral zero padding in the two-dimensional convolution process, w represents the width factor, d represents the depth factor, true represents the use of bypass connection, and false represents the use of bypass connection;
[0109] Key-value buffer decoder, such as Figure 5 As shown, it receives the embedded representation of the input sequence and uses sliding window self-attention to generate an intermediate vector representation; uses causal masks to ensure the autoregressive nature of decoding; the output of the self-decoder is used to generate a global key-value cache; the cross-decoder uses cross attention to reuse the shared key-value cache generated by the self-decoder: stacking on the key-value cache generated by the self-decoder to obtain the final output vector; causal masks are also used to maintain autoregressive generation; allowing the key-value cache to be efficiently reused between cross-decoder layers, reducing the demand for GPU memory
[0110] like Figure 6 and Figure 7As shown in the figure, in the cross-stage local structure, the processing starts with a carefully designed convolution module, which performs preliminary refinement and encoding of the input information. Subsequently, the data is directed into a feature separation stage, which aims to enhance the model's discriminative ability by refining the feature expression. This is followed by a sequence of n streamlined and efficient dark network (or bottleneck) modules, which not only reduce the computational complexity but also effectively capture multi-level feature information.
[0111] After these dark network bottleneck blocks complete their respective feature extraction, their outputs are intelligently integrated with the corresponding features of the backbone network - by stacking and splicing features, valuable information from different levels is integrated. This strategy not only enhances the model's ability to understand complex patterns, but also promotes the complementarity and mutual enhancement of features. Finally, this fused feature representation will be sent to another convolutional module for the final round of feature extraction and transformation, thereby generating a structured output that accurately reflects the key information of the input data, such as bounding box coordinates and category confidence in object detection. The entire process cleverly balances the depth, width, and efficiency of the model, demonstrating the superiority of the CSPN architecture in handling complex visual tasks.
[0112] like Figure 8 As shown, after point-by-point convolution, the features are evenly divided into two parts on the channel; only one part is input into the block composed of a multi-head self-attention module and a feedforward neural network; the last two parts are spliced and fused through point-by-point convolution; they are placed at the lowest resolution position to avoid the excessive overhead of the secondary computational complexity of self-attention; in this way, the global representation learning capability can be integrated into the backbone network at a low computational cost, which greatly enhances the performance of the model.
[0113] like Fig. 9 As shown in Figure 1, the reparameterizable visual language path aggregation network is used to enhance the image perception ability of text embedding. Its core operations include the following steps: Image feature aggregation: First, the features of the 3*3 region are extracted from the multi-scale image features using the maximum pooling operation; Text embedding update: Next, the text embedding weights are updated through the multi-head attention mechanism; the multi-head attention here acts on the updated image block features and the original text embedding itself;
[0114] Hyperparameters for image feature convolutional network training: train on your own data for 300 epochs and perform a 5 epoch warm-up. The initial warm-up training sets the learning rate very small. As the training progresses, the learning rate gradually increases and eventually reaches the learning rate of normal training. This stage is the core stage of warm-up. As the training progresses, the neural network hopes to gradually reduce the learning rate (learning rate decay). When the training is completed, the learning rate drops to 0; the optimizer is SGD, the learning rate is, the initial learning rate is 0.01, the cosine learning mechanism, the weight decay is set to 0.0005, the momentum is set to 0.9, the batch depends on the hardware device, and the input size is uniformly transitioned from 448 to 832 with a step size of 32; randomly initialize the connection weights w and bias b of each layer, give the learning rate η and the minimum batch Batch, select the activation function SiLU and the maximum number of iterations under the current data.
[0115] The deep learning framework used for training is PyTorch. The multi-GPU (graphics card) parallel processing mechanism of PyTorch is to first load the model onto the master GPU, then copy the model to each designated slave GPU, and then divide the input data by the batch dimension. Specifically, the number of data batches allocated to each GPU is the total input data batch divided by the designated number of GPUs; each GPU will independently perform forward propagation calculations on its own input data, and finally sum the losses of each GPU, and then use backpropagation to update the model parameters on a single GPU, and then copy the updated model parameters to the remaining designated GPUs, thus completing an iterative calculation; after determining the above neural network parameters, input the processed data, and iterate repeatedly until the error of the neural network output layer reaches the preset accuracy requirement or the number of training reaches the maximum number of iterations, then end the training, save the network structure and parameters, and obtain a trained neural network model.
[0116] For the model, it is not only required to have a good fit to the training data set (training error), but also hoped that it can have a good fit result (generalization ability) to the unknown data set (prediction set). The test error generated is called the generalization error; the most intuitive way to measure the quality of generalization ability is the overfitting and underfitting of the model. Overfitting and underfitting are two states used to describe the model in the training process. Generally speaking, the training will be such a curve; at the beginning of training, the model is still in the learning process, and the performance of the training set and the test set are relatively poor. At this time, the model has not learned the knowledge and is in an underfitting state. The curve falls in the underfitting zone. As the training progresses, the training error and the test error both decrease; with further training of the model, the performance on the training set is getting better and better. Finally, after breaking through a point, the error of the training set decreases and the error of the test set increases. At this time, it enters the overfitting zone. zone (overfitting interval); regularization is used to improve the generalization ability of the model. The goal of regularization is to minimize the sum of the empirical risk and the complexity of the model, that is, to minimize the structural risk; there are two explicit regularization methods. The first is to modify the network structure or adjust the usage method; the second is to directly modify the loss function; the other regularization method is an implicit regularization method. It is not a conscious and direct regularization, but it can even achieve better results. This is a data-related operation, including normalization methods and data enhancement, disturbing labels; this patent applies implicit regularization method data enhancement to improve the generalization ability of the model.
[0117] Model usage: Obtain real-time video stream data and then activate the pre-configured neural network model. This model has been carefully designed and trained to analyze video streams in real time. Its core function is to accurately locate pedestrian intrusion events. It not only outputs the bounding box position of suspected intrusion targets, but also simultaneously provides a confidence score for each detected target to reflect the model's degree of confidence in the detection result. This series of efficient processing procedures ensures the immediate identification and accurate labeling of abnormal pedestrian behavior in the monitoring scene.
[0118] Model iteration: In the process of iterative optimization of the model, a new set of data samples must first be collected and the existing model must be used to detect targets. Based on the detection results, this batch of data is carefully classified: one category is images with clear targets, including correctly identified target images and false positive non-target images; the other category is images without identified targets, which can be further subdivided into two categories: one is because the target does not exist, and the other is because the model fails to effectively capture the existing target. In this process, false positive images are regarded as negative examples, while those images that actually contain specific targets but are not recognized by the model are used as positive training samples to enhance the recognition ability of the model.
[0119] Subsequently, images where the target was not successfully detected are carefully annotated and enhanced to enrich the diversity and challenge of the training set. Based on this carefully prepared data, the model will undergo a new round of training based on its initial version, aiming to breed a new model with better performance. The performance of the new model will be evaluated through rigorous testing to ensure that its detection accuracy meets the established standards.
[0120] If the performance of the new model does not meet expectations, the iterative process will introduce more sample data, fine-tune the parameters of the network architecture, and continue iterative training until the model performance is significantly improved. Conversely, when the model accuracy not only meets the set threshold but also achieves the best performance on the current data set, the iterative process can converge, indicating that the model has fully adapted to the complexity and diversity of actual application scenarios. This series of cyclical iterations and optimization strategies ensures that the model can continue to evolve.
[0121] The application of zero-shot learning method driven by multimodal deep learning in pedestrian intrusion detection, the pedestrian intrusion target detection method and the multimodal model pedestrian intrusion prediction algorithm implementation detailed process, first, the interface accepts parameters such as camera address, algorithm type, callback address, etc.; second, the interface will start a new process, start to capture image frames from the camera's video stream, and store them in redis, and notify the listening program at the same time; third, the listening program receives the notification, takes out the image frame from redis, and starts to create an algorithm instance, and calls the algorithm instance to start analyzing the image frame; fourth, the algorithm instance analyzes the image frame according to the business logic, stores the analysis results in redis, and notifies the listening program at the same time; fifth, the listening program receives the notification, takes out the results, and submits the analysis results to the business interface (callback).
[0122] The present invention discloses the application of a zero-shot learning method driven by multimodal deep learning in abnormal pedestrian intrusion detection, so as to solve the problem of realizing intelligent detection of abnormal pedestrian intrusion targets based on fixed cameras in campus perimeter security management. The method is based on the fixed-point fixed camera imaging that has been built for campus management, and calls an algorithm to automatically detect abnormal pedestrian intrusion targets in the monitoring screen; the method provides a convenient, fast and open information management space for campus perimeter security management, and relies on deep learning technology to realize intelligent management and efficient operation of campus perimeter security; for abnormal pedestrian intrusion detection under fixed campus monitoring, records are filed for it for verification by the campus management department, and the information is pushed to the mobile phones of relevant personnel and arrives at the scene in time for processing.
[0123] The key to its technology lies in:
[0124] (1) An automatic annotation pipeline that uses a state-of-the-art visual large language model that provides detailed image descriptions with rich hierarchical object labels;
[0125] (2) A reparameterizable visual-linguistic path aggregation network, which aims to enhance the image perception capabilities of text embeddings;
[0126] (3) Key-value buffer decoder, which receives the embedded representation of the input sequence and uses sliding window self-attention to generate an intermediate vector representation; uses causal masks to ensure the autoregressive nature of decoding; the output of the self-decoder is used to generate a global key-value buffer; the cross-decoder uses cross-attention to reuse the shared key-value buffer generated by the self-decoder: stacking on the key-value buffer generated by the self-decoder to obtain the final output vector; also uses causal masks to maintain autoregressive generation; allows the key-value buffer to be efficiently reused between cross-decoder layers, reducing the demand for GPU memory.
[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A zero-shot learning method driven by multimodal deep learning, characterized in that: The following steps are involved: Step S1: Create and start a task, obtain real-time monitoring video, and start a multimodal anomaly intrusion detection task; Step S2: Area demarcation: demarcate the intrusion area in the real-time monitoring video, use the pedestrian intrusion multimodal algorithm to perform real-time detection and analysis, and obtain pedestrian intrusion target information; Step S3: Send the detected pedestrian intrusion target information to the multimodal reasoning model for in-depth analysis; The multimodal reasoning model architecture includes: image input, image text description input, text encoder, image feature convolutional network and visual language path aggregation network; Image text description input Input the image text description into the text encoder for feature extraction. At the same time, the image input inputs the image into the image feature convolution network for feature extraction to obtain the corresponding features. The features are processed by the visual language path aggregation network to fuse the single-modal to multi-modal information and enhance the interactive understanding between image and text. Text encoder: uses the Swin-T backbone network architecture to process text input. Image feature convolutional network: responsible for extracting image features, including convolution modules, cross-stage local layers, and local self-attention mechanism modules. The multimodal reasoning model training process is: Input: image and text description, Feature extraction: Images and texts are represented by features through corresponding encoders. Feature fusion: Feature fusion is performed through a reparameterizable visual-linguistic path aggregation network. Normalization: L2 normalization is performed after feature fusion. Contrastive learning: Calculate the cosine similarity between paired images and text and negative samples, construct contrastive loss, Loss calculation: Calculate the loss of image and text separately and take the average. Image-text pair re-description: Use Instruct-BLIP to refine the image-text pair description. Entity extraction: Use GPT-4 to extract entity information from the description. Instruction fine-tuning VLLM: Fine-tune VLLM using data with entity tags. Automatically generate bounding box annotations: Generate pseudo-labeled bounding boxes for the dataset, Convolution module and local self-attention mechanism module: The image feature convolution network includes a two-dimensional convolution layer, a batch normalization layer, and a SiLU activation function. The 2D convolution layer uses a convolution kernel of size k and a step size s of 2 to perform downsampling operations, reduce the size of the feature map and increase the number of channels; Batch normalization layer, which is used to standardize each mini-batch of data so that the features have zero mean and unit variance to speed up the training process; SiLU activation function is used to enhance the nonlinear expression ability of the model. Key-value buffer decoder: Uses sliding window self-attention mechanism to generate intermediate representation and generate global key-value cache. Cross-decoder: Utilizes shared key-value cache for cross-attention operation, which reduces memory requirements. Reparameterizable visual-linguistic path aggregation network: fuses image features and text features, learns the mapping from unimodal to multimodal, and enhances the image perception ability of text embedding. The operation of the Vision-Language Path Aggregation Network consists of the following steps: Step A: Image feature aggregation: From the multi-scale image features, use the maximum pooling operation to extract the features of the 3*3 region; Step B, text embedding update: Update the text embedding weights through a multi-head attention mechanism; the multi-head attention here acts on the updated image block features and the original text embedding itself; Step S4: Early warning display: the front-end intelligent scheduling platform displays the intrusion information according to the inference result, including the intrusion location and category; Step S5: Notification processing. After the alarm is triggered, the system notifies and dispatches relevant staff to go to the scene for processing.
2. The zero-shot learning method based on multimodal deep learning drive according to claim 1 is characterized in that: The real-time detection and analysis of the real-time monitoring video in step S2 is as follows: Step S21: Obtain camera address and callback address parameters; Step S22: Start a new process, start capturing image frames from the camera's video stream, store them in redis, and notify the listening program at the same time; Step S23: The monitoring program receives the notification, retrieves the image frame from redis, starts to create an algorithm instance, and calls the algorithm instance to start analyzing the image frame; Step S24: the algorithm instance analyzes the image frame according to the business logic, stores the analysis results in redis, and notifies the listening program at the same time; Step S25: The monitoring program receives the notification, retrieves the results, and submits the analysis results to the business interface.
3. The zero-shot learning method based on multimodal deep learning drive according to claim 1, characterized in that: The test training image data in the multimodal reasoning model in step S3 is prepared as follows: Mobile phone image data collection: Use mobile phones to collect target images, which are divided into distant target images and near-field target images. Each type of collected image is divided into two columns and placed in a table. The first column is for near-field target images, and the second column is for distant target images. Image collectors place the collected surveillance video images or mobile phone images in the table on a daily basis, and each image is accompanied by a corresponding text description to obtain mobile phone collected image data; Surveillance video image acquisition: In the surveillance video, find L videos containing pedestrians at different locations, different times and different weather conditions. Vi represents the i-th video. There are Ni video images in Vi. Select Mi video images from Ni video images as training and test images. Then, we can obtain The video images are used as training and test images to obtain monitoring video image data; the mobile phone collected image data and the monitoring video image data are used as test and training image data for the multimodal reasoning model.
4. The zero-shot learning method based on multimodal deep learning drive according to claim 3 is characterized in that: Before the multimodal reasoning model is tested and trained, the test training image data is enhanced by: Color transformation: Data enhancement is performed in the color channel space, which can close a certain color channel or change the brightness value; Rotation transformation: select an angle, rotate the image left or right, and change the direction of the image content; Add noise: a matrix of values sampled from a Gaussian distribution is added to the image; Sharpening and blurring: Use Gaussian and Laplacian operators to process images; Scaling transformation: the image is enlarged or reduced in proportion; Translation transformation: moves the image in four dimensions: up, down, left, and right; Flip transformation: flip the image along the horizontal or vertical axis; Cropping transformation: including center cropping and random cropping; Affine transformation: perform a linear transformation on the image followed by a translation transformation.
5. The zero-shot learning method based on multimodal deep learning drive according to claim 4 is characterized in that: The multimodal pre-training method is: The image is input into the image encoder to obtain some features, and the text is input into the text encoder to obtain some features. There are n image and text pairs in each training batch, and the features of n images and n texts are obtained, and then comparative learning is performed on these features.
6. The zero-shot learning method based on multimodal deep learning drive according to claim 5, characterized in that: The multimodal zero-shot learning reasoning method is: Step a: extract features from text and images using a pre-trained multimodal model; Step b: using prompt template technology, convert the target category into a natural language description form to obtain a text description set; Step c: input the text description set into a pre-trained text encoder to obtain a text feature vector corresponding to each category; Step d, using an image encoder to extract a feature vector from the image; Step e, calculating the cosine similarity between the feature vector of the image to be classified and the feature vectors of all the texts in step c; Step f: Select the category corresponding to the text feature that is most similar to the feature vector of the image to be classified as the prediction result.
7. The zero-shot learning method based on multimodal deep learning drive according to claim 1, characterized in that: The model iteration of the multimodal reasoning model is: Collect new data, input the data into the multimodal reasoning model, obtain the detection results, divide the detection results into true target images and false alarm target images, annotate and enhance the false alarm target images, and then train a new model based on the original model. Test the new model to check whether the accuracy meets the standard. If not, add new data and adjust the network parameters for training. If so, stop training.
