CoFormer-based military field image event knowledge extraction method

By using ResNet101 as the backbone network in the CoFormer network and designing an automatic annotation program, the problem of declining extraction performance of traditional methods on complex data sets is solved, and a more efficient image event knowledge extraction effect is achieved.

CN118537650APending Publication Date: 2024-08-23NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410702931.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

When traditional image event knowledge extraction methods deal with complex data sets, the extraction performance of the model is affected. Especially when the types of events in the image are diverse, it is difficult to maintain efficient extraction results.

Method used

Use CoFormer network as the basic architecture, replace the backbone network with ResNet101, design a new data set annotation format, and generate annotation files required for model training through an automatic annotation program, divide the training set, verification set and test set, use the verification set to adjust the super parameters to improve the model’s generalization ability and feature extraction ability.

Benefits of technology

It significantly improves the performance and stability of image event knowledge extraction, reduces the complexity and time cost of data annotation, and improves the extraction effect of the model on complex data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537650A
    Figure CN118537650A
Patent Text Reader

Abstract

The invention provides a CoFormer-based method for extracting image event knowledge in the military field. According to the method, CoFormer is taken as a main framework, a backbone network of the CoFormer is changed into ResNet101, and a better event extraction result is realized by enhancing the feature extraction capability of the model on the image. The partial data annotation format of the CoFormer is modified in a targeted manner, so that the CoFormer can be better applied to images in the military field. In addition, a military image data set is constructed, the military image data set comprises four events of helicopter supply, submarine floating, water cannon attack and artillery attack, and the data set is randomly divided into a training set, a verification set and a test set. The training set is used for training the improved model to obtain optimal parameters; the verification set is used for adjusting hyper-parameters of the model and performing preliminary evaluation on the capability of the model; the test set is used for verifying the effect of the improved model, and event knowledge extraction oriented to military field images is realized. Compared with other image event extraction methods based on deep learning, the method has a better event knowledge extraction effect. In order to solve the problem that the data annotation format is complex, a set of programs is designed to be used for automatically generating annotation files needed by model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a CoFormer-based method for extracting knowledge from military image events. Background Art

[0002] Image event knowledge extraction is an important task in the field of image processing, which aims to enable computer systems to understand and interpret specific scenes or situations. It is mainly used to identify and understand specific situations or scenes in images, and find out the main objects in the scene and their relationships. It belongs to a visual reasoning technology. The present invention applies image event extraction technology to the military field and has achieved relatively good results.

[0003] Traditional image event knowledge extraction methods can often achieve good extraction results on simple data sets, but when the image categories are complex and there are many types of objects in the image, the extraction performance of the model will be greatly affected. The image event knowledge extraction method based on CoFormer is different from the conventional image event knowledge extraction technology. It adds a bounding box to the main object in the image on the basis of the conventional method. With the help of the bounding box, the model can more accurately extract the features of the main object in the image, thereby improving the overall event knowledge extraction effect. However, with the increasing number of event types in images, the image event knowledge extraction method based on CoFormer still faces huge challenges. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a method for extracting knowledge from military image events based on CoFormer, which has a strong generalization ability and better extraction effect.

[0005] The technical solution adopted by the present invention is: a method for extracting military field image event knowledge based on CoFormer, comprising the following steps:

[0006] Step 1: Build an image dataset containing four types of events: submarine surfacing, helicopter replenishment, water cannon attack, and artillery attack, and annotate the targets in the image in YOLO format;

[0007] Step 2: Using the CoFormer network as the basic architecture, the backbone network of the model was replaced, a new dataset annotation format was designed, an automatic annotation program was used to generate the annotation files required for model training, and the dataset was divided into training set, validation set, and test set;

[0008] Step 3: Use the training set to train the improved CoFormer network model from scratch, and use the validation set to assist in adjusting the hyperparameters to obtain the optimal parameters;

[0009] Step 4: Use the test set to verify the trained network model and obtain the final extraction result.

[0010] Furthermore, in step 1, an image dataset containing four types of events, namely submarine surfacing, helicopter replenishment, water cannon attack, and artillery attack, is constructed, and the targets in the image are annotated in the YOLO format, as follows:

[0011] Relevant images were collected from multiple public military websites. The initial image dataset had a total of 463 photos, which were expanded to 553 after data annotation, data enhancement and data cleaning.

[0012] Furthermore, in step 2, the CoFormer network is used as the basic architecture, the backbone network of the model is replaced, and a new dataset annotation format is designed and the automatic annotation data flow is executed. The details are as follows:

[0013] The present invention replaces the backbone network of CoFormer from ResNet50 to ResNet101. ResNet101 has the following advantages over ResNet50: Deeper network layers: ResNet101 has 101 layers, while ResNet50 has only 50 layers. This increased depth allows ResNet101 to capture more complex features and patterns, especially when processing complex data sets; Higher representation ability: Due to more layers, ResNet101 can learn richer feature representations. This makes it outperform ResNet50 in tasks such as image classification, target detection, and image segmentation; Better generalization ability: ResNet101, due to its deeper structure, can better generalize to new data under appropriate regularization means. This makes its performance on different data sets more robust; Better transfer learning performance: In transfer learning tasks (such as fine-tuning using a pre-trained model), ResNet101 usually performs better. Its pre-trained model can provide higher quality initial weights, thereby improving the performance of the fine-tuned model; it is suitable for more complex tasks, and ResNet101 performs better than ResNet50 when processing tasks that require higher precision and complexity. For example, in tasks such as object detection (such as Faster R-CNN) and image segmentation (such as Mask R-CNN), using ResNet101 as the backbone network can usually achieve higher accuracy. Considering the above advantages, the present invention replaces the backbone network of CoFormer with ResNet101, which will significantly improve the performance of subsequent image event knowledge extraction.

[0014] The CoFormer network model mainly consists of four parts: the backbone network, the Glance Transformer network, the Gaze-Step1 Transformer network, and the Gaze-Step2 Transformer network. After using ResNet101 to replace the ResNet50 in the original backbone network of the CoFormer network model, deeper feature maps can be output from ResNet101, thereby enhancing the overall network's ability to extract event knowledge from images.

[0015] In the data annotation part, the argument annotation format adopted by CoFormer is the number mapped by WordNet, which adds a certain complexity to the data annotation work. When training a newly constructed data set, all arguments need to be remapped. If the scale of the data set is large and the number of arguments is huge, the difficulty of mapping increases accordingly. In addition, when using the model for reasoning, the predicted number needs to be reverse mapped through WordNet. The present invention omits these two redundant steps and directly uses the argument itself instead of the mapped number for training, which reduces the complexity of model training and improves the reasoning speed.

[0016] The present invention designs a set of programs that can realize the function of automatic annotation of data sets. As long as the same type of images and their corresponding yolo format annotation files are placed in the corresponding category folder, the annotation files required for the training of the present invention can be automatically generated. The data set is divided into a training set, a validation set and a test set in a ratio of 8:1:1, wherein the training set has 442 images, the validation set has 55 images, and the test set has 56 images.

[0017] The automatic data annotation process mainly includes the steps of image label matching, file name normalization, data set segmentation and annotation file generation. The folder path containing all data sets is input into the automatic annotation program, and all the annotation files required for the model training of the present invention will be generated in the folder.

[0018] Image label matching, keep the files that contain both images and their YOLO annotation files in the folder, and delete other files that cannot be paired. The one-to-one correspondence between images and YOLO format annotation files can avoid the problem of being unable to generate the annotation files required for model training due to missing files.

[0019] Normalize the file names and rename all images and YOLO format annotation files. All file names are normalized to a combination of event types and different numbers, such as helicopter_supplying_0.jpg. When generating the annotation files required for model training, the event type can be directly obtained by splitting the file name, which improves the efficiency of automatic annotation.

[0020] Dataset segmentation: randomly segment the dataset after the above two steps. By default, the dataset is segmented into training set, validation set and test set according to the ratio of 0.8, 0.1, 0.1 for subsequent model training. The segmentation ratio can also be changed according to different needs.

[0021] The annotation file is generated according to the improved data annotation format of the present invention, using the files generated by the first three automatic annotation steps to generate the final annotation file. At this point, all the data required for the model training of the present invention has been prepared.

[0022] Furthermore, in step 3, the improved CoFormer network model is trained from scratch using the training set, and the validation set is used to assist in obtaining the optimal parameters. The specific method is: the training set has a total of 442 images, the validation set has 55 images, the batch size is set to 16, and the NVIDIA GeForce RTX 3070 (arch=8.6) GPU is used for acceleration. The software environment is set to Python3.7, PyTorch1.12.1, and the initial learning rate is set to 0.0001. The learning rate decreases by 10 times every 30 rounds. The model is optimized using the AdamW optimizer, and a total of 80 rounds of training are performed to avoid poor generalization ability caused by underfitting or overfitting. After each round of training, the validation set is used to evaluate the performance of the model.

[0023] Furthermore, in step 4, the trained network model is verified using the test set to obtain the final extraction result. Specifically, the images in the test set are input into the improved CoFormer model that has been loaded with the optimal weights, and the subjective extraction results and objective performance indicators of the images are finally output. The subjective extraction results are presented in text, and the objective performance is judged by the extraction accuracy of event types and arguments to determine the effect of the algorithm model.

[0024] Compared with the prior art, the beneficial effects of the present invention are: taking the CoFormer network as the basic architecture, replacing the backbone network to improve the model's ability to extract features from images; improving the data annotation format of the model, further improving the stability and speed of the model during training; designing a set of automatic annotation file generation programs to automatically generate all annotation files required for model training, significantly reducing the difficulty and time cost of data annotation. Compared with other methods of image event knowledge extraction based on deep learning, the present invention has better extraction effect.

[0025] The present invention will be further described below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 The main flow chart of the present invention is

[0027] Figure 2 It is a schematic diagram of the network structure implementation process of the present invention.

[0028] Figure 3 This is a diagram showing the effect of the present invention on the event knowledge extraction of helicopter supply events.

[0029] Figure 4 This is a diagram showing the effect of the present invention on the event knowledge extraction of an artillery attack event.

[0030] Figure 5 This is a diagram showing the effect of the present invention on the event knowledge extraction of a water cannon attack event.

[0031] Figure 6 This is a diagram showing the effect of the present invention on the event knowledge extraction of a submarine surfacing event. DETAILED DESCRIPTION

[0032] The present invention will be further described below in conjunction with the accompanying drawings.

[0033] Combination Figure 1 Flowchart, the present invention provides a method for extracting knowledge from military image events based on CoFormer, comprising the following steps:

[0034] Step 1: Collect relevant images from multiple public military websites. The initial image data contains 463 photos, which are expanded to 553 after data annotation, data enhancement and data cleaning.

[0035] Step 2: Using the CoFormer network as the basic architecture, the backbone network of the model was replaced, a new dataset annotation format was designed, an automatic annotation program was used to generate the annotation files required for model training, and the dataset was divided into training set, validation set, and test set.

[0036] Figure 2 This is a schematic diagram of the overall network flow for implementing the method of the present invention. The original CoFormer backbone network part is replaced, and ResNet101 with stronger feature extraction capability is used instead of ResNet50. The image can obtain a deeper feature representation after passing through ResNet101, which can improve the performance of subsequent event knowledge extraction.

[0037] In the data labeling part, the argument labeling format adopted by CoFormer is the numbering mapped by WordNet. The improved data labeling format directly uses the argument name itself for training, which reduces the complexity of model training and speeds up the reasoning process.

[0038] The automatic annotation file generation program designed by the present invention is used to divide the data set into a training set, a validation set, and a test set at a ratio of 8:1:1. The training set has 442 images, the validation set has 55 images, and the test set has 56 images. The annotation file required for the model training of the present invention is generated and moved to the data set path of the model.

[0039] Step 3. Use the training set to train the improved CoFormer network model from scratch, and use the validation set to assist in obtaining the optimal parameters. The specific method is: the training set has a total of 442 images, the validation set has 55 images, the batch size is set to 16, and the NVIDIA GeForce RTX 3070 (arch=8.6) GPU is used for acceleration. The software environment is set to Python 3.7 and PyTorch 1.12.1. The initial learning rate is set to 0.0001, and the learning rate decreases by 10 times every 30 rounds. The model is optimized using the AdamW optimizer, and a total of 80 rounds of training are performed to avoid poor generalization ability caused by underfitting or overfitting. After each round of training, the validation set is used to evaluate the performance of the model.

[0040] Step 4: Use the test set to verify the trained network model and obtain the final extraction results. Specifically, the images in the test set are input into the improved CoFormer model that has been loaded with the optimal weights, and the subjective extraction results and objective performance indicators of the images are finally output. The subjective extraction results are presented in text, and the objective performance is judged by the extraction accuracy of event types and arguments to determine the effect of the algorithm model.

[0041] The improved Coformer model is used to test event knowledge extraction on pictures of different event types. The specific extraction results are as follows: Figure 3 , 4 , 5, and 6. Figure 3 This is the effect diagram of event knowledge extraction for helicopter supply events in the present invention. Figure 4 This is the effect diagram of the event knowledge extraction of the artillery attack event of the present invention. Figure 5 This is a diagram showing the effect of the present invention on the event knowledge extraction of a water cannon attack event. Figure 6 This is a diagram showing the effect of the present invention on the event knowledge extraction of a submarine surfacing event.

[0042] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.

Claims

1. A method for extracting military image event knowledge based on CoFormer, characterized by: Here are the steps: Step 1: Build an image dataset containing four types of events: submarine surfacing, helicopter replenishment, water cannon attack, and artillery attack, and annotate the targets in the image in YOLO format; Step 2: Taking the CoFormer network as the basic architecture, we replaced its backbone network structure, improved the annotation format of some data according to the actual application scenarios, used the automatic annotation program to generate the annotation files required for model training, and divided the data set into training set, validation set, and test set; Step 3: Use the training set to train the improved CoFormer network model from scratch. During the training process, use the validation set to evaluate the performance of the model and adjust the hyperparameters of the model based on this to obtain the optimal parameters. Step 4: Use the test set to verify the trained network model and obtain the final event extraction result.

2. According to claim 1, a method for extracting military image event knowledge based on CoFormer is characterized by: The specific process of step 1 is as follows: 463 images are collected from multiple public military websites. In order to avoid the long-tail problem of the data set, data enhancement operations are performed on the smaller number of water cannon attack category images. After data enhancement, data cleaning and data labeling operations, the data set is expanded to 553 images.

3. The method for extracting military image event knowledge based on CoFormer according to claim 1, characterized in that: The specific process of step 2 is: Step 1: The present invention changes the ResNet50 backbone network in the CoFormer infrastructure to ResNet101. ResNet101 contains a 101-layer network structure, which has a higher network depth and complexity than ResNet50 and can extract more advanced features from the image, thereby improving the effect of subsequent image event knowledge extraction; Step 2: Improve the format of some data annotations. During the training process of CoFormer, all arguments involved in the data set need to be mapped to their numbers in WordNet, and the numbers are inversely mapped to the arguments themselves during the reasoning process. This not only adds extra workload, but also affects the rate of the reasoning process. Taking this into account, the present invention improves the annotation method of arguments in CoFormer, omitting the step of argument mapping, replacing the numbers in WordNet with the arguments themselves, and also simplifies the steps of constructing the data set; Step 3: Use the data set automatic annotation program designed by the present invention to generate the annotation files required for training. Given the data set image and the corresponding yolo format annotation file in advance, the data set can be automatically matched with image labels, file name normalization, data set segmentation, and annotation file generation, and finally obtain the annotation files required for the model training of the present invention. The data set is divided into a training set, a validation set, and a test set at a ratio of 8:1:1, where the number of images in the training set is 442, the number of images in the validation set is 55, and the number of images in the test set is 56.

4. The method for extracting military image event knowledge based on CoFormer according to claim 1, characterized in that: The specific process of step 3 is: There are 442 images in the training set and 55 images in the validation set. The batch size is set to 16. The GPU of NVIDIA GeForce RTX3070 (arch=8.6) is used for acceleration. The software environment is set to Python 3.7 and PyTorch 1.12.

1. The initial learning rate of the model is set to 0.0001, and the learning rate decreases by 10 times every 30 rounds of training. The model is optimized using the AdamW optimizer. A total of 80 rounds of training are conducted to avoid the problem of poor generalization ability caused by underfitting or overfitting. After each round of training, the validation set is used to evaluate the performance of the model.

5. The method for extracting military image event knowledge based on CoFormer according to claim 1, characterized in that: The specific process of step 4 is: The images in the test set are input into the improved CoFormer model that has been loaded with the optimal weights, and the event extraction results and objective performance indicators of the images are finally output. The event extraction results are presented in text form, and the objective performance is used to judge the effect of the algorithm model based on the extraction accuracy of event types and arguments.