Abnormal behavior model construction method fusing hierarchical aggregation of domain context
Through optimization of GAN network and Unet network, an abnormal behavior model with hierarchical aggregation in the fusion field is constructed, which solves the problems of weak feature representation ability and low prediction frame resolution, and improves the recognition accuracy of abnormal behavior and image segmentation ability. A more accurate identification of abnormal behavior is achieved.
Patent Information
- Application Number
- CN202411420597.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the detection of abnormal behavior, existing image recognition technology has problems such as weak feature representation ability and low predicted frame resolution, which cannot meet the actual needs, and has not paid attention to the motion consistency between the predicted frame and the sample, resulting in blurred feature performance of abnormal details. Clear, insufficient accuracy.
By optimizing the GAN network and Unet network, an abnormal behavior model of context hierarchical aggregation in the fusion field is built, and one-dimensional convolution, ECA channel attention module, hierarchical feature extraction module and feature fusion module are used to enhance feature representation capabilities and images Segmentation performance, focusing on the motion consistency between the predicted frame and the sample.
The recognition accuracy and image segmentation ability of abnormal behavior are improved. The generated abnormal behavior model has better abnormal behavior recognition ability, and can capture context and local features more accurately, improving recognition accuracy.
Smart Images

Figure CN119229211A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method for constructing an abnormal behavior model integrating domain context hierarchical aggregation. Background Art
[0002] In recent years, the application of image recognition technology has become more and more extensive, the technology has become more and more mature, and people's requirements for image recognition technology have been continuously improved, such as applying it to the field of anomaly detection. Due to the increasing demand and application in a wide range of fields such as risk management, compliance, security, financial monitoring, health and medical risks, and artificial intelligence security, abnormal behavior detection plays an increasingly important role and has been emphasized in various fields including data mining, machine learning, computer vision and statistics.
[0003] Deep learning has been applied to the field of anomaly detection due to its excellent ability in complex data processing. Traditional deep learning networks include convolutional neural networks (CNN), recurrent neural networks (RNN), autoencoders (AE) and generative adversarial networks (GAN), and have achieved good performance.
[0004] However, in actual applications, as the amount of data processed continues to increase, the data becomes more and more complex, and a large number of normal samples and a scarcity of abnormal samples lead to the emergence of class imbalance. In order to solve the above technical problems, technicians proposed a solution to identify abnormal behaviors based on predicted frames. However, technicians found that the existing technical solutions have at least the following technical problems: The currently generated models have problems such as weak feature representation ability and low prediction frame resolution, which cannot meet actual needs. At the same time, the existing recognition methods do not pay attention to the motion consistency between the predicted frame and the sample, resulting in unclear representation of abnormal detail features. Therefore, the existing recognition models are not accurate enough to meet actual needs. Summary of the invention
[0005] In order to overcome the above-mentioned technical problems existing in the prior art, an embodiment of the present invention provides a method for constructing an abnormal behavior model by integrating domain context hierarchical aggregation, which optimizes the existing GAN network and Unet network, enhances the clarity of the input image, and enhances the context interaction and channel interaction of the features, thereby effectively improving the accuracy of abnormal behavior recognition.
[0006] In order to achieve the above-mentioned purpose, an embodiment of the present invention provides a method for constructing an abnormal behavior model by integrating domain context hierarchical aggregation, the method comprising: obtaining an initial Unet network; constructing a residual block based on one-dimensional convolution, and constructing a feature enhancement module based on an ECA channel attention module and the residual block; creating a corresponding hierarchical aggregation feature extraction module based on a hierarchical feature extraction rule; constructing a feature fusion module based on a preset frame channel processing rule; optimizing the initial Unet network based on the feature enhancement module, the hierarchical aggregation feature extraction module and the feature fusion module to generate an optimized network; obtaining an initial loss function, optimizing a GAN network based on the initial loss function and the optimized network, and generating an abnormal behavior model.
[0007] Preferably, the initial Unet network includes a multi-layer network, and the creation of a corresponding hierarchical aggregation feature extraction module based on the hierarchical feature extraction rule includes: creating an initial convolution block; constructing a complexity processing unit based on point convolution and depth convolution, connected to the initial convolution block, the complexity processing unit is used to reduce the complexity of the output information of the initial convolution unit to generate processed information; constructing a channel increase unit, connected to the complexity processing unit, the channel increase unit is used to extract features from the processed information to obtain extracted information; constructing a comparison unit, which is used to determine the current pixel and its domain pixel in the extracted information in turn, and compare the current pixel and its domain pixel in each layer of the Unet network to obtain comparison information; constructing a feature extraction unit connected to the channel increase unit and the comparison unit, the feature extraction unit is used to perform a hierarchical aggregation feature extraction operation based on the extracted information and the comparison information to obtain an output feature map.
[0008] Preferably, the feature extraction of the processed information to obtain the extracted information includes: performing dimensionality upgrading on the processed information based on one-dimensional convolution to obtain the upgraded information; performing feature extraction on the upgraded information based on depthwise separable convolution to obtain extracted features; performing dimensionality reduction on the extracted features based on one-dimensional convolution to obtain the extracted information.
[0009] Preferably, the feature fusion module is constructed based on the preset frame channel processing rules, including: constructing a pooling unit, which is used to perform global average pooling processing on the output feature map to obtain a width feature vector and a height feature vector; constructing a stacking unit, which is connected to the pooling unit, and the stacking unit is used to perform a transpose stacking operation on the width feature vector and the height feature vector to generate a stacked feature layer; constructing an intermediate processing unit, which is connected to the stacking unit, and the intermediate processing unit is used to perform convolution processing, normalization processing and activation function processing on the stacked feature layer in sequence to obtain a processed vector; constructing a fused feature generation unit, which is connected to the intermediate processing unit, and the fused feature generation unit is used to process the processed vector to generate a new width feature vector and a new height feature vector; constructing a fusion unit, which is connected to the fused feature generation unit, and the fusion unit is used to generate a fused feature based on the new width feature vector and the new height feature vector.
[0010] Preferably, the initial loss function includes a generator loss function and a discriminator loss function, and the generator loss function includes a generator adversarial loss function. The method also includes: after obtaining the initial loss function, determining the difference information between the generated image and the real image; determining the similarity between the generated image and the real image based on the difference information, and determining the pixel loss function based on the similarity; calculating the motion vector between the generated image and the real image, determining the corresponding optical flow information based on the motion vector, and determining the optical flow loss function based on the optical flow information; optimizing the generator loss function based on the pixel loss function, the optical flow loss function and the generator adversarial loss function to generate an optimized generator loss function; generating an optimized loss function based on the optimized generator loss function and the discriminator loss function; the method also includes: optimizing the GAN network based on the optimized loss function and the optimized network to generate an abnormal behavior model.
[0011] Preferably, the discriminator loss function is characterized as: , ,
[0012] Among them, P represents the weight of the discriminator's adversarial loss function, It is represented as the discriminant score of the discriminator for the real sample. It is characterized as the discriminant score of the discriminator on the generated sample; the optimized generator loss function is characterized as: , , in, , Represented as the weight of the generator's adversarial loss function, Characterized as the optical flow of the generated sample, Characterize the stream of real samples.
[0013] Preferably, the abnormal behavior model construction method also includes: after generating the abnormal behavior model, determining the peak signal-to-noise ratio between the real frame and the predicted frame based on the abnormal behavior model; performing normalization processing on the peak signal-to-noise ratio to obtain a normalized signal-to-noise ratio; determining an abnormal score value based on the normalized signal-to-noise ratio; and generating a corresponding abnormal recognition result based on the abnormal score value and a preset score threshold.
[0014] Preferably, the peak signal-to-noise ratio is characterized by:
[0015] in, It is characterized by the maximum pixel value of the predicted frame; the abnormal score value is characterized by: .
[0016] Preferably, the method further comprises: performing abnormal behavior analysis on the input image based on the abnormal behavior model to generate an analysis result; generating a ROC curve based on a preset scoring threshold and the analysis result; performing performance evaluation based on the ROC curve to generate a performance evaluation result AUC, wherein the performance evaluation result AUC is characterized as: ,
[0017] in, Represented as the predicted probability of a positive sample, It represents the predicted probability of negative samples, M represents the number of positive samples, and N represents the number of negative samples.
[0018] Through the technical solution provided by the present invention, the present invention has at least the following technical effects: By optimizing the existing GAN network and Unet network, on the one hand, the Unet network is optimized to effectively improve its image segmentation and recognition capabilities; on the other hand, the loss function of the GAN network is optimized according to the motion data of the behavior to generate an abnormal behavior model with better abnormal behavior recognition capabilities, effectively improving the recognition capabilities of abnormal behaviors.
[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0021] Figure 1 It is a specific implementation flow chart of the abnormal behavior model construction method of integrating domain context hierarchical aggregation provided by an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a feature enhancement module provided by an embodiment of the present invention;
[0023] Figure 3 is a schematic diagram of a hierarchical aggregation feature extraction module provided in an embodiment of the present invention;
[0024] Figure 4 is a schematic diagram of a feature fusion module provided in an embodiment of the present invention;
[0025] Figure 5 is a schematic diagram of an optimized network provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0027] The terms "system" and "network" in the embodiments of the present invention can be used interchangeably. "Multiple" means two or more than two. In view of this, "multiple" can also be understood as "at least two" in the embodiments of the present invention. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, it should be understood that in the description of the embodiments of the present invention, the words "first", "second", etc. are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0028] See also Figure 1 The embodiment of the present invention provides a method for constructing an abnormal behavior model integrating domain context hierarchical aggregation, the method comprising: S10) Obtaining the initial Unet network; S20) constructing a residual block based on the one-dimensional convolution, and constructing a feature enhancement module based on the ECA channel attention module and the residual block; S30) creating a corresponding hierarchical aggregation feature extraction module based on the hierarchical feature extraction rule; S40) constructing a feature fusion module based on preset frame channel processing rules; S50) optimizing the initial Unet network based on the feature enhancement module, the hierarchical aggregation feature extraction module and the feature fusion module to generate an optimized network; S60) Obtaining an initial loss function, optimizing the GAN network based on the initial loss function and the optimized network, and generating an abnormal behavior model.
[0029] In a possible implementation, first obtain an initial Unet network, which is a Unet network with only initial parameters. In actual application, although the original Unet network has a certain image classification capability, when performing image prediction in the activity field, the generated images have technical problems of low resolution and low clarity, which has a certain impact on subsequent image classification and recognition. In order to improve the quality of the image, the initial Unet network is optimized. Specifically, a residual block is constructed based on one-dimensional convolution, and a feature enhancement module is constructed based on the ECA channel attention module and the residual block. Please refer to Figure 2 , which is a schematic diagram of a feature enhancement module provided by an embodiment of the present invention. In the application process, the image is first input into a residual block composed of a one-dimensional convolution block for preliminary processing. The preliminary processing of the residual block can avoid the problems of gradient explosion and gradient disappearance. After processing, the processed data is input into the ECA channel attention module. The ECA channel attention mechanism is used to learn the importance of different channels and further determine the output weights of different channels, thereby greatly improving the richness of the extracted features, and at the same time being able to clearly distinguish the foreground and background, making subsequent image recognition more convenient.
[0030] Thus, an image with a more obvious foreground and background distinction effect is obtained. However, in the process of recognition, since the motion behavior is recognized, and the motion behavior often has a correlation between the past and the present, the existing general abnormal behavior model does not pay attention to the motion consistency between the abnormal behavior and the predicted behavior, but directly judges the abnormal behavior of each frame of the image, so the detailed features of the abnormal behavior are unclear and the accuracy is low.
[0031] In order to solve the above technical problems, a hierarchical aggregation feature extraction module is further constructed. In an embodiment of the present invention, the initial Unet network includes a multi-layer network, and the hierarchical aggregation feature extraction module corresponding to the hierarchical feature extraction rule is created, including: creating an initial convolution block; constructing a complexity processing unit based on point convolution and depth convolution, connected to the initial convolution block, the complexity processing unit is used to reduce the complexity of the output information of the initial convolution unit to generate processed information; constructing a channel increase unit, connected to the complexity processing unit, the channel increase unit is used to extract features from the processed information to obtain extracted information; constructing a comparison unit, which is used to determine the current pixel and its domain pixel in the extracted information in turn, and compare the current pixel and its domain pixel in each layer of the Unet network to obtain comparison information; constructing a feature extraction unit connected to the channel increase unit and the comparison unit, the feature extraction unit is used to perform a hierarchical aggregation feature extraction operation based on the extracted information and the comparison information to obtain an output feature map.
[0032] In one possible implementation, see Figure 3 , which is a schematic diagram of a hierarchical aggregation feature extraction module provided in an embodiment of the present invention. Specifically, firstly, an initial convolution block is created, and then the initial convolution block is sequentially connected with point convolution and depth convolution, and the output information of the initial convolution block is processed by point convolution and depth convolution to reduce the computational complexity; after the processed information is generated, its input channel is added with a unit for processing. In an embodiment of the present invention, the feature extraction of the processed information to obtain the extracted information includes: performing dimensionality increase processing on the processed information based on one-dimensional convolution to obtain the dimensionality increase information; performing feature extraction on the dimensionality increase information based on depth separable convolution to obtain the extracted features; performing dimensionality reduction processing on the extracted features based on one-dimensional convolution to obtain the extracted information.
[0033] Specifically, a reverse bottleneck structure is introduced to process the processed information. The reverse bottleneck structure includes a one-dimensional convolution, a depth-wise separable convolution (for example, a 3x3 depth-wise convolution) and a one-dimensional convolution arranged in sequence. The input processed information is up-dimensioned through the one-dimensional convolution, and then the increased model complexity is compensated by the 3x3 depth-wise convolution to increase the number of channels, and on this basis, better feature extraction is achieved. Finally, the extracted features are reduced in dimensionality through the one-dimensional convolution to map the extracted features back to the low-dimensional space to obtain the extracted information.
[0034] On the other hand, by simulating the self-attention mechanism, a detailed comparison is made between a pixel and other pixels in its neighborhood, and this comparison is calculated hierarchically at multiple levels to enrich the contextual information, that is, to obtain comparative information. Finally, the gradient propagation is improved by including shortcut connections, and the number of filters is adjusted through point convolution to generate the output feature map, thereby achieving effective extraction of local features in the input feature image and distinction between foreground and background features.
[0035] In an embodiment of the present invention, by constructing the above-mentioned hierarchical aggregation feature extraction module, the ability to capture contextual features can be effectively improved, the effective association of motion consistency between the predicted image and the abnormal image is achieved, the target capture capability is effectively improved, and the network can more accurately aggregate contextual features and extract local features.
[0036] On this basis, the features extracted by the hierarchical aggregation feature extraction module can be input into the Unet network for image segmentation processing. However, in actual application, technicians found that the above method can generate prediction frames with large errors, but the model still fails to fully identify local feature anomalies and has weak feature representation capabilities. Therefore, in order to solve this technical problem, technicians further constructed a feature fusion module.
[0037] In an embodiment of the present invention, the feature fusion module is constructed based on a preset frame channel processing rule, including: constructing a pooling unit, which is used to perform global average pooling processing on the output feature map to obtain a width feature vector and a height feature vector; constructing a stacking unit, which is connected to the pooling unit, and the stacking unit is used to perform a transpose stacking operation on the width feature vector and the height feature vector to generate a stacked feature layer; constructing an intermediate processing unit, which is connected to the stacking unit, and the intermediate processing unit is used to perform convolution processing, normalization processing and activation function processing on the stacked feature layer in sequence to obtain a processed vector; constructing a fused feature generation unit, which is connected to the intermediate processing unit, and the fused feature generation unit is used to process the processed vector to generate a new width feature vector and a new height feature vector; constructing a fusion unit, which is connected to the fused feature generation unit, and the fusion unit is used to generate a fused feature based on the new width feature vector and the new height feature vector.
[0038] In one possible implementation, see Figure 4, which is a schematic diagram of a feature fusion module provided in an embodiment of the present invention. After obtaining the output feature map, a global average pooling process is performed on it to generate corresponding feature vectors Cx1xW and CxHx1 in the width and height directions, and then the generated width feature vector and height feature vector are transposed and stacked to generate a stacked feature layer Cx1x(H+W). The generated stacked feature layer is then further convolved, normalized, and activated, and then divided into two dimensions of width and height for further processing. After transposition, new feature vectors Cx1xH and CxHx1 are generated, the number of channels is adjusted through 1x1 convolution, and the sigmoid function is used to obtain the final width and height attention weights.
[0039] In the embodiment of the present invention, through the feature fusion module, effective interaction of cross-channel information and deep fusion of context features are achieved without sacrificing channel dimension. This spatial channel attention mechanism not only improves feature extraction performance, but also achieves a good balance between maintaining computational efficiency and complexity.
[0040] After building the above model, the initial Unet network is optimized through the above modules to generate an optimized network, for example, see Figure 5 , which is a schematic diagram of the optimized network provided by the embodiment of the present invention. In the application process, after the image to be subjected to abnormal behavior recognition is input into the optimized network, the image features are first enhanced by the feature enhancement module to facilitate the subsequent foreground and background distinction and image segmentation; then the hierarchical aggregation feature extraction module is input to extract features, and the extracted features can effectively combine the domain context and improve the extraction of local features, thereby obtaining richer local features and effectively distinguishing foreground features from background features. On this basis, the input feature fusion module is further analyzed to achieve effective interaction of cross-channel information and deep fusion of context features. On this basis, the target in the image is segmented and recognized, which greatly improves the accuracy of image segmentation and recognition.
[0041] At this time, the initial loss function is obtained, and the GAN network is optimized according to the initial loss function and the optimized network. Specifically, the generative network of the GAN network is optimized through the optimized network to obtain an optimized generative network. After a new image is obtained through the optimized generative network, it is input into the discriminative network for recognition training, and the final abnormal behavior model is generated.
[0042] In an embodiment of the invention, the defects existing in the existing abnormal behavior prediction method are improved by optimizing the Unet network, and the domain context aggregation capability and local feature extraction capability of the extracted features are enhanced based on the hierarchical aggregation feature extraction module. At the same time, the self-attention mechanism is simulated to improve the interaction capability of cross-channel information and the fusion effect of context features, thereby effectively improving the image segmentation and recognition performance of the Unet network. On this basis, the GAN network is optimized by using the Unet network, so that the finally generated abnormal behavior model has better abnormal behavior recognition capability, and the recognition accuracy of abnormal behaviors with motion attributes is improved.
[0043] During the training process, a simple loss function cannot reflect the relevant characteristics of abnormal behaviors with motion attributes, so the loss function is adaptively optimized.
[0044] In an embodiment of the present invention, the initial loss function includes a generator loss function and a discriminator loss function, the generator loss function includes a generator adversarial loss function, and the method further includes: after obtaining the initial loss function, determining the difference information between the generated image and the real image; determining the similarity between the generated image and the real image based on the difference information, and determining the pixel loss function based on the similarity; calculating the motion vector between the generated image and the real image, determining the corresponding optical flow information based on the motion vector, and determining the optical flow loss function based on the optical flow information; optimizing the generator loss function based on the pixel loss function, the optical flow loss function and the generator adversarial loss function to generate an optimized generator loss function; generating an optimized loss function based on the optimized generator loss function and the discriminator loss function; the method further includes: optimizing the GAN network based on the optimized loss function and the optimized network to generate an abnormal behavior model.
[0045] In a possible implementation, in order to make the generator have better performance, the generated image is made similar to the real frame to better deceive the discriminator and achieve better training effect. After obtaining the initial loss function, the difference information between the generated image and the real image is further determined, and then the similarity between the generated image and the real image is calculated based on the difference information, and the corresponding pixel loss function is determined based on the similarity; on the other hand, optical flow is a technology used to describe the movement of pixels in an image. By calculating the motion vector between the generated image and the real image, the motion information of the target object can be obtained, specifically the motion timing information. Therefore, in an embodiment of the present invention, the generated image and the real image are compared to obtain the optical flow information between the two. According to the optical flow information, it can be ensured that the generated image matches the real image in timing.
[0046] Furthermore, the generator loss function is optimized by combining the above-mentioned pixel loss function and optical flow loss function with the adversarial loss function of the generator to obtain the optimized generator loss function, and the optimized loss function is generated according to the optimized generator loss function and the discriminator loss function, thereby achieving the optimization of the overall loss function of the GAN network.
[0047] In an embodiment of the present invention, by optimizing the generator loss function, the generator is forced to generate an image sequence with realism, pixel similarity and temporal consistency, so that the generated image sequence is more realistic and more similar to the real image, which is more conducive to the subsequent training of the GAN network.
[0048] In this embodiment of the present invention, the discriminator loss function is characterized as: , , ,
[0049] Among them, P represents the weight of the discriminator's adversarial loss function, It is represented as the discriminant score of the discriminator for the real sample. It is characterized as the discriminant score of the discriminator on the generated sample; the optimized generator loss function is characterized as: , ,
[0050] in, Represented as the weight of the generator's adversarial loss function, Represented as the weight of the pixel loss function, Represented as the weight of the optical flow loss function, Characterized as the optical flow of the generated sample, Characterized as the optical flow of real samples.
[0051] After the model is generated, the generated model is used to identify abnormal actions in the image or video to generate an identification result that distinguishes whether it is an abnormal action. In an embodiment of the present invention, the abnormal behavior model construction method further includes: after generating the abnormal behavior model, determining the peak signal-to-noise ratio (PSNR) between the real frame and the predicted frame based on the abnormal behavior model, and the peak signal-to-noise ratio (PSNR) is characterized by:
[0052] in, Characterized as the maximum pixel value of the predicted frame; performing normalization processing on the peak signal-to-noise ratio PSNR to obtain a normalized signal-to-noise ratio; determining an abnormal score value based on the normalized signal-to-noise ratio, and the abnormal score value is characterized as: ; A corresponding abnormality identification result is generated based on the abnormality score value and a preset score threshold.
[0053] In a possible implementation, after the image to be analyzed for abnormal behavior is input into the abnormal behavior model, the corresponding predicted frame is obtained, and the peak signal-to-noise ratio (PSNR) between the predicted frame and the corresponding real frame is calculated. Specifically, the peak signal-to-noise ratio (PSNR) is calculated by the above formula (6). The larger the PSNR is, the more similar the predicted frame I ̂ is to the real frame I. At this time, the calculated PSNR is normalized to [0,1], and then the abnormal score value is calculated. Specifically, the abnormal score value is calculated according to the above formula (7). Finally, it is determined whether the action in the input image or video is abnormal based on the preset score threshold and the abnormal score value.
[0054] However, in actual applications, the recognition effect of the trained model may not meet the expected expectations. Therefore, it is necessary to evaluate its actual performance, promptly identify models with insufficient performance, and adjust them in time to generate a model with sufficient anomaly recognition performance.
[0055] In an embodiment of the present invention, the method further includes: performing abnormal behavior analysis on the input image based on the abnormal behavior model to generate an analysis result; generating a ROC curve based on a preset scoring threshold and the analysis result; performing performance evaluation based on the ROC curve to generate a performance evaluation result AUC, wherein the performance evaluation result AUC is characterized as: , ,
[0056] in, Represented as the predicted probability of a positive sample, It represents the predicted probability of negative samples, M represents the number of positive samples, and N represents the number of negative samples.
[0057] In a possible implementation, in order to evaluate the effectiveness of abnormal behavior detection of the present model, the receiver operating characteristic curve (ROC) is calculated by gradually changing the threshold of the conventional score. Specifically, the conventional score threshold is changed to generate multiple preset score thresholds, and then based on each preset score threshold, the input image is analyzed for abnormal behavior according to the abnormal behavior model to generate a corresponding analysis result. The analysis result is a recognition result for identifying whether the behavior is abnormal. Based on the recognition result and whether the behavior is actually abnormal behavior, a corresponding ROC curve is generated.
[0058] Then, the cumulative area under the ROC curve (AUC) is further calculated. Specifically, the AUC is calculated using the above formula (8), and then the calculated value is used as a scalar to evaluate the abnormal recognition performance of the model, that is, the evaluation result of the abnormal recognition performance of the abnormal behavior model is obtained.
[0059] On this basis, if it is found that the abnormality recognition performance of the current abnormal behavior model cannot meet the actual requirements, the abnormal behavior model is further optimized to make it have sufficient abnormal behavior recognition performance to meet the actual needs.
[0060] The optional implementation modes of the embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above implementation modes. Within the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical scheme of the embodiments of the present invention, and these simple modifications all belong to the protection scope of the embodiments of the present invention.
[0061] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.
[0062] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a single-chip microcomputer, a chip or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0063] In addition, various implementation modes of the embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed by the embodiments of the present invention.
Claims
1. A method for constructing an abnormal behavior model integrating domain context hierarchical aggregation, characterized in that: The method comprises: Get the initial Unet network; A residual block is constructed based on one-dimensional convolution, and a feature enhancement module is constructed based on the ECA channel attention module and the residual block; Create a corresponding hierarchical aggregation feature extraction module based on the hierarchical feature extraction rules; Construct a feature fusion module based on preset frame channel processing rules; Optimizing the initial Unet network based on the feature enhancement module, the hierarchical aggregation feature extraction module and the feature fusion module to generate an optimized network; An initial loss function is obtained, and the GAN network is optimized based on the initial loss function and the optimized network to generate an abnormal behavior model.
2. The method according to claim 1, characterized in that The initial Unet network includes a multi-layer network, and the corresponding hierarchical aggregation feature extraction module is created based on the hierarchical feature extraction rule, including: Create the initial convolutional block; Building a complexity processing unit based on point convolution and depth convolution, connected to the initial convolution block, the complexity processing unit is used to perform complexity reduction processing on the output information of the initial convolution unit to generate processed information; Constructing a channel adding unit connected to the complexity processing unit, wherein the channel adding unit is used to perform feature extraction on the processed information to obtain extracted information; Constructing a comparison unit, which is used to determine the current pixel and its neighborhood pixel in the extracted information in sequence, and compare the current pixel and its neighborhood pixel in each layer of the Unet network to obtain comparison information; A feature extraction unit connected to the channel adding unit and the comparison unit is constructed, and the feature extraction unit is used to perform a hierarchical aggregation feature extraction operation based on the extracted information and the comparison information to obtain an output feature map.
3. The method according to claim 2, characterized in that The step of extracting features from the processed information to obtain extracted information includes: Performing dimension-upgrading processing on the processed information based on one-dimensional convolution to obtain dimension-upgraded information; Performing feature extraction on the dimension-upgraded information based on depthwise separable convolution to obtain extracted features; The extracted features are subjected to dimensionality reduction processing based on one-dimensional convolution to obtain extracted information.
4. The method according to claim 2, characterized in that: The feature fusion module is constructed based on the preset frame channel processing rules, including: Constructing a pooling unit for performing global average pooling processing on the output feature map to obtain a width feature vector and a height feature vector; Constructing a stacking unit connected to the pooling unit, the stacking unit is used to perform a transposition stacking operation on the width feature vector and the height feature vector to generate a stacked feature layer; Constructing an intermediate processing unit connected to the stacking unit, wherein the intermediate processing unit is used to sequentially perform convolution processing, normalization processing, and activation function processing on the stacked feature layer to obtain a processed vector; Constructing a fusion feature generation unit connected to the intermediate processing unit, wherein the fusion feature generation unit is used to process the processed vector to generate a new width feature vector and a new height feature vector; A fusion unit is constructed and connected to the fusion feature generating unit, wherein the fusion unit is used to generate fused features based on the new width feature vector and the new height feature vector.
5. The method according to any one of claims 1 to 4, characterized in that: The initial loss function includes a generator loss function and a discriminator loss function, the generator loss function includes a generator adversarial loss function, and the method further includes: After obtaining the initial loss function, determining the difference information between the generated image and the real image; Determine the similarity between the generated image and the real image based on the difference information, and determine a pixel loss function based on the similarity; Calculating a motion vector between the generated image and the real image, determining corresponding optical flow information based on the motion vector, and determining an optical flow loss function based on the optical flow information; Optimizing the generator loss function based on the pixel loss function, the optical flow loss function and the generator adversarial loss function to generate an optimized generator loss function; Generate an optimized loss function based on the optimized generator loss function and the discriminator loss function; Said also includes: The GAN network is optimized based on the optimized loss function and the optimized network to generate an abnormal behavior model.
6. The method according to claim 5, characterized in that The discriminator loss function is characterized as: , , , Among them, P represents the weight of the discriminator's adversarial loss function, It is represented as the discriminant score of the discriminator for the real sample. Characterized as the discriminant score of the discriminator on the generated samples; The optimized generator loss function is characterized as: , , in, , Represented as the weight of the generator's adversarial loss function, Characterized as the optical flow of the generated sample, Characterized as the optical flow of real samples.
7. The method according to claim 6, characterized in that The method further comprises: After generating the abnormal behavior model, determining a peak signal-to-noise ratio between a real frame and a predicted frame based on the abnormal behavior model; Performing normalization processing on the peak signal-to-noise ratio to obtain a normalized signal-to-noise ratio; Determining an abnormality score value based on the normalized signal-to-noise ratio; A corresponding abnormality identification result is generated based on the abnormality score value and a preset score threshold.
8. The method according to claim 7, characterized in that The peak signal-to-noise ratio is characterized by: , in, Characterized as the maximum pixel value of the predicted frame; The abnormal score value is characterized as:
9. The method according to claim 1, characterized in that: The method further comprises: Performing abnormal behavior analysis on the input image based on the abnormal behavior model to generate an analysis result; Generate a ROC curve based on a preset scoring threshold and the analysis result; A performance evaluation is performed based on the ROC curve to generate a performance evaluation result AUC, which is characterized by: , , in, Represented as the predicted probability of a positive sample, It represents the predicted probability of negative samples, M represents the number of positive samples, and N represents the number of negative samples.
Citation Information
Patent Citations
Target detection method and system based on cross-layer attention mechanism feature fusion
CN114299281A
Fault diagnosis method based on fusion of residual learning and attention mechanism
CN115640531A
Medical image fusion and organ segmentation method and system based on abdomen CT
CN117455935A
Method for reconstructing abnormal behavior detection model of generative adversarial network
CN117876959A
KR20240103889A