Instance segmentation method and device based on neural network and storage medium

Through the instance segmentation method based on neural network, the detection network, feature map processing layer and mask processing layer are used to perform instance segmentation, and through threshold filtering, the problem of slow instance segmentation speed in the existing technology is solved, and fast and accurate Effect.

CN112348828BActive Publication Date: 2024-09-06ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011166214.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2024-09-06
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

While the existing instance segmentation architecture based on candidate regions improves the accuracy of instance segmentation, the reasoning speed is greatly reduced, failing to achieve a balance between speed and accuracy.

Method used

The instance segmentation method based on neural network is used to instance segment the target image through the detection network, feature map processing layer and mask processing layer, and similar instances are determined based on the overlap between instances, and a predetermined threshold is set to obtain the target instance image. Improve computing efficiency.

Benefits of technology

Fast and accurate instance segmentation is achieved, solving the problem of low instance segmentation calculation speed in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112348828B
    Figure CN112348828B
Patent Text Reader

Abstract

The present invention discloses an instance segmentation method and device based on a neural network and a storage medium. The method comprises: obtaining a target image in a video stream; inputting the target image into a target instance segmentation neural network, and outputting a first instance set, wherein the instance segmentation neural network comprises: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of an instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; determining similar instances of target instances in the first instance set according to the overlap between target instances in the first instance set; determining instances greater than a first predetermined threshold in similar instances, and obtaining at least one instance image of the target instance in the target image, thereby solving the technical problem of low instance segmentation calculation speed in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a neural network-based instance segmentation method and device, and a storage medium. Background Art

[0002] When processing images, it is usually necessary to locate and distinguish the instances contained in the image. For example, the target detection method is used to frame different instances, and then the semantic segmentation method is used to mark the areas where the instances of different categories are located pixel by pixel, so as to distinguish instances of different categories. If it is necessary to further distinguish instances of the same category, the image is segmented. Instance segmentation can not only distinguish the categories of images, but also distinguish different instances in the same category.

[0003] The existing instance segmentation architecture based on candidate regions is used to segment the image in N-level prediction networks to directly obtain the instance segmentation results. The accuracy of instance segmentation is improved by cascading, but the inference speed is greatly reduced, and the balance between speed and accuracy is not achieved.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for instance segmentation based on a neural network, and a storage medium, so as to at least solve the technical problem of low instance segmentation calculation speed in the prior art.

[0006] According to one aspect of an embodiment of the present invention, there is provided a neural network-based instance segmentation method, comprising: obtaining a target image in a video stream; inputting the target image into a target instance segmentation neural network, and outputting a first instance set, wherein the instance segmentation neural network comprises: a detection network, a feature map processing layer, and a mask processing layer, the detection network being used to obtain parameters of an instance bounding box, the feature map processing layer processing the parameters of the bounding box to obtain target parameters, and the mask processing layer performing instance segmentation on the target image according to the target parameters; determining similar instances of the target instances in the first instance set according to the overlap between the target instances in the first instance set; determining instances in the similar instances that are greater than a first predetermined threshold, and obtaining at least one instance image of the target instance in the target image.

[0007] Optionally, before inputting the target image into the target instance segmentation neural network and outputting the first instance set, the method includes: obtaining a sample image set in the video stream; labeling the target object in each image in the sample image set to obtain a target data set; inputting the labeled data set into a preset instance segmentation neural network, wherein the preset neural network includes a preset detection network, a preset feature map processing layer, a preset mask processing layer and a target loss function, the detection network is used to obtain parameters of the instance bounding box in the preset sample image, the feature map processing layer processes the parameters of the bounding box of the instance in the preset sample image to obtain preset target parameters, the mask processing layer performs instance segmentation on the sample target image according to the preset target parameters, and the target loss function includes a binary cross entropy loss function and an intersection-over-union loss function; when the target loss function satisfies a predetermined condition, it is determined to be the instance segmentation neural network.

[0008] Optionally, labeling the target object in each picture in the sample picture set to obtain the target data set includes: using instance segmentation standard data enhancement technology to perform data enhancement on each picture in the sample picture set and the labeling result to obtain the target data set.

[0009] Optionally, after labeling the target object in each picture in the sample picture set to obtain the target data set, the method further includes: dividing the target data set into a training set, a validation set and a test set according to a preset ratio, wherein the training set is used for training the preset instance segmentation neural network, the validation set is used for validating the preset instance segmentation neural network, and the test set is used for testing the preset neural network segmentation model.

[0010] Optionally, before inputting the labeled data set into a preset instance segmentation neural network, the method further includes: constructing an initialization detection network, wherein the detection network includes a feature extraction backbone network, a feature enhancement network and a detection head, the feature extraction backbone network is used to extract features of instances of each image in the sample image set to obtain a feature map, the feature enhancement network performs feature map enhancement on the feature map and marks the size of the feature map, and inputs feature maps marked with different sizes into the detection head to obtain parameters of a sample instance bounding box; constructing the preset instance segmentation neural network according to the initialization detection network, the preset feature map processing layer and the preset mask processing, wherein the preset feature map processing layer processes the parameters of the sample instance bounding box to obtain sample target parameters, and the preset mask processing layer performs instance segmentation on the sample target image according to the sample target parameters.

[0011] According to another aspect of an embodiment of the present invention, there is also provided an instance segmentation device based on a neural network, comprising:

[0012] According to one aspect of an embodiment of the present invention, there is provided an instance segmentation device based on a neural network, comprising: a first acquisition unit, configured to acquire a target image in a video stream; an output unit, configured to input the target image into a target instance segmentation neural network, and output a first instance set, wherein the instance segmentation neural network comprises: a detection network, a feature map processing layer, and a mask processing layer, the detection network being configured to acquire parameters of an instance bounding box, the feature map processing layer processing the parameters of the bounding box to obtain target parameters, and the mask processing layer performing instance segmentation on the target image according to the target parameters; a first determination unit, configured to determine similar instances of the target instances in the first instance set according to the degree of overlap between the target instances in the first instance set; and a second determination unit, configured to determine instances in the similar instances that are greater than a first predetermined threshold, and obtain at least one instance image of the target instance in the target image.

[0013] Optionally, the above-mentioned device includes: a second acquisition unit, used to input the target image into the target instance segmentation neural network, and obtain a sample image set in the video stream before outputting the first instance set; an acquisition unit, used to mark the target object in each image in the sample image set to obtain a target data set; an input unit, used to input the marked data set into a preset instance segmentation neural network, wherein the preset neural network includes a preset detection network, a preset feature map processing layer, a preset mask processing layer and a target loss function, the detection network is used to obtain the parameters of the instance bounding box in the preset sample image, the feature map processing layer processes the parameters of the bounding box of the instance in the preset sample image to obtain preset target parameters, the mask processing layer performs instance segmentation on the sample target image according to the preset target parameters, and the target loss function includes a binary cross entropy loss function and an intersection-over-union loss function; a third determination unit, used to determine it as the instance segmentation neural network when the target loss function meets predetermined conditions.

[0014] Optionally, the obtaining unit includes: an obtaining module, used to perform data enhancement on each image and annotation result in the sample image set using the instance segmentation standard data enhancement technology to obtain the target data set.

[0015] Optionally, the above-mentioned device also includes: a division unit, used to mark the target object in each picture in the sample picture set, and after obtaining the target data set, divide the target data set into a training set, a verification set and a test set according to a preset ratio, wherein the training set is used for training the preset instance segmentation neural network, the verification set is used for verification of the preset instance segmentation neural network, and the test set is used for testing the preset neural network segmentation model.

[0016] Optionally, the above-mentioned device also includes: a first construction unit, used to construct an initialized detection network before inputting the labeled data set into a preset instance segmentation neural network, wherein the detection network includes a feature extraction backbone network, a feature enhancement network and a detection head, the feature extraction backbone network is used to extract features of instances of each image in the sample image set to obtain a feature map, the feature enhancement network performs feature map enhancement on the feature map and marks the size of the feature map, and inputs the feature maps marked with different sizes into the detection head to obtain parameters of the sample instance bounding box; a second construction unit, used to construct the preset instance segmentation neural network according to the initialized detection network, the preset feature map processing layer and the preset mask processing, wherein the preset feature map processing layer processes the parameters of the sample instance bounding box to obtain sample target parameters, and the preset mask processing layer performs instance segmentation on the sample target image according to the sample target parameters.

[0017] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned neural network-based instance segmentation method when running.

[0018] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the neural network-based instance segmentation method through the computer program.

[0019] In an embodiment of the present invention, a target image in a video stream is obtained; the target image is input into a target instance segmentation neural network, and a first instance set is output, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of an instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; similar instances of the target instances in the first instance set are determined according to the overlap between the target instances in the first instance set; instances greater than a first predetermined threshold in the similar instances are determined to obtain at least one instance image of the target instance in the target image, thereby achieving the purpose of performing instance segmentation on the target image by an instance segmentation neural network having a detection network, a feature map processing layer, and a mask processing layer, and determining the target instance by a threshold value for the instance segmentation result, thereby achieving a fast and accurate technical effect, and further solving the technical problem of low instance segmentation calculation speed in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0021] Figure 1 is a schematic diagram of an application environment of an optional neural network-based instance segmentation method according to an embodiment of the present invention;

[0022] Figure 2 is a flowchart of an optional neural network-based instance segmentation method according to an embodiment of the present invention;

[0023] Figure 3 is an optional instance segmentation method according to an embodiment of the present invention;

[0024] Figure 4 is a structural diagram of an optional instance segmentation network according to an embodiment of the present invention;

[0025] Figure 5 is a structural diagram of an optional mask processing layer according to an embodiment of the present invention;

[0026] Figure 6 is a schematic structural diagram of an optional neural network-based instance segmentation device according to an embodiment of the present invention;

[0027] Figure 7 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] 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 thereof 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.

[0030] According to one aspect of an embodiment of the present invention, a neural network-based instance segmentation method is provided. Optionally, as an optional implementation, the neural network-based instance segmentation method can be but is not limited to being applied to Figure 1 In the environment shown, it includes a terminal device 102, a network 104 and a server 106.

[0031] Optionally, the above-mentioned neural network-based instance segmentation method can be executed by the terminal device 102, or by the server 106, or by the terminal device 102 and the server 106 together.

[0032] The following description is made by taking the server 106 executing the above-mentioned neural network-based instance segmentation method as an example.

[0033] The server 106 obtains a target image in a video stream; inputs the target image into a target instance segmentation neural network, and outputs a first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of an instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; determines similar instances of the target instances in the first instance set according to the overlap between the target instances in the first instance set; determines instances greater than a first predetermined threshold in the similar instances, and obtains at least one instance image of the target instance in the target image, thereby achieving the purpose of performing instance segmentation on the target image by using an instance segmentation neural network having a detection network, a feature map processing layer, and a mask processing layer, and determining the target instance by a threshold value for the instance segmentation result, thereby achieving a fast and accurate technical effect, and further solving the technical problem of low instance segmentation calculation speed in the prior art.

[0034] Optionally, in this embodiment, the terminal device 102 may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a video client, an instant messaging client, a browser client, an education client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.

[0035] Optionally, as an optional implementation, as Figure 2 As shown, the above-mentioned neural network-based instance segmentation method includes:

[0036] Step S2020, obtaining the target image in the video stream.

[0037] Step S204, input the target image into the target instance segmentation neural network, and output the first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer and a mask processing layer, the detection network is used to obtain the parameters of the instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain the target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters.

[0038] Step S206 : determining similar instances of the target instance in the first instance set according to the overlap between the target instances in the first instance set.

[0039] Step S208: determining instances in the similar instances that are greater than a first predetermined threshold, and obtaining at least one instance image of the target instance in the target image.

[0040] Optionally, in this embodiment, the above solution can be applied to scenes such as portrait photography, video special effects, AR scenes, autonomous driving, video target tracking, and drone video image processing. When tracking the target object, it is necessary to perform instance segmentation on the pictures in the video stream. Fast and accurate instance segmentation is a good foundation for the next step.

[0041] Through the embodiments provided by the present application, a target image in a video stream is obtained; the target image is input into a target instance segmentation neural network, and a first instance set is output, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of an instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; similar instances of the target instances in the first instance set are determined according to the overlap between the target instances in the first instance set; instances greater than a first predetermined threshold in the similar instances are determined, and at least one instance image of the target instance in the target image is obtained, thereby achieving the purpose of performing instance segmentation on the target image through an instance segmentation neural network having a detection network, a feature map processing layer, and a mask processing layer, and determining the target instance through a threshold value for the instance segmentation result, thereby achieving a fast and accurate technical effect, and further solving the technical problem of low instance segmentation calculation speed in the prior art.

[0042] Optionally, before inputting the target image into the target instance segmentation neural network and outputting the first instance set, the method may include: obtaining a sample image set in the video stream; labeling the target object in each image in the sample image set to obtain a target data set; inputting the labeled data set into a preset instance segmentation neural network, wherein the preset neural network includes a preset detection network, a preset feature map processing layer, a preset mask processing layer and a target loss function, the detection network is used to obtain parameters of the instance bounding box in the preset sample image, the feature map processing layer processes the parameters of the bounding box of the instance in the preset sample image to obtain preset target parameters, the mask processing layer performs instance segmentation on the sample target image according to the preset target parameters, and the target loss function includes a binary cross entropy loss function and an intersection-over-union loss function; when the target loss function meets predetermined conditions, it is determined to be an instance segmentation neural network.

[0043] Optionally, labeling the target object in each picture in the sample picture set to obtain the target data set includes: performing data enhancement on each picture in the sample picture set and the labeling result using the instance segmentation standard data enhancement technology to obtain the target data set.

[0044] Optionally, after labeling the target object in each picture in the sample picture set to obtain the target data set, the method also includes: dividing the target data set into a training set, a validation set and a test set according to a preset ratio, wherein the training set is used for training a preset instance segmentation neural network, the validation set is used for validating the preset instance segmentation neural network, and the test set is used for testing a preset neural network segmentation model.

[0045] Optionally, before inputting the labeled data set into a preset instance segmentation neural network, the method also includes: constructing an initialization detection network, wherein the detection network includes a feature extraction backbone network, a feature enhancement network and a detection head, the feature extraction backbone network is used to extract features of instances of each image in the sample image set to obtain a feature map, the feature enhancement network performs feature map enhancement on the feature map and marks the size of the feature map, and the feature maps marked with different sizes are input into the detection head to obtain parameters of the sample instance bounding box; constructing a preset instance segmentation neural network according to the initialization detection network, the preset feature map processing layer and the preset mask processing, wherein the preset feature map processing layer processes the parameters of the sample instance bounding box to obtain sample target parameters, and the preset mask processing layer performs instance segmentation on the sample target image according to the sample target parameters.

[0046] As an optional embodiment, the present application also provides an instance segmentation method. Figure 3 As shown in FIG. 1 , a flowchart of the instance segmentation method is shown in FIG.

[0047] Step 31: Initialize and preprocess the video image to be detected.

[0048] Video image preprocessing, including: initializing the video image to be detected, denoted as X V , X V The dimension of X V The number is denoted as K V ; The video image to be detected X V According to the standard instance segmentation and annotation method, the objects of interest are manually annotated to obtain the annotation result, which is recorded as G V ; Use instance segmentation standard data enhancement technology to detect the video image X V And the annotation result G VPerform data enhancement to obtain the final data set, denoted as Ω; initialize the ratio of the number of images in the training set, validation set, and test set in the data set Ω, denoted as K1: K2: K3; randomly divide the data set Ω into training set, validation set, and test set according to the ratio of K1: K2: K3, and the obtained training set, validation set, and test set are denoted as Ω respectively. train ,Ω valid ,Ω test .

[0049] Among them, the standard instance segmentation annotation method refers to instance segmentation, which aims to predict the location and semantic mask of each instance in the image, and uses the open source software labelme for annotation.

[0050] Standard data augmentation technology for instance segmentation refers to standard data augmentation technology that expands the data set by flipping, rotating, scaling, translating, adding Gaussian noise, contrast transformation, color transformation, etc. Data augmentation is mainly to reduce the overfitting phenomenon of the network. By transforming the training images, a network with stronger generalization ability can be obtained, which can better adapt to the application scenario.

[0051] Step 32, construct and initialize the convolutional neural detection network.

[0052] According to the standard YOLOv4 network construction method, a standard convolutional neural detection network model is constructed and initialized, denoted as W D , where W D It consists of a feature extraction backbone network, a feature enhancement network and a detection head. The feature extraction backbone network is denoted as W B , the feature enhancement network is denoted as W N , the detection head is denoted as W P ; Connect a convolutional layer to a batch normalization layer and a leaky rectified linear unit (Leaky ReLU) function, and the result is recorded as C BL .

[0053] Among them, W B The standard CSPDarknet53 network is used to extract features;

[0054] In the feature enhancement network W N In the B The results are processed in parallel using the maximum pooling methods of 1×1, 5×5, 9×9, and 13×13, and then the feature maps of different scales after pooling are subjected to tensor splicing operations. The result is recorded as S PP ; S PP Then a cross-level local connection module (CSP module) is connected, and the residual component in it is converted into BL Replace, the result is recorded as A5; connect A5 to a C BL, and then perform two bilinear interpolation upsamplings in sequence, and record the results as A4 and A3 respectively; construct A5, A4, and A3 according to the standard feature pyramid and path enhancement structure, and replace the tensor addition in the path enhancement structure with tensor splicing; connect the results of the four tensor splicing operations in the construction of the standard feature pyramid and path enhancement structure to a cross-level local connection module (CSP module), and use C BL Replace the 1×1 convolutional layer in the standard feature pyramid and path enhancement structure with the standard CoordConv layer to obtain the final feature enhancement network Feature Enhancement Network The three outputs are denoted as P3, P4, and P5 in descending order according to the feature map size;

[0055] In W P In the above example, P3, P4, and P5 are connected to the standard YOLOv3 detection head (Definition 6) through convolutional connections. The first convolutional layer in the YOLOv3 detection head is replaced with the standard CoordConv layer. The center point adjustment formula in the YOLOv3 detection head is increased by a factor α, that is, x = s·(g x +α·σ(p x )-(α-1) / 2), y=s·(g y +α·σ(p y )-(α-1) / 2, where x, y are the coordinates of the center of the bounding box, σ is the Sigmoid function, s is the scale factor, σ(p x ) and σ(p y ) is the center coordinate offset, g x and g y Represents the center coordinates of the true bounding box; the initialization coefficient α = 1.05, and the final detection head is obtained The feature extraction backbone network W B , Feature Enhancement Network and detection head Through convolution connection and initialization, the final detection model is obtained

[0056] Among them, the standard CSPDarknet53 is a Backbone structure generated on the basis of the Yolov3 backbone network Darknet53, drawing on the experience of CSPNet in 2019. It includes 5 CSP modules (cross-level local connection modules); YOLOv4 has improved the accuracy by nearly 10 points compared with YOLOv3, but the speed has hardly decreased. YOLOv4 is a faster and more accurate detection model that only requires a single 1080Ti or 2080Ti to complete training.

[0057] The standard feature pyramid and path enhancement structure is based on the feature pyramid framework and enhances information propagation. It adds a bottom-up enhancement path to improve the propagation of low-level features. Each stage of the newly added third path takes the feature map of the previous stage as input and processes them with a 3×3 convolution layer. The output of the convolution is added to the feature map of the same stage of the top-down path using lateral connections, and then these feature maps are sent to the next stage.

[0058] The standard CoordConv layer is a convolution operation in deep learning that is equivariant to translation, so that the same convolution kernel parameters can be shared at different locations in the image, but the coordinates of the current feature in the image cannot be perceived during the convolution learning process. CoordConv represents the coordinates of the pixel points in the feature map by adding corresponding channels to the input feature map of the convolution, so that the coordinates can be perceived to a certain extent during the convolution learning process to improve the detection accuracy, thereby optimizing feature extraction without increasing the amount of calculation.

[0059] Among them, the standard YOLOv3 detection head, the YOLOv3 network consists of the feature extraction network Darknet53 and the YOLOv3 detection head. The YOLOv3 detection head performs target detection through feature maps of three different scales, which can detect more fine-grained features and is conducive to the detection of small targets.

[0060] Step 33, build and initialize the instance segmentation network.

[0061] The convolutional neural detection network model obtained in step 32 In the above example, we add a feature map preprocessing layer W. Pre and mask branch W M , and obtain the final instance segmentation model, denoted as W IS ,like Figure 4 Shown is the structural diagram of the instance segmentation network.

[0062] In the feature map preprocessing layer W Pre In, according to The test results are obtained by using the formula s area =w*h Calculate the rectangular box area s of each target area , where w and h are the width and height of the detection target respectively; then the detection results are assigned to the corresponding feature enhancement network as mask proposals according to the following rules middle: When , it is assigned to P3 for processing; When , it is assigned to P4 for processing; When , it is assigned to P5 for processing;

[0063] According to the above distribution results, the mask branch is used in the feature enhancement network The corresponding feature map is extracted for instance segmentation; first, the extracted feature map is aligned with the region of interest (RoIAlign) operation, and then c convolutional layers with a kernel size of 3×3, n d deconvolution layers with kernel size 2×2 and The convolutional layer with a convolution kernel size of 1×1 is used to obtain the segmentation result, which is recorded as R1. The channel dimension of each convolutional layer is C D , then add a short-circuit path, which will pass through n c The result of the convolution layer with a kernel size of 3×3 is processed by a convolution layer with a kernel size of 3×3, and then a convolution layer with a kernel size of 1×1 is used to reduce the channel dimension to C. D / 2, pass it into a fully connected layer, and after the operation, it becomes a vector. The resulting vector is transformed into a vector through a matrix to make its spatial size consistent with R1. The final result is recorded as R2; R1 and R2 are added to get the final mask result, recorded as R mask ; The detection model Feature map preprocessing layer W Pre and mask branch W M Directly connect and initialize according to the structure diagram to obtain the final instance segmentation model W IS ;like Figure 5 As shown, the structural diagram of the mask processing layer.

[0064] Step 34, train and adjust the instance segmentation network.

[0065] Initialize the image processing batch size and mini-batch size, denoted as BS and mini-BS respectively; initialize the learning rate, denoted as LR; initialize the weight decay rate and momentum, denoted as WDR and MO respectively; initialize the training cycle, denoted as epoch; and take the value sampled from the Gaussian distribution with mean 0 and variance 1 as the instance segmentation model W IS The initial value of the instance segmentation network parameter W after initialization is obtained old ; Using standard instance segmentation network training technology, the training set Ω in step S31 train The video images are randomly shuffled in order and then passed into the instance segmentation model W obtained in step S33 in small batches. IS ; Calculate the instance segmentation model W IS The loss function value is denoted as Loss old , the loss function calculation formula is as follows: Loss = Loss cls +Loss conf +Loss box +Loss mask , where Loss cls ,Lossconf , and Loss mask is the binary cross entropy loss function, Loss box is the standard CIoU loss function; the standard stochastic gradient descent method is used to adjust the instance segmentation network parameter W old Update, which introduces the standard exponential moving average technique; that is, W EMA =λ*W EMA +(1-λ)*W EMA , initialize the parameter λ = 0.998, and finally get the new network parameters, denoted as W new ; Train the network W IS The final model and parameters are recorded as

[0066] Among them, the DropBlock algorithm is used in the standard instance segmentation network training technology to reduce overfitting. Compared with the Dropout algorithm, the DropBlock algorithm does not drop features in the form of feature points, but concentrates on dropping a certain area, so it is more suitable for instance segmentation tasks to improve the generalization ability of the network; the Mosaic data enhancement is used in the standard instance segmentation network training technology, which splices 4 pictures into one picture by random scaling, random cropping, and random arrangement to improve the performance of small and medium targets; in addition, if the loss function of small objects is lower than a certain threshold in one iteration, the next iteration will use the spliced ​​picture, otherwise normal image training will be used; the standard instance segmentation network training technology will also perform adaptive scaling on the picture; the standard instance segmentation network training technology also uses CmBN, SAT self-adversarial training and other technologies to train the network.

[0067] The standard CIoU loss function, DIoU, is more in line with the target box regression mechanism than GIou. It takes into account the distance, overlap rate and scale between the target and the anchor, making the target box regression more stable. CIoU takes into account the aspect ratio of the three elements of bounding box regression on the basis of DIoU, making the result more accurate.

[0068] Standard exponential moving average technology Exponential moving average technology refers to taking the average value of the parameter over a period of time as the new parameter; compared with directly updating the parameters, the use of exponential moving average can make the parameter learning process smoother, effectively avoid the impact of outliers on parameter updates, and improve the convergence effect of model training.

[0069] Step 35: Perform real-time instance segmentation on the video stream to be detected.

[0070] The video stream collected by the camera in real time is initialized as the video stream to be detected, denoted as V; the video stream V is decoded according to the FFmpeg standard using multi-threading technology, and the decoding result is denoted as Will Enter the video image instance segmentation model obtained in step 34 The output result R is obtained result ; R result Use standard Matrix NMS to suppress the overlapping parts and get the result This is the final video stream instance segmentation result.

[0071] Among them, the standard Matrix NMS calculates the intersection over union (IoU) between any two boxes through a matrix parallel operation. For example, when calculating the suppression coefficient for a certain prediction box B, Matrix NMS calculates the IoU between all prediction boxes with scores higher than B and prediction box B through matrix parallelism, and then makes an approximate estimate based on these IOUs and the probability of being suppressed for prediction boxes with scores higher than B, and estimates the suppression coefficient of B, thereby realizing parallel calculation Soft NMS, which improves detection accuracy while avoiding a reduction in inference speed.

[0072] Through this embodiment, the video stream collected by the camera in real time is initialized as the video stream to be detected, denoted as V; the video stream V is decoded according to the FFmpeg standard using multi-threading technology, and the decoding result is recorded as Will Enter the video image instance segmentation model obtained in step 34 The output result R is obtained result ; R result Use standard Matrix NMS to suppress the overlapping parts and get the result This is the final video stream instance segmentation result, which can achieve instance segmentation quickly and accurately.

[0073] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0074] According to another aspect of the embodiment of the present invention, a neural network-based instance segmentation device for implementing the above-mentioned neural network-based instance segmentation method is also provided. As shown in the figure, the neural network-based instance segmentation device includes: a first acquisition unit 61, an output unit 63, a first determination unit 65 and a second determination unit 67.

[0075] The first acquisition unit 61 is used to acquire a target picture in a video stream.

[0076] The output unit 63 is used to input the target image into the target instance segmentation neural network and output a first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer and a mask processing layer. The detection network is used to obtain the parameters of the instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain the target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters.

[0077] The first determining unit 65 is configured to determine similar instances of the target instance in the first instance set according to the overlap between the target instances in the first instance set.

[0078] The second determining unit 67 is configured to determine instances greater than a first predetermined threshold in the similar instances, and obtain at least one instance image of the target instance in the target image.

[0079] Through the embodiment provided by the present application, the first acquisition unit 61 acquires the target image in the video stream; the output unit 63 inputs the target image into the target instance segmentation neural network and outputs the first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer and a mask processing layer, the detection network is used to obtain the parameters of the instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain the target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; the first determination unit 65 determines the similar instances of the target instances in the first instance set according to the overlap between the target instances in the first instance set; the second determination unit 67 determines the instances greater than the first predetermined threshold in the similar instances, and obtains at least one instance image of the target instance in the target image. The purpose of performing instance segmentation on the target image by using the instance segmentation neural network having the detection network, the feature map processing layer and the mask processing layer and determining the target instance by the threshold value of the instance segmentation result is achieved, thereby achieving a fast and accurate technical effect, thereby solving the technical problem of low instance segmentation calculation speed in the prior art.

[0080] As an optional embodiment, the above device may include:

[0081] A second acquisition unit is used to input the target image into the target instance segmentation neural network, and before outputting the first instance set, acquire a sample image set in the video stream;

[0082] The obtaining unit is used to label the target object in each picture in the sample picture set to obtain the target data set;

[0083] An input unit, used to input the labeled data set into a preset instance segmentation neural network, wherein the preset neural network includes a preset detection network, a preset feature map processing layer, a preset mask processing layer and a target loss function, the detection network is used to obtain parameters of the instance bounding box in the preset sample image, the feature map processing layer processes the parameters of the bounding box of the instance in the preset sample image to obtain preset target parameters, the mask processing layer performs instance segmentation on the sample target image according to the preset target parameters, and the target loss function includes a binary cross entropy loss function and an intersection-over-union loss function;

[0084] The third determining unit is used to determine it as an instance segmentation neural network when the target loss function meets a predetermined condition.

[0085] As an optional embodiment, the obtaining unit may include:

[0086] A module is obtained, which is used to perform data enhancement on each image and annotation result in the sample image set using the instance segmentation standard data enhancement technology to obtain a target data set.

[0087] As an optional embodiment, the above device may include:

[0088] The partitioning unit is used to mark the target object in each picture in the sample picture set, and after obtaining the target data set, divide the target data set into a training set, a validation set and a test set according to a preset ratio, wherein the training set is used for training the preset instance segmentation neural network, the validation set is used for validating the preset instance segmentation neural network, and the test set is used for testing the preset neural network segmentation model.

[0089] As an optional embodiment, the above device may include:

[0090] The first construction unit is used to construct an initialization detection network before inputting the labeled data set into the preset instance segmentation neural network, wherein the detection network includes a feature extraction backbone network, a feature enhancement network and a detection head, the feature extraction backbone network is used to extract features of each image instance in the sample image set to obtain a feature map, the feature enhancement network enhances the feature map and marks the size of the feature map, and inputs the feature maps marked with different sizes into the detection head to obtain the parameters of the sample instance bounding box;

[0091] The second construction unit is used to construct a preset instance segmentation neural network based on the initialized detection network, the preset feature map processing layer and the preset mask processing, wherein the preset feature map processing layer processes the parameters of the sample instance bounding box to obtain the sample target parameters, and the preset mask processing layer performs instance segmentation on the sample target image according to the sample target parameters.

[0092] According to another aspect of the embodiments of the present invention, an electronic device for implementing the above-mentioned neural network-based instance segmentation method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a server. Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.

[0093] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0094] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0095] S1, obtain the target image in the video stream;

[0096] S2, inputting the target image into the target instance segmentation neural network, and outputting a first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of the instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters;

[0097] S3, determining similar instances of the target instance in the first instance set according to the overlap between the target instances in the first instance set;

[0098] S4, determining instances greater than a first predetermined threshold in the similar instances, and obtaining at least one instance picture of the target instance in the target picture.

[0099] Alternatively, a person skilled in the art may understand that: Figure 7 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Figure 7The electronic device and the electronic equipment described above are not limited in structure. Figure 7 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 7 Different configurations are shown.

[0100] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the neural network-based instance segmentation method and device in the embodiments of the present invention. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, to implement the above-mentioned neural network-based instance segmentation method. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely located relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as target images, results of target image instance segmentation, etc. As an example, such as Figure 7 As shown, the memory 702 may include, but is not limited to, the first acquisition unit 61, the output unit 63, the first determination unit 65, and the second determination unit 67 in the neural network-based instance segmentation device. In addition, other module units in the neural network-based instance segmentation device may also be included but are not limited to, which will not be repeated in this example.

[0101] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0102] In addition, the electronic device further includes: a display 708 for displaying the image to be instance segmented and the result of instance segmentation; and a connection bus 710 for connecting various module components in the electronic device.

[0103] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.

[0104] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned method for instance segmentation based on a neural network. The computer program is configured to execute the steps of any of the above-mentioned method embodiments when it is run.

[0105] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0106] S1, obtain the target image in the video stream;

[0107] S2, inputting the target image into the target instance segmentation neural network, and outputting a first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of the instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters;

[0108] S3, determining similar instances of the target instance in the first instance set according to the overlap between the target instances in the first instance set;

[0109] S4, determining instances greater than a first predetermined threshold in the similar instances, and obtaining at least one instance picture of the target instance in the target picture.

[0110] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0111] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0112] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.

[0113] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0117] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A neural network-based instance segmentation method, characterized in that: include: Get the target image in the video stream; Inputting the target image into a target instance segmentation neural network, and outputting a first instance set, wherein the instance segmentation neural network includes: a detection network, a feature map processing layer, and a mask processing layer, the detection network is used to obtain parameters of an instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; The step of inputting the target image into a target instance segmentation neural network and outputting a first instance set comprises: Detecting the area of ​​the rectangular frame of the target image to obtain a detection result, wherein the detection result is used to indicate the size of the rectangular frame area; Based on the detection result, the target image is assigned to the feature enhancement network output object in the feature map processing layer for processing, wherein, when the detection result is less than or equal to a first preset threshold, the feature enhancement network output object is a first feature enhancement network output, when the detection result is greater than the first preset threshold and less than or equal to a second preset threshold, the feature enhancement network output object is a second feature enhancement network output, and when the detection result is greater than the second preset threshold, the feature enhancement network output object is a third feature enhancement network output, and the first feature enhancement network output, the second feature enhancement network output, and the third feature enhancement network output are three outputs of feature map sizes in the feature enhancement network from large to small, respectively; determine similar instances of the target instances in the first instance set according to the overlap between the target instances in the first instance set; Determine instances in the similar instances that are greater than a first predetermined threshold, and obtain at least one instance picture of the target instance in the target picture.

2. The method according to claim 1, characterized in that Before inputting the target image into the target instance segmentation neural network and outputting the first instance set, the method includes: Get a collection of sample images in the video stream; Annotate the target object in each picture in the sample picture set to obtain a target data set; Input the labeled data set into a preset instance segmentation neural network, wherein the preset neural network includes a preset detection network, a preset feature map processing layer, a preset mask processing layer and a target loss function, the detection network is used to obtain the parameters of the instance bounding box in the preset sample image, the feature map processing layer processes the parameters of the bounding box of the instance in the preset sample image to obtain the preset target parameters, the mask processing layer performs instance segmentation on the sample target image according to the preset target parameters, and the target loss function includes a binary cross entropy loss function and an intersection-over-union loss function; When the objective loss function satisfies a predetermined condition, it is determined to be the instance segmentation neural network.

3. The method according to claim 2, characterized in that The target object in each picture in the sample picture set is labeled to obtain a target data set including: The instance segmentation standard data enhancement technology is used to perform data enhancement on each image and annotation result in the sample image set to obtain the target data set.

4. The method according to claim 2, characterized in that: After labeling the target object in each picture in the sample picture set to obtain the target data set, the method further includes: The target data set is divided into a training set, a validation set and a test set according to a preset ratio, wherein the training set is used for training the preset instance segmentation neural network, the validation set is used for validating the preset instance segmentation neural network, and the test set is used for testing the preset neural network segmentation model.

5. The method according to claim 2, characterized in that: Before inputting the labeled data set into a preset instance segmentation neural network, the method further includes: Constructing an initialization detection network, wherein the detection network includes a feature extraction backbone network, a feature enhancement network and a detection head, wherein the feature extraction backbone network is used to extract features from each image instance in the sample image set to obtain a feature map, the feature enhancement network performs feature map enhancement on the feature map and marks the size of the feature map, and the feature maps marked with different sizes are input into the detection head to obtain parameters of the sample instance bounding box; The preset instance segmentation neural network is constructed according to the initialized detection network, the preset feature map processing layer and the preset mask processing, wherein the preset feature map processing layer processes the parameters of the sample instance bounding box to obtain sample target parameters, and the preset mask processing layer performs instance segmentation on the sample target image according to the sample target parameters.

6. An instance segmentation device based on a neural network, characterized in that: include: A first acquisition unit, used to acquire a target image in a video stream; an output unit, configured to input the target image into a target instance segmentation neural network and output a first instance set, wherein the instance segmentation neural network comprises: a detection network, a feature map processing layer and a mask processing layer, the detection network is configured to obtain parameters of an instance bounding box, the feature map processing layer processes the parameters of the bounding box to obtain target parameters, and the mask processing layer performs instance segmentation on the target image according to the target parameters; The output unit is further used to detect the rectangular frame area of ​​the target image to obtain a detection result, wherein the detection result is used to indicate the size of the rectangular frame area; based on the detection result, the target image is assigned to the feature enhancement network output object in the feature map processing layer for processing, wherein, when the detection result is less than or equal to a first preset threshold, the feature enhancement network output object is a first feature enhancement network output, when the detection result is greater than the first preset threshold and less than or equal to a second preset threshold, the feature enhancement network output object is a second feature enhancement network output, when the detection result is greater than the second preset threshold, the feature enhancement network output object is a third feature enhancement network output, and the first feature enhancement network output, the second feature enhancement network output, and the third feature enhancement network output are three outputs of feature map sizes in the feature enhancement network from large to small respectively; A first determining unit, configured to determine similar instances of the target instance in the first instance set according to the overlap between the target instances in the first instance set; The second determining unit is used to determine instances in the similar instances that are greater than a first predetermined threshold, and obtain at least one instance image of the target instance in the target image.

7. The device according to claim 6, characterized in that The device comprises: A second acquisition unit is used for inputting the target image into the target instance segmentation neural network and obtaining a sample image set in the video stream before outputting the first instance set; An obtaining unit, used for marking the target object in each picture in the sample picture set to obtain a target data set; An input unit, used to input the labeled data set into a preset instance segmentation neural network, wherein the preset neural network includes a preset detection network, a preset feature map processing layer, a preset mask processing layer and a target loss function, the detection network is used to obtain parameters of the instance bounding box in the preset sample image, the feature map processing layer processes the parameters of the bounding box of the instance in the preset sample image to obtain preset target parameters, the mask processing layer performs instance segmentation on the sample target image according to the preset target parameters, and the target loss function includes a binary cross entropy loss function and an intersection-over-union loss function; The third determining unit is used to determine the instance segmentation neural network when the target loss function meets a predetermined condition.

8. The device according to claim 7, characterized in that The obtaining unit comprises: The module is used to perform data enhancement on each image and annotation result in the sample image set using the instance segmentation standard data enhancement technology to obtain the target data set.

9. The device according to claim 7, characterized in that The device also includes: A division unit is used to mark the target object in each picture in the sample picture set, and after obtaining the target data set, divide the target data set into a training set, a verification set and a test set according to a preset ratio, wherein the training set is used for training the preset instance segmentation neural network, the verification set is used for verification of the preset instance segmentation neural network, and the test set is used for testing the preset neural network segmentation model.

10. The device according to claim 7, characterized in that The device also includes: A first construction unit is used to construct an initialization detection network before inputting the labeled data set into a preset instance segmentation neural network, wherein the detection network includes a feature extraction backbone network, a feature enhancement network and a detection head, the feature extraction backbone network is used to extract features of each image instance in the sample image set to obtain a feature map, the feature enhancement network performs feature map enhancement on the feature map and marks the size of the feature map, and the feature maps marked with different sizes are input into the detection head to obtain parameters of the sample instance bounding box; The second construction unit is used to construct the preset instance segmentation neural network according to the initialized detection network, the preset feature map processing layer and the preset mask processing, wherein the preset feature map processing layer processes the parameters of the sample instance bounding box to obtain sample target parameters, and the preset mask processing layer performs instance segmentation on the sample target image according to the sample target parameters.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 5 when executed.