Abnormal detection method, device and computer system for traffic water scene
Through multi-level transfer learning and error optimization technology, an abnormal detection network for target scenarios was built, which solved the problems of unstable abnormal detection results and high computing resources in traffic water scenes, and achieved efficient and accurate abnormal detection effects.
Patent Information
- Application Number
- CN202411441577.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The prior art has unstable detection results, high false alarm rate and missed alarm rate in traffic water scenes, and requires a large amount of computing resources to handle complex scenarios, and is sensitive to data distribution changes, making it difficult to adapt to new scenario types. change.
By building a target scene anomaly detection network with multi-level transfer learning, using unlabeled and marked water scene image template library, gradually optimize the transition and target networks by comparing the error optimization of neural networks and scheduling networks, and improving the universality of the network Sex and generalization ability.
It significantly improves the accuracy and computing efficiency of scene abnormality detection in traffic waters, improves the ability to identify complex scenarios, reduces false alarms and missed response rates, and enhances the ability to adapt to new scenario types.
Smart Images

Figure CN118968390B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and more specifically, to a method, device and computer system for detecting anomalies in traffic water scenes. Background Art
[0002] Traffic water scenes, such as ports and waterways, are a key part of water transportation. Ensuring the safety and normal operation of these scenes is crucial, as water transportation involves numerous ship navigation, cargo loading and unloading, and various water operations. In such a complex environment, timely and accurate detection of abnormal situations in the scene, such as ship collision accidents, channel blockages, abnormal ship behavior, etc., is of great significance for preventing accidents, ensuring the safety of personnel and property, and maintaining the efficient operation of the entire water transportation. However, there are many challenges in achieving efficient and accurate anomaly detection in traffic water scenes. Traffic water scenes are highly complex and dynamic, with diverse elements in the scene, including ships of different types and sizes, complex port facilities, and changeable water flow and weather conditions. These factors make it very difficult to accurately identify and judge abnormal situations from image or video data. At present, there are some technical means in the field of scene anomaly detection, but they all have certain limitations when applied to traffic water scenes.
[0003] Some traditional image processing methods, such as those based on manual feature extraction and simple classifiers, often rely on manually designed features, such as edge detection, shape descriptors, etc. These manual features often lack sufficient representativeness and generalization capabilities for complex traffic water scenes. For example, under different lighting conditions, ship perspectives, or water surface fluctuations, manual features may change significantly, resulting in unstable detection results and high false alarm and missed alarm rates. Although scene detection methods based on traditional machine learning algorithms can classify scenes and detect anomalies to a certain extent, they often require a lot of time and computing resources for feature engineering and model training when processing large amounts of complex traffic water image data. Moreover, these methods are sensitive to changes in data distribution, and their performance will significantly decrease when encountering new scene types or changes that are not fully reflected in the training data. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and computer system for detecting anomalies in traffic water scenes. This application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides an anomaly detection method for a traffic water scene, the method comprising: obtaining a water scene image template library for scene anomaly detection, the water scene image template library comprising an unlabeled water scene image template library without adding a true category mark and a labeled water scene image template library with adding a true category mark, the true category mark representing the image scene classification of the water scene image template; loading the unlabeled water scene image template library into a debugged control neural network and a simulated training scene anomaly detection network, respectively, and performing an anomaly detection on the simulated training scene anomaly detection network according to an error between an execution result of the control neural network and an execution result of the simulated training scene anomaly detection network. The network parameters of the transition scene anomaly detection network are optimized to obtain a transition scene anomaly detection network; the labeled water scene image template composition library is loaded into the control neural network and the transition scene anomaly detection network respectively, and according to the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, the network parameters of the transition scene anomaly detection network are optimized to obtain a target scene anomaly detection network; the water scene image to be subjected to anomaly detection is loaded into the target scene anomaly detection network to obtain an anomaly detection result corresponding to the water scene image to be subjected to anomaly detection obtained by executing the target scene anomaly detection network.
[0006] In a second aspect, the present application provides an anomaly detection device for traffic water scenes, the device comprising: a template library acquisition module, used to acquire a water scene image template library for scene anomaly detection, the water scene image template library comprising an unlabeled water scene image template library without adding real category tags and a labeled water scene image template library with adding real category tags, the real category tags representing image scene classifications of water scene image templates; a network transition training module, used to load the unlabeled water scene image template library into a debugged control neural network and a simulated training scene anomaly detection network, respectively, and perform training on the simulated training scene anomaly detection network according to the error between the execution result of the control neural network and the execution result of the simulated training scene anomaly detection network. The network parameters are optimized to obtain a transition scene anomaly detection network; a target network training module is used to load the labeled water scene image template library into the control neural network and the transition scene anomaly detection network respectively, and according to the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, the network parameters of the transition scene anomaly detection network are optimized to obtain a target scene anomaly detection network; an anomaly detection module is used to load the water scene image to be subjected to anomaly detection into the target scene anomaly detection network to obtain an anomaly detection result corresponding to the water scene image to be subjected to anomaly detection obtained by executing the target scene anomaly detection network.
[0007] In a third aspect, the present application provides a computer system comprising: one or more processors; a memory; one or more computer programs; wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method as described above is implemented.
[0008] The beneficial effects of the present application include: In the present application, the target scene anomaly detection network for determining the anomaly detection result corresponding to the water scene image to be detected is obtained based on multi-level transfer learning, so that the computational efficiency and accuracy of the target scene anomaly detection network obtained are enhanced, and the accuracy of scene anomaly detection can be effectively improved. Specifically, transfer learning includes multiple levels, and the water scene image template library includes an unlabeled water scene image template composition library without adding real category labels and a labeled water scene image template composition library with added real category labels. Different levels load one of the water scene image template composition libraries for debugging, that is, the unlabeled water scene image template composition library is loaded into the debugged control neural network and the to-be-trained scene anomaly detection network respectively, and the execution result of the control neural network is used as constraint information to optimize the network parameters of the to-be-trained scene anomaly detection network, so as to realize the debugging of the first-level network transfer learning; this level can improve the universality of the network based on a large number of unlabeled water scene image templates, and the reasoning accuracy is higher.
[0009] Next, the library of labeled water scene image templates is loaded into the control neural network and the transition scene anomaly detection network respectively. The real category labels and the execution results of the control neural network are used as constraint labels to optimize the network parameters of the transition scene anomaly detection network to obtain the target scene anomaly detection network, thereby realizing another level of network transfer learning. The detailed optimization of the transition scene anomaly detection network can be completed, and on the premise that the network produces generalization, the error caused by the diversification of the template is optimized again, so that the target scene anomaly detection network has the best reasoning accuracy for the reasoning target. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flow chart of an anomaly detection method for a traffic water scene provided in an embodiment of the present application.
[0011] Figure 2 It is a schematic diagram of the composition of an anomaly detection device for a traffic water scene provided in an embodiment of the present application.
[0012] Figure 3 It is a schematic diagram of the composition of a computer system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0014] The execution subject of the abnormality detection method for traffic water scene in the embodiment of the present application is a computer system, including but not limited to a server, a personal computer, a laptop computer, a tablet computer, a smart phone, etc. The embodiment of the present application provides an abnormality detection method for traffic water scene, such as Figure 1 As shown, the method includes:
[0015] Step S100: Obtain a water scene image template library for scene anomaly detection, the water scene image template library comprising an unlabeled water scene image template library without adding true category tags and a labeled water scene image template library with adding true category tags, the true category tags represent the image scene classification of the water scene image template.
[0016] In step S100, the computer system obtains a water scene image template library for scene anomaly detection. This image template library is the basic data source of the entire scene anomaly detection method, and it contains two types of water scene image templates, namely, an unlabeled water scene image template library and a labeled water scene image template library.
[0017] For the unlabeled water scene image template library, the image templates therein have no real category labels added. The so-called unlabeled means that the computer system has not pre-set specific category labels for these images. For example, the computer system obtains some images of water scenes, which may contain various traffic-related scene elements, such as ship sailing, port docking, etc., but in the case of unlabeled, the computer system does not know which category of scenes these images should be classified into, and only collects these original water scene images and stores them as templates.
[0018] The image templates in the library of labeled water scene image templates have added real category labels. The real category labels here represent the image scene classification of the water scene image template. For example, the computer system has clearly defined the scene classification and labeled some water scene images. For example, if an image shows a scene of many ships loading and unloading cargo at a port terminal, the computer system will label it as a "port loading and unloading scene"; if another image shows a scene of a ship sailing normally on a waterway, it will be labeled as a "waterway navigation scene", etc.
[0019] The computer system can obtain water scene images through image acquisition devices (such as cameras, etc.), and then store these images in unlabeled and labeled image template libraries according to certain storage rules. If image format conversion or preprocessing is involved, some image processing algorithms may be used, such as image normalization processing, the formula is: , where I represents the pixel value of the original image, I' represents the normalized pixel value, min(I) and max(I) are the minimum and maximum values of the original image pixel values, respectively. This normalization process helps to improve the accuracy and efficiency of subsequent image processing and analysis. In this way, the computer system builds a water scene image template library, laying the foundation for the subsequent training and optimization of the scene anomaly detection network.
[0020] Step S200: The unlabeled water scene image template library is loaded into the debugged control neural network and the simulated training scene anomaly detection network respectively, and the network parameters of the simulated training scene anomaly detection network are optimized according to the error between the execution result of the control neural network and the execution result of the simulated training scene anomaly detection network to obtain the transition scene anomaly detection network.
[0021] In step S200, the computer system loads the unlabeled water scene image template library into the debugged control neural network and the simulated training scene anomaly detection network respectively.
[0022] The control neural network is a debugged neural network with certain structure and parameters, which can process the input water scene image template and output corresponding results. The simulated training scene anomaly detection network is a network that is being constructed and optimized by the computer system, and its initial structure and parameters are, for example, based on some preset algorithms or model settings.
[0023] When the computer system loads the unlabeled water scene image template library into the two networks, the two networks will process the input image templates separately. For example, assuming that there is an image in the unlabeled water scene image template library that is a relatively complex harbor water scene, the control neural network may extract and analyze the various elements in the image, such as the outline of the harbor, some floating objects on the water surface, or docked ships, based on its internal neuron connections and weight settings, and then output a result. The pseudo-training scene anomaly detection network also processes this image. Since it is still in the pseudo-training state, its output result may be different from that of the control neural network.
[0024] This process can pre-process the image data, such as adjusting the image size, color channels, etc. to meet the input requirements of the neural network. In the process of neural network processing images, taking the Convolutional Neural Network (CNN) as an example, it extracts features from the image through structures such as convolution layers and pooling layers. The neurons in the convolution layer perform convolution operations with the local area of the image through the convolution kernel. For example, a 3×3 convolution kernel slides on the image, and the formula is: , where x represents the pixel value of the input image, w is the weight of the convolution kernel, b is the bias term, and y is the output value after convolution.
[0025] Then, the computer system optimizes the network parameters of the pseudo-training scene anomaly detection network based on the error between the execution results of the control neural network and the execution results of the pseudo-training scene anomaly detection network. This error reflects the degree of difference between the two networks when processing the same unlabeled water scene image template. For example, if the result of the control neural network output for a certain image shows that some features of the image are more matched with a certain type of scene, while the output result of the pseudo-training scene anomaly detection network shows a different tendency, then this difference constitutes an error. By calculating this error, the computer system can adjust the parameters in the pseudo-training scene anomaly detection network, such as adjusting the connection weights between neurons, so that the output result of the pseudo-training scene anomaly detection network is closer to the output result of the control neural network, and gradually optimize the pseudo-training scene anomaly detection network to finally obtain a transition scene anomaly detection network. This optimization process may use some optimization algorithms, such as the gradient descent algorithm, which minimizes the error by adjusting the network parameters along the gradient direction of the error function.
[0026] Step S300: Load the library of labeled water scene image templates into the control neural network and the transition scene anomaly detection network respectively, and optimize the network parameters of the transition scene anomaly detection network according to the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network to obtain the target scene anomaly detection network.
[0027] In step S300, the computer system loads the library of labeled water scene image templates into the control neural network and the transition scene anomaly detection network respectively.
[0028] The image templates in the library of labeled water scene image templates are all given real category labels, which clearly indicate the scene classification of the image. The control neural network is the network that has been debugged before, and the transition scene anomaly detection network is the intermediate network obtained through the previous steps.
[0029] For example, there is an image labeled as "ship collision accident scene" in the library of labeled water scene image templates. When this image is loaded into the reference neural network, the reference neural network will process the image according to its internal structure, parameters and pre-learned feature patterns, and output the relevant results about the classification of this image scene. The transition scene anomaly detection network will also process this image and output the results.
[0030] The computer system optimizes the network parameters of the transition scenario anomaly detection network based on the error between the execution result of the transition scenario anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scenario anomaly detection network.
[0031] The processing of loading images into neural networks may involve the conversion of digital representations of images. Taking a common RGB image as an example, each pixel in the image can be represented by a three-dimensional vector, corresponding to the intensity values of the three color channels of red, green, and blue. In a neural network, the image is processed by multiple layers of neurons, and each layer of neurons performs linear transformation and nonlinear activation operations on the input data. The linear transformation can be expressed as y=Wx+b, where x is the input vector, W is the weight matrix, b is the bias vector, and y is the output vector; nonlinear activation functions such as the ReLU (Rectified Linear Unit) function, y=max(0,x), can introduce nonlinear factors into the neural network and enhance the network's expressive power.
[0032] The error between the execution result of the transition scene anomaly detection network and the true category label reflects the degree of deviation of the network from the correct classification of the image. For example, for the image of "ship collision accident scene", if the transition scene anomaly detection network mistakenly classifies it as "normal navigation scene", a large error will be generated. At the same time, the error between the execution results of the control neural network and the transition scene anomaly detection network reflects the difference between the two when processing the same image. The computer system calculates these errors and uses optimization techniques such as back propagation algorithm to adjust the parameters in the transition scene anomaly detection network, such as weights and biases, to gradually reduce these errors and finally obtain the target scene anomaly detection network. The core of the back propagation algorithm is to derive the parameters in the network according to the error, so as to determine the direction and step size of parameter adjustment to optimize the performance of the network.
[0033] Step S400: Loading the water scene image to be subjected to anomaly detection into the target scene anomaly detection network, and obtaining anomaly detection results corresponding to the water scene image to be subjected to anomaly detection executed by the target scene anomaly detection network.
[0034] In step S400, the computer system loads the water scene image to be detected for anomaly into the target scene anomaly detection network to obtain anomaly detection results corresponding to the image.
[0035] The target scene anomaly detection network is a network carefully optimized through a series of previous steps, and it has the ability to accurately detect anomalies in water scene images. The water scene images to be detected are images to be detected by the computer system, and these images may contain various traffic water scene conditions.
[0036] For example, the water scene image to be detected may be a picture of a port channel, with multiple ships, dock facilities, and some water surface conditions. After the computer system loads this image into the target scene anomaly detection network, the network will process the image according to its complex internal structure and parameter settings.
[0037] The target scene anomaly detection network, for example, adopts a deep neural network architecture and receives image data at the input layer of the network. First, the image data is preprocessed to meet the network input requirements, such as converting the image to a specific size and data format. Inside the network, each layer of neurons performs a linear combination operation with the input data through a weight matrix, such as the common formula y=Wx+b, where x is the input vector (here it is represented by the preprocessed image data), W is the weight matrix, b is the bias vector, and y is the output after the linear combination. Afterwards, the linear combination result is nonlinearly transformed through a nonlinear activation function (such as the ReLU function: y=max(0,x)) to enhance the network's expressive power.
[0038] In this process, the target scene anomaly detection network will extract and analyze the features of the water scene image to be detected. It will identify various features in the image, such as the distribution of ships, movement status, whether there are abnormal objects on the waterway, and whether the fluctuation of the water surface conforms to the normal mode. The comprehensive judgment results of these features ultimately form the abnormality detection results of the image. If the distribution of ships in the image is chaotic and does not conform to normal navigation rules, or if unidentified objects interfere with the waterway, the network may determine it as an abnormal situation; if various elements in the image conform to the normal traffic water scene mode, it is determined to be normal. The computer system comprehensively analyzes the water scene image to be detected through the target scene anomaly detection network, and obtains accurate anomaly detection results, thereby realizing effective monitoring and abnormal judgment of traffic water scenes.
[0039] As an implementation manner, in step S200, before the unlabeled water scene image template library is loaded into the debugged control neural network and the to-be-trained scene anomaly detection network, the following may also be included:
[0040] Step S201: The labeled water scene image template library is loaded into the control neural network and the basic scene anomaly detection network respectively, and the network parameters of the basic scene anomaly detection network are optimized according to the error between the execution result of the basic scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scene anomaly detection network to obtain the simulated training scene anomaly detection network.
[0041] In step S201, the computer system loads the library of labeled water scene image templates into the control neural network and the basic scene anomaly detection network respectively, and optimizes the network parameters of the basic scene anomaly detection network according to the error between the execution result of the basic scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scene anomaly detection network to obtain the simulated training scene anomaly detection network.
[0042] First, the images in the labeled water scene image template library have clear real category labels, which are accurate identification of image scene classification. For example, one image is labeled as "normal navigation scene", and the other is "port operation scene". The control neural network is a debugged network, and the basic scene anomaly detection network is an initial network, whose structure and parameters may be set based on some general models.
[0043] When the computer system loads the labeled image into the two networks, the basic scene anomaly detection network will process the image according to its own structure and initial parameters. For example, for an image of a "normal sailing scene", the basic scene anomaly detection network may extract features such as the shape of the ship and the sailing direction in the image, and then give a result about the scene classification. The control neural network will also process this image and output the result.
[0044] There is an error between the execution result of the base scenario anomaly detection network and the corresponding true category label. For example, if the true label is "normal navigation scene", but the base scenario anomaly detection network misjudges it as other scenes, an error occurs. At the same time, there is also an error between the execution results of the control neural network and the base scenario anomaly detection network. These two errors reflect the accuracy of the base scenario anomaly detection network and the difference with the control neural network.
[0045] For the processing of loading images into the neural network, image preprocessing is required, such as adjusting the image size to meet the requirements of the network input layer. In the calculation process of the neural network, it is assumed that the neuron calculation of a certain layer of the basic scene anomaly detection network adopts a linear combination method, and the formula is y=Wx+b, where x is the input vector (representing the image feature vector after preprocessing), W is the weight matrix, b is the bias vector, and y is the output vector.
[0046] The computer system calculates the above two errors and uses an optimization algorithm to adjust the parameters of the basic scene anomaly detection network. For example, a stochastic gradient descent algorithm may be used to update the weight W and bias b according to the back propagation of the error. After multiple such adjustments, the performance of the basic scene anomaly detection network is gradually improved, and finally a pseudo-training scene anomaly detection network is obtained. Compared with the basic scene anomaly detection network, this pseudo-training scene anomaly detection network has improved in accuracy and consistency with the control neural network, laying the foundation for subsequent further optimization.
[0047] As an implementation manner, in step S200, before the unlabeled water scene image template library is loaded into the debugged control neural network and the to-be-trained scene anomaly detection network, the following may also be included:
[0048] Step S202: inputting the unlabeled water scene image template library into the basic scene anomaly detection network, optimizing the network parameters of the basic scene anomaly detection network according to the execution result of the basic scene anomaly detection network, and obtaining the simulated training scene anomaly detection network.
[0049] In step S202, the computer system inputs the unlabeled water scene image template library into the basic scene anomaly detection network, and optimizes the network parameters of the basic scene anomaly detection network according to the execution results of the basic scene anomaly detection network, thereby obtaining a simulated training scene anomaly detection network.
[0050] The image templates in the library of unlabeled water scene image templates have no real category labels, which means that the computer system does not know in advance what scene category these images belong to. For example, the images in this library may contain various traffic water scenes, such as some complex port scenes, with many ships, dock facilities, different water flow conditions, etc., but there is no clear mark whether this is a normal port operation scene or a potentially dangerous scene.
[0051] The basic scene anomaly detection network is an initial network with a certain initial structure and parameter settings. When the computer system inputs unlabeled images into this basic scene anomaly detection network, the network will process these images. For example, the neurons in the network will extract various element features in the image, perhaps by sliding the convolution kernel in the convolution layer on the image to capture local features. Assuming the convolution operation is used, for a local area I in the image (I is a small matrix representing the local pixel value of the image), the convolution kernel is K (also a small matrix), and the result O (also a matrix) after the convolution operation is calculated as , where i and j represent the position index in the matrix.
[0052] The basic scene anomaly detection network performs feature extraction and analysis on the input unlabeled image based on its own structure and parameters, and then outputs an execution result. Although this execution result does not have a real category label as a direct reference, the computer system can evaluate the performance of the network based on this result. For example, if the network outputs a result for an unlabeled harbor scene image and shows that the feature extraction of the ship in the image is not good, it may be manifested as unclear outlines of the ship or difficult to distinguish from the background.
[0053] The computer system adjusts the network parameters based on the execution results of the basic scenario anomaly detection network. When adjusting the parameters, an optimization algorithm can be used, such as the adaptive moment estimation (Adam) optimization algorithm. When the Adam algorithm updates the network parameters (such as weight w), it comprehensively considers the first-order moment estimation (mean) and second-order moment estimation (variance) of the gradient. The update formula is ,in is the learning rate, m is the first-order moment estimate, v is the second-order moment estimate, is a small number used to prevent the denominator from being zero.
[0054] By continuously inputting unlabeled water scene image templates, the computer system continuously adjusts the network parameters according to the execution results of the basic scene anomaly detection network, so that the performance of the basic scene anomaly detection network is gradually improved, and finally a quasi-training scene anomaly detection network is obtained. Compared with the initial basic scene anomaly detection network, this quasi-training scene anomaly detection network has better performance in processing unlabeled water scene images, providing a more suitable foundation for subsequent network optimization and anomaly detection tasks.
[0055] As an implementation mode, the execution result of the network includes a probabilistic label and one or more transition component execution results; the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained according to the corresponding neural network; based on this, in step S200, according to the error between the execution result of the control neural network and the execution result of the proposed training scene anomaly detection network, the network parameter of the proposed training scene anomaly detection network is optimized to obtain the transition scene anomaly detection network, which may include:
[0056] Step S210: generating a first probabilistic label cost value according to an error between the probabilistic label output by the control neural network and the corresponding probabilistic label obtained by executing the pseudo-training scene anomaly detection network;
[0057] Step S220: generating a first transition component cost value according to an error between a transition component execution result output by the control neural network and a corresponding transition component execution result obtained by executing the pseudo training scenario anomaly detection network;
[0058] Step S230: Optimize network parameters of the proposed training scene anomaly detection network according to the first probabilistic labeling cost value and the first transition component cost value to obtain a transition scene anomaly detection network.
[0059] In steps S210-S230, the computer system performs a series of operations based on the execution results of the control neural network and the simulated training scenario anomaly detection network to optimize the network parameters of the simulated training scenario anomaly detection network, thereby obtaining a transition scenario anomaly detection network.
[0060] In step S210, the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained by the corresponding neural network, that is, a pseudo label. After the computer system loads the unlabeled water scene image template library into the debugged control neural network and the simulated training scene anomaly detection network, the two networks will generate a probabilistic label for each image template.
[0061] For example, for an unlabeled water scene image, the control neural network may output that the image belongs to the "ship navigation scene" with a probability of 0.7, the "port docking scene" with a probability of 0.2, and the "other scenes" (such as some abnormal scenes or scenes that are difficult to accurately classify) with a probability of 0.1. The scene anomaly detection network to be trained may output that the same image belongs to the "ship navigation scene" with a probability of 0.5, the "port docking scene" with a probability of 0.3, and the "other scenes" with a probability of 0.2.
[0062] The computer system calculates the error between the two probabilistic labels. A common way to calculate the error is to use the cross-entropy loss function. Assume that the probability distribution of the control neural network output is (Here n is the number of scene classification categories, for example n=3 in the above example), the probability distribution of the output of the anomaly detection network for the training scene is , the cross entropy formula is The value of this cross entropy is the first probabilistic labeling cost value, which quantifies the degree of difference between the two probabilistic labels. The larger the cost value, the greater the difference between the two networks in terms of probabilistic labeling, which means that the performance of the training scenario anomaly detection network in this regard is more inconsistent with that of the control neural network.
[0063] In step S220, the execution results of the transition components are part of the network execution results. These transition components play the role of intermediate processing and feature conversion in the internal structure of the neural network. For example, in a complex neural network structure, there may be some hidden layers, and the neuron operation results in these hidden layers can be regarded as the execution results of the transition components.
[0064] Assume that the output of a hidden layer (transition component) of the control neural network for an unlabeled water scene image is a vector (Here m is the number of neurons in the hidden layer). The output of the corresponding hidden layer (transition component) of the scene anomaly detection network to be trained for the same image is the vector The computer system calculates the error between the two vectors, for example, using the Euclidean distance formula, ie , this distance value d is the cost value of the first transition component. This value reflects the degree of difference between the two networks in the execution results of the transition component. If this value is large, it means that there is a large difference between the training scenario anomaly detection network and the control neural network during the intermediate processing inside the network.
[0065] In step S230, after obtaining the first probabilistic labeling cost value and the first transition component cost value, the computer system uses these two values to adjust the network parameters of the anomaly detection network for the proposed training scenario. The network parameters include important parameters such as weights and biases in the neural network.
[0066] In the optimization process, a gradient-based optimization algorithm can be used, such as the Stochastic Gradient Descent (SGD) algorithm or its variants. Taking the SGD algorithm as an example, assuming that the parameters of the anomaly detection network to be trained are ( can be a vector containing all weights and biases), the loss function L is composed of the first probabilistic label cost value and the first transition component cost value (for example, simple addition: ,in is the loss function part corresponding to the first probabilistic labeling cost value, is the part of the loss function corresponding to the cost value of the first transition component).
[0067] The SGD algorithm adjusts the parameter variables according to the loss function L Gradient To update the parameter variables, the update formula is ,in is the learning rate, which determines the step size of each parameter update. Through multiple iterations of this update process, the parameters of the scene anomaly detection network to be trained are continuously adjusted, so that the first probabilistic labeling cost value and the first transition component cost value gradually decrease, and finally the optimized transition scene anomaly detection network is obtained. When processing unlabeled water scene images, this transition scene anomaly detection network is closer to the control neural network in terms of both probabilistic labeling and transition component execution results, thereby improving the performance and accuracy of the network and laying a better foundation for subsequent further optimization or anomaly detection tasks.
[0068] By executing steps S210-S230, the computer system can effectively use the results of the control neural network to optimize the training scene anomaly detection network, and gradually build a network structure that is more suitable for traffic water scene anomaly detection tasks.
[0069] As an implementation method, the execution result of the network includes a probabilistic label and one or more transition component execution results; the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained based on the corresponding neural network. Based on this, in step S300, based on the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, the network parameter of the transition scene anomaly detection network is optimized to obtain the target scene anomaly detection network, which may include:
[0070] Step S310: generating a first true category label cost value according to the error between the probabilistic label obtained by executing the transition scene anomaly detection network and the corresponding true category label;
[0071] Step S320: generating a second probabilistic label cost value according to an error between the probabilistic label output by the control neural network and the corresponding probabilistic label obtained by executing the transition scene anomaly detection network;
[0072] Step S330: generating a second transition component cost value according to an error between a transition component execution result output by the control neural network and a corresponding transition component execution result obtained by executing the transition scenario anomaly detection network;
[0073] Step S340: Optimize network parameters of the transition scene anomaly detection network according to the first true category label cost value, the second probabilistic label cost value, and the second transition component cost value to obtain a target scene anomaly detection network.
[0074] In steps S310-S340, the computer system optimizes the network parameters of the transition scene anomaly detection network based on a specific error calculation method and a plurality of error factors, thereby obtaining a target scene anomaly detection network.
[0075] In step S310, the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained by the transition scene anomaly detection network, and the true category label is the exact image scene classification of the water scene image template. For example, there is an image in the library of labeled water scene image templates, and its true category label is "ship collision accident scene". When this image is loaded into the transition scene anomaly detection network, the network may output that the probability of the image belonging to the "ship collision accident scene" is 0.6, the probability of belonging to the "normal navigation scene" is 0.3, and the probability of belonging to "other scenes" (such as port operation scenes, etc.) is 0.1.
[0076] In order to measure the difference between the inference results of the transition scene anomaly detection network and the actual situation, the computer system needs to calculate the error between the two. A variety of loss functions can be used to calculate this error, such as the mean squared error (MSE). Assume that for a certain image, the probability distribution of the output of the transition scene anomaly detection network is (n is the number of scene classification categories), and the corresponding true category label is represented as a one-hot encoding vector (For example, if it is the kth type of scene, then =1, others =0, ). Then the mean square error formula is The calculated mean square error value is the cost value of the first true category label. This cost value reflects the degree of deviation from the true category label when the transition scene anomaly detection network classifies the image. If this value is large, it means that there is a large difference between the network's inference result and the actual situation, and further optimization is needed.
[0077] In step S320, when the images in the labeled water scene image template library are loaded into the control neural network and the transition scene anomaly detection network respectively, both networks will output probabilistic labels for image scene classification. For example, for an image with a real category labeled as "port congestion scene", the control neural network may output that the image belongs to the "port congestion scene" with a probability of 0.8, the probability of belonging to the "normal port operation scene" is 0.1, and the probability of belonging to the "other scene" is 0.1; while the transition scene anomaly detection network may output that the image belongs to the "port congestion scene" with a probability of 0.6, the probability of belonging to the "normal port operation scene" is 0.2, and the probability of belonging to the "other scene" is 0.2.
[0078] The computer system generates a second probabilistic label cost value by calculating the error between the two probabilistic labels. The cross-entropy loss function can also be used here. Assume that the probability distribution of the control neural network output is , the probability distribution of the transition scene anomaly detection network output is , the cross entropy formula is The value of this cross entropy is the second probabilistic labeling cost value. This value quantifies the degree of difference between the control neural network and the transition scene anomaly detection network in terms of probabilistic labeling. It helps the computer system understand the performance of the transition scene anomaly detection network in inference probability relative to the control neural network so that it can be adjusted during the optimization process.
[0079] In step S330, the transition component execution result is the output result of the intermediate processing process inside the neural network. For example, in the neural network structure, there may be multiple hidden layers, and the outputs of these hidden layers can be regarded as the transition component execution results. Assume that the output result of a hidden layer (transition component) of the reference neural network for a certain image is a vector (m is the number of neurons in the hidden layer). The output of the corresponding hidden layer (transition component) of the transition scene anomaly detection network for the same image is the vector .
[0080] The computer system calculates the error between the two vectors to generate the second transition component cost value. The Euclidean distance formula can be used for calculation, that is, This distance value d is the cost value of the second transition component. This value reflects the difference in the execution results of the transition component during the internal intermediate processing of the two networks. A larger cost value of the second transition component indicates that there is a large difference between the transition scene anomaly detection network and the control neural network in the processing of the internal structure of the network, and adjustment and optimization are needed.
[0081] In step S340, after obtaining the first true category label cost value, the second probabilistic label cost value, and the second transition component cost value, the computer system combines these values to optimize the network parameters of the transition scene anomaly detection network. Network parameters include important parameters such as weights and biases in the neural network. During the optimization process, a gradient-based optimization algorithm, such as the Adam (Adaptive Moment Estimation) optimization algorithm, can be used. The Adam algorithm comprehensively considers the first-order moment estimation (mean) and second-order moment estimation (variance) of the gradient to adjust the network parameters.
[0082] Assume that the parameters of the transition scene anomaly detection network are ( is a vector containing all weights and biases), define the loss function L as the combination of the above three cost values (for example, it can be a simple addition: ,in is the loss function part corresponding to the first true category label value, is the loss function part corresponding to the second probabilistic labeling cost value, is the part of the loss function corresponding to the cost value of the second transition component).
[0083] The Adam algorithm calculates the parameter variable according to the loss function L Gradient To update the parameters. The specific update process is as follows: First, calculate the first-order moment estimate of the gradient (in is the first-order moment estimate at step t, is a hyperparameter, usually close to 1. is the first-order moment estimate of the previous step); then calculate the second-order moment estimate of the gradient (where v_t is the second-order moment estimate at step t, is a hyperparameter, usually close to 1. is the second-order moment estimate of the previous step). Finally, update the parameter variable The formula is (in is the learning rate, which determines the step size of each update. is a small positive number to prevent the denominator from being zero).
[0084] Through multiple iterations of this update process, the parameters of the transition scene anomaly detection network are continuously adjusted, so that the first true category label cost, the second probabilistic label cost, and the second transition component cost gradually decrease. In this way, the transition scene anomaly detection network is continuously optimized, and the target scene anomaly detection network is finally obtained. When processing labeled water scene images, this target scene anomaly detection network has better performance in terms of matching with the true category label and consistency with the control neural network (including probabilistic label and transition component execution results), thereby improving the accuracy and reliability of traffic water scene anomaly detection.
[0085] To sum up, steps S310-S340 optimize the transition scene anomaly detection network by comprehensively considering multiple error factors and using advanced optimization algorithms, and gradually build a more accurate and efficient target scene anomaly detection network. In the whole process, each step is closely linked, measuring the performance of the network from different angles and performing targeted optimization to achieve the ultimate optimization goal.
[0086] As an implementation method, the execution result of the network includes a probabilistic label and one or more transition component execution results; the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained according to the corresponding neural network. Based on this, in step S201, based on the error between the execution result of the basic scene anomaly detection network and the corresponding real category label, and the error between the execution result of the control neural network and the execution result of the basic scene anomaly detection network, the network parameter of the basic scene anomaly detection network is optimized to obtain the scene anomaly detection network to be trained, which may include:
[0087] Step S2011: generating a second true category label cost value according to the error between the probabilistic label obtained by executing the basic scene anomaly detection network and the corresponding true category label;
[0088] Step S2012: generating a third probabilistic label cost value according to the error between the probabilistic label output by the control neural network and the corresponding probabilistic label obtained by executing the basic scene anomaly detection network;
[0089] Step S2013: generating a third transition component cost value according to the error between the transition component execution result output by the control neural network and the corresponding transition component execution result obtained by executing the basic scenario anomaly detection network;
[0090] Step S2014: Optimize network parameters of the basic scene anomaly detection network according to the second true category label cost value, the third probabilistic label cost value and the third transition component cost value to obtain a simulated training scene anomaly detection network.
[0091] In steps S2011-S2014, the computer system optimizes the network parameters of the basic scene anomaly detection network based on specific calculation logic and comprehensive different error factors, thereby obtaining a simulated training scene anomaly detection network.
[0092] In step S2011, the probabilistic label is the inference probability of the basic scene anomaly detection network for the image scene classification of the water scene image template, and the true category label is a predetermined image scene classification identifier. For example, there is an image in the labeled water scene image template library, and its true category label is "ship docking scene". When this image is loaded into the basic scene anomaly detection network, the network may output that the probability of the image belonging to the "ship docking scene" is 0.4, the probability of belonging to the "normal navigation scene" is 0.3, and the probability of belonging to "other scenes" (such as port facility scenes, etc.) is 0.3.
[0093] In order to measure the difference between the inference results of the basic scene anomaly detection network and the actual situation, the computer system needs to calculate the error between the two. Here, the mean square error (MSE) can be used as the calculation method. Assume that for a certain image, the probability distribution of the output of the basic scene anomaly detection network is (n is the number of scene classification categories), the corresponding real category label is represented as a one-hot encoding vector (For example, if it is the kth type of scene, then =1, others ). Then the mean square error formula is The calculated mean square error value is the cost value of the second true category label. This cost value reflects the degree of deviation from the true category label when the basic scene anomaly detection network classifies the image. If this value is large, it means that there is a large difference between the network's reasoning results and the actual situation, indicating that the network's accuracy in classifying image scenes needs to be improved under the current parameter setting.
[0094] In step S2012, when the images in the labeled water scene image template library are loaded into the control neural network and the basic scene anomaly detection network respectively, both networks will output probabilistic labels for image scene classification. For example, for an image with a real category labeled as "channel congestion scene", the control neural network may output that the image belongs to the "channel congestion scene" with a probability of 0.7, the probability of belonging to the "normal channel scene" is 0.2, and the probability of belonging to the "other scene" is 0.1; while the basic scene anomaly detection network may output that the image belongs to the "channel congestion scene" with a probability of 0.5, the probability of belonging to the "normal channel scene" is 0.3, and the probability of belonging to the "other scene" is 0.2.
[0095] The computer system generates a third probabilistic label cost value by calculating the error between the two probabilistic labels. Here, the cross-entropy loss function can be used to calculate this error. Assume that the probability distribution of the control neural network output is , the probability distribution of the output of the basic scenario anomaly detection network is , the cross entropy formula is The value of this cross entropy is the third probabilistic labeling cost. This value quantifies the degree of difference between the control neural network and the basic scenario anomaly detection network in terms of probabilistic labeling. It enables the computer system to understand the performance of the basic scenario anomaly detection network in inference probability relative to the control neural network, thereby providing a basis for subsequent network parameter optimization.
[0096] In step S2013, the transition component execution result is the output result of the intermediate processing process inside the neural network. For example, in the neural network structure, there may be multiple hidden layers, and the outputs of these hidden layers can be regarded as the transition component execution results. Assume that the output result of a hidden layer (transition component) of the reference neural network for a certain image is a vector (m is the number of neurons in the hidden layer). The output of the corresponding hidden layer (transition component) of the basic scene anomaly detection network for the same image is the vector .
[0097] The computer system calculates the error between the two vectors to generate the cost value of the third transition component. The Euclidean distance formula can be used for calculation, that is, . This distance value d is the cost value of the third transition component. This value reflects the degree of difference in the execution results of the transition component during the internal intermediate processing of the two networks. A larger cost value of the third transition component indicates that there is a large difference between the basic scenario anomaly detection network and the control neural network in the processing of the internal structure of the network, which may affect the final classification effect of the network and needs to be considered in the process of optimizing the network parameters.
[0098] In step S2014, after obtaining the second true category label cost value, the third probabilistic label cost value and the third transition component cost value, the computer system combines these values to optimize the network parameters of the basic scene anomaly detection network. The network parameters include important parameters such as weights and biases in the neural network.
[0099] In the optimization process, a gradient-based optimization algorithm can be used, such as the Stochastic Gradient Descent (SGD) algorithm or its variants. Assume that the parameters of the basic scenario anomaly detection network are ( is a vector containing all weights and biases), define the loss function L as the combination of the above three cost values (for example, it can be a simple addition: ,in is the part of the loss function corresponding to the second true category label value, is the loss function part corresponding to the third probabilistic labeling cost value, is the part of the loss function corresponding to the cost value of the third transition component).
[0100] Taking the stochastic gradient descent algorithm as an example, SGD adjusts the parameter variables according to the loss function L. Gradient To update the parameter variables, the update formula is , where \alpha is the learning rate, which determines the step size of each parameter update. Through multiple iterations of this update process, the parameters of the basic scene anomaly detection network are continuously adjusted, so that the second true category label cost value, the third probabilistic label cost value, and the third transition component cost value gradually decrease.
[0101] In this way, the basic scene anomaly detection network is continuously optimized, and finally the pseudo-training scene anomaly detection network is obtained. This pseudo-training scene anomaly detection network has better performance in processing labeled water scene images, both in terms of the degree of matching with the real category labels and in terms of consistency with the control neural network (including probabilistic labels and transition component execution results). This provides a more suitable basic network structure for subsequent further network optimization or anomaly detection tasks, which helps to improve the accuracy and reliability of the entire traffic water scene anomaly detection system.
[0102] In summary, steps S2011-S2014 comprehensively consider the errors between the basic scene anomaly detection network and the control neural network and the true category labels in different aspects, optimize the basic scene anomaly detection network using appropriate optimization algorithms, and gradually construct a simulated training scene anomaly detection network that better meets the requirements.
[0103] As an implementation mode, when there are multiple basic scene anomaly detection networks with different component architectures or parameters, in step S201, according to the error between the execution result of the basic scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scene anomaly detection network, the network parameter of the basic scene anomaly detection network is optimized to obtain the proposed training scene anomaly detection network, including:
[0104] Step S201A: for each basic scenario anomaly detection network, according to the error between the execution result of the basic scenario anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scenario anomaly detection network, the network parameter variables of the basic scenario anomaly detection network are optimized to obtain the corresponding three-level preliminary optimization results;
[0105] Step S201B: Based on a preset performance metric, one or more of the multiple three-level preliminary optimization results are determined as the proposed training scenario anomaly detection network.
[0106] In steps S201A-S201B, the computer system performs specific processing operations on multiple basic scenario anomaly detection networks with different component architectures or parameter variables to determine a final proposed training scenario anomaly detection network.
[0107] In step S201A, when there are multiple basic scene anomaly detection networks, each network has its own unique composition architecture or parameter setting. Three basic scene anomaly detection networks (respectively denoted as network A, network B, and network C) are used as examples for illustration.
[0108] First, consider the relationship between the basic scene anomaly detection network and the true category label. For the images in the labeled water scene image template library, each image has a pre-set true category label. For example, the true category label of an image is "ship encounters obstacles during navigation."
[0109] When this image is loaded into network A, network A will process the image according to its own architecture and parameters, and output a result about scene classification, which is presented in the form of probabilistic labels. Assume that network A outputs that the probability of the image belonging to the "ship encountering obstacles during navigation" is 0.3, the probability of belonging to the "normal ship navigation scene" is 0.5, and the probability of belonging to "other scenes" is 0.2. In order to measure the error between the execution result of network A and the true category label, the cross-entropy loss function can be used. Assume that the true category label is represented by a one-hot encoded vector (If it is a "ship encounters obstacles during navigation", the corresponding =1, others =0, ), the probability distribution of the output of network A is , then the cross entropy formula is , this value reflects the degree of deviation between network A and the actual situation when classifying the image.
[0110] At the same time, the control neural network will also process this image and output the result. Assume that the control neural network outputs that the probability of the image belonging to the "ship encountering obstacles during navigation" is 0.6, the probability of belonging to the "normal ship navigation scene" is 0.3, and the probability of belonging to the "other scenes" is 0.1. The computer system calculates the error between the result of the control neural network and the result of network A. For example, the cross entropy loss function can also be used to measure this error.
[0111] In addition to the error in probabilistic labeling, the error between the execution results of the transition component needs to be considered. Assume that both network A and the control neural network have a hidden layer (transition component). For the above image, the output vector of the hidden layer of network A is , the hidden layer output vector of the neural network is , you can use the Euclidean distance formula to calculate the error between these two vectors.
[0112] The computer system combines the above errors with the true category label and the errors with the control neural network results, and uses a gradient-based optimization algorithm, such as the Stochastic Gradient Descent (SGD) algorithm, to optimize the parameters of network A. The SGD algorithm updates the parameters according to the gradient of the loss function to the parameters. Assume that the parameters of network A are The loss function L takes into account the above errors (for example, the simple addition form , then the update formula is ,in is the learning rate. Through multiple iterations of this process, the three-level preliminary optimization results of network A are obtained.
[0113] The same process applies to network B and network C. Network B and network C will also process images according to their own initial architecture and parameters. The computer system calculates the errors between them and the true category labels and the control neural network results, and then uses a similar optimization algorithm to optimize the parameters to obtain their respective three-level preliminary optimization results.
[0114] In step S201B, the preset performance metric may be an index such as accuracy, recall, F1 value, etc. The accuracy is taken as an example for description.
[0115] Assume that after step S201A, the three-level preliminary optimization results of network A, network B and network C are obtained. The computer system performs performance evaluation on these optimized networks. For network A, when a set of test images in the library of labeled water scene image templates is used for testing, it is assumed that the number of correctly classified images is , the total number of test images is N, then the accuracy of network A .
[0116] Similarly, the computer system calculates the accuracy of network B And the accuracy of network C If the preset performance metric is to select the network with the highest accuracy as the anomaly detection network for the proposed training scenario, then the computer system will be more , and .
[0117] Assumptions =0.7, =0.65, =0.72, then the computer system will select network C as the anomaly detection network for the proposed training scenario. If the preset performance metric allows the selection of multiple networks (for example, all networks with accuracy greater than a certain threshold are selected), assuming the threshold is 0.6, then network A, network B, and network C may all be selected as the anomaly detection network for the proposed training scenario.
[0118] This selection method based on preset performance metrics ensures that the final determined training scene anomaly detection network meets certain requirements in performance, and provides a good foundation for subsequent network optimization steps (such as further optimization in step S200). In this way, the computer system can select the most suitable network or network set from multiple basic scene anomaly detection networks to improve the performance and accuracy of the entire traffic water scene anomaly detection system.
[0119] In summary, steps S201A-S201B perform detailed optimization and evaluation on multiple different basic scene anomaly detection networks, optimize according to the error between the true category label and the control neural network result, and then screen according to the preset performance metric to determine the scene anomaly detection network to be trained.
[0120] As an implementation mode, when there are multiple basic scenario anomaly detection networks with different component architectures or parameters, step S202, according to the execution result of the basic scenario anomaly detection network, optimizes the network parameters of the basic scenario anomaly detection network to obtain the proposed training scenario anomaly detection network, which may include:
[0121] Step S2021: for each basic scenario anomaly detection network, according to the execution result of the basic scenario anomaly detection network, the network parameter variables of the basic scenario anomaly detection network are optimized to obtain the corresponding pre-optimization result;
[0122] Step S2022: Based on a preset performance metric, determine one or more of the plurality of pre-optimization results as a proposed training scenario anomaly detection network.
[0123] In steps S2021-S2022, the computer system optimizes the network parameters of multiple basic scenario anomaly detection networks with different component architectures or parameters according to the execution results of the basic scenario anomaly detection networks, and then determines the proposed training scenario anomaly detection network.
[0124] In step S2021, it is assumed that there are multiple basic scenario anomaly detection networks, namely network A, network B and network C, each of which has a different composition architecture or parameter setting.
[0125] For the execution results of the basic scene anomaly detection network, take network A as an example. When the computer system inputs the image in the library of unlabeled water scene image templates into network A, network A will process the image according to its own structure and parameters. For example, network A contains structures such as convolution layer, pooling layer and fully connected layer. The convolution layer extracts image features by sliding the convolution kernel on the image. Assuming that the convolution kernel is K and a local area of the image is I (which can be regarded as a small matrix), the result O (also a matrix) after the convolution operation is calculated as , where i and j represent the position index in the matrix.
[0126] When network A processes the image, it will output some kind of result about the image. This result may be a representation of the image features, or a preliminary judgment on the classification of the image scene (although there is no exact category standard for unlabeled images, the network can make certain judgments based on the learned feature patterns).
[0127] The computer system optimizes the parameters of network A based on the execution result. In the optimization process, a gradient-based optimization algorithm, such as the adaptive moment estimation (Adam) optimization algorithm, can be used. The parameters of network A include weight w and bias b.
[0128] Assume that in a certain layer of network A, the input is x and the output is y, and the relationship is y=f(wx+b), where f is the activation function (for example, the ReLU function f(x)=max(0,x)). The Adam algorithm updates the parameter variables based on the gradient of the loss function with respect to the parameter variables. First, the gradient is calculated. (in is the first-order moment estimate at step t, is a hyperparameter close to 1, is the first-order moment estimate from the previous step, is the loss function L with respect to the parameter (here contains the gradient of w and b)); then calculate the second-order moment estimate of the gradient (in is the second-order moment estimate at step t, is a hyperparameter close to 1, is the second-order moment estimate of the previous step); the final formula for updating the parameter variable is and (in is the learning rate, is a small positive number to prevent the denominator from being zero).
[0129] Through multiple iterations of this process, the parameters of network A are constantly adjusted, and the performance is gradually improved, obtaining the pre-optimization results of network A. The same process is also applicable to network B and network C. Network B and network C process the unlabeled image according to their own structure and initial parameters. The computer system optimizes the parameters of network B and network C in a similar manner based on their respective execution results using the Adam optimization algorithm (or other appropriate optimization algorithms) to obtain their pre-optimization results.
[0130] In step S2022, the preset performance metric may be a variety of indicators, such as accuracy, recall, or mean square error (MSE), etc. Here, the accuracy is taken as an example for description.
[0131] After obtaining the pre-optimization results of Network A, Network B, and Network C, the computer system needs to evaluate the performance of these optimized networks. Assume that there is a test set, which is also composed of some images in the library of unlabeled water scene image templates (in order to evaluate the generalization ability of the network after optimization on unlabeled data).
[0132] For the pre-optimization results of network A, the computer system inputs the images in the test set into network A, and network A classifies and predicts these images (although they are unlabeled images, they can be classified and predicted based on the features learned by the network). Assuming that there are N images in the test set, the number of images correctly classified by network A is , then the accuracy of network A .
[0133] Similarly, the computer system calculates the accuracy of network B And the accuracy of network C For example, if =0.7, =0.65, =0.72.
[0134] If the preset performance metric is to select the network with the highest accuracy as the anomaly detection network for the intended training scenario, the computer system will select network C. However, if the preset performance metric allows the selection of multiple networks (for example, all networks with an accuracy greater than a certain threshold are selected), assuming the threshold is 0.6, then network A, network B, and network C may all be selected as the anomaly detection network for the intended training scenario.
[0135] This selection method based on the preset performance metric ensures that the final determined scene anomaly detection network to be trained has good performance when processing unlabeled water scene images. In this way, the computer system selects the most suitable network or network set from multiple basic scene anomaly detection networks, providing a relatively good performance foundation for subsequent further network optimization (such as continued optimization in step S200), which helps to improve the accuracy and reliability of the entire traffic water scene anomaly detection system.
[0136] In summary, steps S2021-S2022 optimize the parameters of multiple basic scene anomaly detection networks according to their execution results on unlabeled water scene images, and screen them based on preset performance metrics to determine the scene anomaly detection network to be trained. This process takes into account the diversity of different network structures and parameters, as well as the performance of the network on unlabeled data.
[0137] As an implementation mode, when there are multiple pseudo-training scene anomaly detection networks with different component architectures or parameters, in step S200, according to the error between the execution result of the control neural network and the execution result of the pseudo-training scene anomaly detection network, the network parameter of the pseudo-training scene anomaly detection network is optimized to obtain the transition scene anomaly detection network, which may include:
[0138] Step S200A: for each of the anomaly detection networks for the proposed training scenarios, according to the error between the execution result of the control neural network and the execution result of the anomaly detection network for the proposed training scenarios, the network parameters of the anomaly detection network for the proposed training scenarios are optimized to obtain the corresponding secondary preliminary optimization results;
[0139] Step S200B: Based on a preset performance metric, determine one or more of the multiple secondary preliminary optimization results as transition scenario anomaly detection networks.
[0140] In steps S200A-S200B, the computer system optimizes and screens multiple pseudo-training scenario anomaly detection networks based on the errors between the execution results of the control neural network and the pseudo-training scenario anomaly detection network to obtain a transition scenario anomaly detection network.
[0141] In step S200A, it is assumed that there are multiple pseudo-training scene anomaly detection networks, namely network A, network B and network C. These pseudo-training scene anomaly detection networks may be preliminarily obtained through the previous steps (such as step S201 or S202), and each has a different initial structure or parameter setting.
[0142] When the computer system loads images from the library of unlabeled water scene image templates into the control neural network and these to-be-trained scene anomaly detection networks, each network processes the images and produces execution results.
[0143] Take network A as an example. When processing an image, the internal neurons of network A will extract and analyze the features of the input image according to their connection weights and activation functions. For example, a certain layer of neurons in network A receives an input vector x (this vector may be the image feature representation after being processed by the previous layer), and then passes through a linear combination of the weight matrix W and the bias vector b, and then through an activation function f (such as a Sigmoid function). ) to obtain the output vector y, that is, y=f(Wx+b).
[0144] The control neural network also processes the image and outputs the result. There is an error between the execution results of the control neural network and network A. This error includes multiple aspects, such as errors in probabilistic labeling and errors in the execution results of transition components.
[0145] For the error in probabilistic labeling, assume that the probability that the control neural network outputs an unlabeled image as belonging to a certain scene (such as "ship sailing scene") is , and the corresponding probability output by network A is . Computer systems can use the cross-entropy loss function to measure this error. Assume and It is about the probability under the same classification scenario. The cross entropy formula is .
[0146] For the error in the execution results of the transition component, assume that both the control neural network and network A have a specific hidden layer (transition component), and the hidden layer output vector of the control neural network is , the hidden layer output vector of network A is Computer systems can use the Euclidean distance formula to calculate the error between these two vectors.
[0147] The computer system combines these errors and uses a gradient-based optimization algorithm to optimize the parameters of network A. For example, the Stochastic Gradient Descent (SGD) algorithm is used. Assume that the parameters of network A are (including weights W and bias b, etc.), define the loss function L to comprehensively consider the errors in the probabilistic labeling and transition component execution results (for example, simple addition form , SGD adjusts the parameter according to the loss function L Gradient To update the parameter variables, the update formula is ,in\ is the learning rate. Through multiple iterations of this process, the parameters of network A are continuously adjusted to obtain the secondary preliminary optimization results of network A.
[0148] The same process also applies to network B and network C. Network B and network C process the image according to their own structure and initial parameters, and the computer system calculates the errors between them and the control neural network in terms of probabilistic labeling and transition component execution results, and then uses a similar optimization algorithm to optimize the parameters of network B and network C to obtain their respective secondary preliminary optimization results.
[0149] In step S200B, the preset performance metric may be a variety of indicators, such as accuracy, recall, F1 value or mean square error (MSE), etc. Here, the accuracy is taken as an example for description.
[0150] After obtaining the secondary preliminary optimization results of network A, network B and network C, the computer system needs to evaluate the performance of these optimized networks. Assume that there is a test set, which consists of some images in the library of unlabeled water scene image templates.
[0151] For the secondary preliminary optimization results of network A, the computer system inputs the images in the test set into network A, and network A classifies and predicts these images (although they are unlabeled images, the network can classify and predict them based on the learned features). Assuming that there are N images in the test set, and the number of images correctly classified by network A is n_A, then the accuracy of network A is .
[0152] Similarly, the computer system calculates the accuracy P_B of network B and the accuracy P_C of network C. For example, if =0.75, =0.7, =0.72.
[0153] If the preset performance metric is to select the network with the highest accuracy as the transition scene anomaly detection network, the computer system will select network A. However, if the preset performance metric allows multiple networks to be selected (for example, all networks with accuracy greater than a certain threshold are selected), assuming the threshold is 0.7, then both network A and network C may be selected as the transition scene anomaly detection network.
[0154] This selection method based on the preset performance metric ensures that the final transition scene anomaly detection network has good performance when processing unlabeled water scene images. In this way, the computer system selects the most suitable network or network set from multiple training scene anomaly detection networks, providing a relatively good performance foundation for subsequent further network optimization (such as continuing optimization in step S300), which helps to improve the accuracy and reliability of the entire traffic water scene anomaly detection system.
[0155] In summary, steps S200A-S200B optimize parameters of multiple proposed training scene anomaly detection networks according to the errors between their execution results and those of the control neural network, and screen them based on preset performance metrics to determine the transition scene anomaly detection network. This process takes into account the diversity of different proposed training networks and their performance on unlabeled data.
[0156] As an implementation mode, step S200, loading the unlabeled water scene image template library into the debugged control neural network and the to-be-trained scene anomaly detection network, respectively, may include:
[0157] Step S2001: Loading M water scene image templates in the unlabeled water scene image template library into the debugged control neural network and the to-be-trained scene anomaly detection network respectively; M≥1;
[0158] Step S300, loading the library of marked water scene image templates into the control neural network and the transition scene anomaly detection network respectively, may include:
[0159] Step S3001: N water scene image templates in the labeled water scene image template library are loaded into the control neural network and the pre-transition scene anomaly detection network respectively; N≥1, M>N;
[0160] In the traffic water scene anomaly detection method, step S2001 and step S3001 play an important role in the specific implementation process of step S200 and step S300 respectively, and they mainly involve the operation of loading the images in the image template library into the corresponding neural network for processing.
[0161] In step S2001, the computer system executes the operation of loading some images (M) in the unlabeled water scene image template library into the control neural network and the simulated training scene anomaly detection network.
[0162] First, the images in the unlabeled water scene image template library are not labeled with real categories. These images contain visual information of various traffic water scenes, such as the position, shape, sailing direction of ships, water flow conditions in the water, layout of port facilities, etc. Take one of the images as an example, this image may show a busy port water area, with multiple ships docked at the dock, and some ships entering and leaving the port channel, with some waves and possible floating objects on the water.
[0163] The control neural network is a debugged network with pre-set structure and parameters. After previous training or debugging, this network can process the input image and output the corresponding results. The simulated training scene anomaly detection network is a network that is being constructed and optimized. Its initial structure and parameters may be based on some common neural network architecture settings, but further optimization is required to adapt to the task of traffic water scene anomaly detection.
[0164] When the computer system loads M water scene image templates into the two networks, the images themselves may need to be preprocessed to adapt to the input requirements of the neural network. For example, the image size is adjusted to the size required by the network input layer. Assuming that the input layer of the control neural network and the input layer of the scene anomaly detection network to be trained requires the input image size to be 224×224 pixels (this is a common size requirement, such as in many image recognition tasks based on convolutional neural networks), if the size of the original image is different, a scaling operation is required.
[0165] In the process of loading images into neural networks, we take the convolutional neural network (CNN) as an example. In CNN, the pixel values of the image are regarded as the input data of the network. For the control neural network, when an image is loaded, it first enters the input layer, and then the data propagates layer by layer in the network. For example, in the convolution layer, the convolution kernel (which can be regarded as a small filter matrix) slides on the image to perform a convolution operation to extract the local features of the image. Assuming the convolution kernel size is 3×3, for a certain position (i, j) in the image, the calculation method of the convolution operation can be expressed as , where x is the pixel value matrix of the input image at that position, w is the weight matrix of the convolution kernel, b is the bias term, and y is the output value after convolution.
[0166] The pseudo-training scene anomaly detection network also performs a similar processing process on the M images loaded. Since it is in a pseudo-training state, during this process, the network will perform operations such as feature extraction and analysis on the image according to its own initial parameters, and output the corresponding results. This result may be different from the result of the control neural network, and this difference will be used in subsequent steps (such as steps S210-S230) to optimize the parameters of the pseudo-training scene anomaly detection network.
[0167] By loading M unlabeled water scene image templates into the two networks respectively, the computer system provides a data basis for subsequent network optimization operations, so that the network can be adjusted according to the relationship between the processing results of these images, thereby gradually improving the performance of the proposed training scene anomaly detection network in processing traffic water scene images.
[0168] In step S3001, the task of the computer system is to load N images in the labeled water scene image template library into the control neural network and the transition scene anomaly detection network.
[0169] The images in the labeled water scene image template library are labeled with real category labels, which clearly indicate the scene classification of the image. For example, one of the images may be labeled as "ship collision accident scene", which means that the scene shown in this image is a collision between ships, including the damage of the ships, the relative position at the time of collision, the fluctuation of the surrounding waters and other visual information related to this label.
[0170] The control neural network is still the previously debugged network, which plays a role again in this step to process the input labeled image. The transition scene anomaly detection network is an intermediate network obtained through the previous steps (such as the relevant operations in step S200), which has a certain ability to process traffic water scene images, but it still needs further optimization.
[0171] When loading these N images, the images also need to be processed to adapt to the input requirements of the neural network. For example, in addition to possible resizing, the color mode of the image may also need to be converted. If the neural network requires the input image to be in grayscale mode, and the original image is in color mode (such as RGB mode), the color image needs to be converted to a grayscale image. The conversion formula can be Y=0.299R+0.587G+0.114B, where R, G, and B are the pixel values of the red, green, and blue channels of the color image, respectively, and Y is the converted grayscale value.
[0172] When an image is loaded into the control neural network, the network will extract and analyze the features of the image according to its own structure and parameters, and output the results related to the scene classification. Taking a simple scene classification as an example, assuming that the control neural network processes an image marked as "normal sailing scene", it may output a probability vector at the last layer of the network, indicating the probability that this image belongs to each predefined scene classification. For example, the output result may be that the probability of belonging to "normal sailing scene" is 0.8, the probability of belonging to "ship docking scene" is 0.1, and the probability of belonging to "other scenes" is 0.1.
[0173] The transition scene anomaly detection network also processes the same N images and outputs the results. Since the structure and parameters of the transition scene anomaly detection network are different from those of the control neural network, its output results may be different. For example, for the above-mentioned "normal sailing scene" image, the transition scene anomaly detection network may output a probability of 0.7 for "normal sailing scene", a probability of 0.2 for "ship docking scene", and a probability of 0.1 for "other scenes".
[0174] Here, M>N is a reasonable setting. M unlabeled images are mainly used for preliminary network optimization (such as in step S200). Due to the large number of unlabeled images, the network can learn a wider range of image feature patterns and improve the generalization ability of the network. The N labeled images are used for more refined optimization (in step S300). The relatively small number may be due to the high acquisition cost of labeled images or the fact that too many images are not needed at this stage to achieve the optimization purpose. By loading these N labeled images into the control neural network and the transition scene anomaly detection network respectively, the computer system can further optimize the parameters of the transition scene anomaly detection network based on the relationship between the execution results of the two networks and the relationship between the results of the transition scene anomaly detection network and the true category label (such as in steps S310-S340), thereby improving its accuracy in the traffic water scene anomaly detection task.
[0175] In summary, step S2001 and step S3001 provide data input for subsequent network optimization operations by loading a specific number of unlabeled and labeled water scene image templates into the corresponding neural network, and play a key role in the construction and optimization of the entire traffic water scene anomaly detection network. The operations in these steps involve many aspects such as image preprocessing, image processing by the neural network, and comparison of results between different networks.
[0176] As an implementation manner, step S400, loading the water scene image to be detected by anomaly into the target scene anomaly detection network, and obtaining the anomaly detection result corresponding to the water scene image to be detected by anomaly detection executed by the target scene anomaly detection network, may include:
[0177] Step S410: loading the water scene image to be detected for anomaly into the target scene anomaly detection network;
[0178] Step S420: extracting representation information of the water scene image to be detected based on the target scene anomaly detection network to obtain an image representation vector of the water scene image to be detected;
[0179] Step S430: inferring the type of the water scene image to be detected for anomaly based on the image representation vector to obtain a corresponding inference result;
[0180] Step S440: Determine the anomaly detection result corresponding to the water scene image to be detected based on the inference result.
[0181] In step S400 of the traffic water scene anomaly detection method, steps S410-S440 are the key operation flow of the computer system processing the water scene image to be detected for anomaly to obtain anomaly detection results.
[0182] In step S410, the water scene images to be detected for anomalies are images that the computer system needs to detect anomalies, and these images contain various elements in the traffic water scene, such as ships, waterways, port facilities, and water surface conditions. The target scene anomaly detection network is a network carefully optimized through a series of previous steps (such as steps S100-S300), and it has the ability to accurately detect anomalies in traffic water scene images.
[0183] When the computer system performs this step, it first needs to preprocess the water scene image to be detected for anomaly so that it meets the input requirements of the target scene anomaly detection network. For example, if the input layer of the target scene anomaly detection network requires a specific image size (assuming 224×224 pixels), and the image size of the anomaly detection is different, an image scaling operation is required. In addition, the color mode of the image may also need to be adjusted. If the network requires the input image to be in grayscale mode, and the original image is in color mode (such as RGB mode), the color image can be converted to a grayscale image using the formula Y=0.299R+0.587G+0.114B, where R, G, and B are the pixel values of the red, green, and blue channels of the color image, respectively, and Y is the converted grayscale value.
[0184] After completing the preprocessing, the computer system loads the water scene image to be detected as anomaly into the input layer of the target scene anomaly detection network. Taking the convolutional neural network (CNN) as an example, the input layer neurons of the target scene anomaly detection network receive the pixel values of the image as input data. For a multi-channel image (such as RGB channels), the pixel values of each channel will be input into the corresponding input layer neurons.
[0185] In step S420, after the water scene image to be detected is loaded into the target scene anomaly detection network, the network starts to process the image to extract representation information. The target scene anomaly detection network contains multiple hidden layers, which extract and transform the image features through different operations to obtain the representation information of the image.
[0186] For example, in the convolutional neural network (CNN) structure, the convolution layer of the network plays a key role in feature extraction. Assume that there are multiple convolution kernels (for example, 3×3 convolution kernels) in the convolution layer of the target scene anomaly detection network. For a local area in the image (assuming a 3×3 pixel area), the convolution kernel performs a convolution operation with the pixel values of the area. Taking a simple single-channel image as an example, let the pixel value matrix of the image at a certain position (i, j) be x, the weight matrix of the convolution kernel be w, and the bias term be b. The result of the convolution operation is By sliding multiple convolution kernels on the image to perform convolution operations, the network can extract different local features of the image.
[0187] As the image propagates layer by layer in the network, after operations such as convolutional layers and pooling layers (such as the maximum pooling layer, which selects the maximum value in a certain area as the output, plays a role in downsampling and reducing the amount of data), the features of the image are constantly abstracted and transformed. Finally, in a hidden layer of the network (such as the last hidden layer before the fully connected layer), the network will output an image representation vector. This vector is an abstract representation of the image features of the water scene to be detected for anomalies. It contains a comprehensive representation of various feature information related to the traffic water scene in the image, such as the shape features of the ship, the location features of the channel, and the water surface fluctuation features.
[0188] In step S430, after obtaining the image representation vector of the water scene image to be detected, the target scene anomaly detection network uses this vector to infer the type of the image. This inference process is based on the patterns and knowledge learned by the network during the training process.
[0189] For example, suppose the target scene anomaly detection network is a multi-classification network used to distinguish different types of traffic water scenes, such as "normal navigation scene", "ship docking scene", "ship collision scene", "port operation scene", etc. During the training process, the network has learned the representation vector patterns of different types of scene images.
[0190] After obtaining the image representation vector of the quasi-anomaly detection image, the network will calculate the similarity between this vector and the various scene representation vector patterns it has learned during training. This similarity can be calculated using a variety of methods, such as cosine similarity. Suppose the image representation vector of the quasi-anomaly detection image is , the representation vector of a certain type of scene (such as “normal navigation scene”) learned by the network is , then the cosine similarity formula is ,in is the dot product of the vectors, and They are vectors Model.
[0191] By calculating the similarity between the image representation vector of the quasi-anomaly detection image and the representation vector patterns of various scenes, the network can determine the scene type that the quasi-anomaly detection image is most likely to belong to. For example, if the calculated cosine similarity with the representation vector of "normal navigation scene" is the highest, then the network will infer the quasi-anomaly detection image as the "normal navigation scene" type, which is the corresponding inference result.
[0192] In step S440, after obtaining the inference result, the computer system determines the anomaly detection result corresponding to the water scene image to be detected based on the inference result.
[0193] If the inference result is a normal traffic water scene type (such as "normal navigation scene" or "normal port operation scene", etc.), the computer system determines that the water scene image to be detected is normal, that is, no abnormality occurs. For example, in the image of the "normal navigation scene", the ship sails according to the normal channel rules, the water surface is normal, and the port facilities operate normally, which all meet the normal navigation mode.
[0194] However, if the inference result is an abnormal traffic water scene type (such as "ship collision scene" or "channel blocking scene", etc.), or the similarity between the inference result and the normal scene type is lower than a preset threshold (this threshold is determined during the network training or optimization process and is used to distinguish between normal and abnormal situations), then the computer system determines that the water scene image to be detected is an abnormal situation. For example, in the image of the "ship collision scene", there will be situations that are obviously different from normal navigation scenes, such as collisions between ships, damage to ships, and abnormal fluctuations on the water surface.
[0195] In this way, the computer system completes the anomaly detection task for the water scene image to be detected, and accurately determines whether there are any abnormalities in the image based on the processing results of the target scene anomaly detection network, thereby achieving effective monitoring and anomaly detection of traffic water scenes.
[0196] In summary, steps S410-S440 constitute a complete traffic water scene anomaly detection process by loading the water scene image to be detected into the target scene anomaly detection network, extracting the image representation vector, performing type reasoning, and finally determining the anomaly detection result.
[0197] Based on Figure 1 Based on the same principle as the method shown in , the present application also provides an abnormality detection device 10 for a traffic water scene, such as Figure 2 As shown, the device 10 comprises:
[0198] The template library acquisition module 11 is used to acquire a water scene image template library for scene anomaly detection, wherein the water scene image template library includes an unlabeled water scene image template library without adding a true category mark and a labeled water scene image template library with adding a true category mark, wherein the true category mark represents the image scene classification of the water scene image template;
[0199] The network transition training module 12 is used to load the unlabeled water scene image template library into the debugged control neural network and the simulated training scene anomaly detection network respectively, and optimize the network parameters of the simulated training scene anomaly detection network according to the error between the execution result of the control neural network and the execution result of the simulated training scene anomaly detection network to obtain the transition scene anomaly detection network;
[0200] The target network training module 13 is used to load the labeled water scene image template library into the control neural network and the transition scene anomaly detection network respectively, and optimize the network parameters of the transition scene anomaly detection network according to the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, so as to obtain the target scene anomaly detection network;
[0201] The anomaly detection module 14 is used to load the water scene image to be subjected to anomaly detection into the target scene anomaly detection network, and obtain an anomaly detection result corresponding to the water scene image to be subjected to anomaly detection obtained by executing the target scene anomaly detection network.
[0202] The present application embodiment provides a computer system, such as Figure 3 As shown, the computer system 100 includes: a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, such as through a bus 102. Optionally, the computer system 100 may also include a transceiver 104. It should be noted that in actual applications, the transceiver 104 is not limited to one, and the structure of the computer system 100 does not constitute a limitation on the embodiments of the present application.
[0203] An embodiment of the present application provides a computer system. The computer system in the embodiment of the present application includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more programs are executed by the processor, the above method is implemented.
Claims
1. A method for detecting anomalies in a traffic water scene, characterized in that: The method comprises: Acquire a water scene image template library for scene anomaly detection, wherein the water scene image template library includes an unlabeled water scene image template library without adding real category tags and a labeled water scene image template library with adding real category tags, wherein the real category tags represent image scene classifications of the water scene image templates; The unlabeled water scene image template library is loaded into the debugged control neural network and the simulated training scene anomaly detection network respectively, and according to the error between the execution result of the control neural network and the execution result of the simulated training scene anomaly detection network, the network parameter of the simulated training scene anomaly detection network is optimized to obtain a transition scene anomaly detection network; The labeled water scene image template library is loaded into the control neural network and the transition scene anomaly detection network respectively, and the network parameters of the transition scene anomaly detection network are optimized according to the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, so as to obtain the target scene anomaly detection network; The water scene image to be subjected to anomaly detection is loaded into the target scene anomaly detection network to obtain an anomaly detection result corresponding to the water scene image to be subjected to anomaly detection executed by the target scene anomaly detection network.
2. The method according to claim 1, characterized in that Before the unlabeled water scene image template library is loaded into the debugged control neural network and the to-be-trained scene anomaly detection network, the method further includes: The labeled water scene image template library is loaded into the control neural network and the basic scene anomaly detection network respectively, and the network parameters of the basic scene anomaly detection network are optimized according to the error between the execution result of the basic scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scene anomaly detection network to obtain the simulated training scene anomaly detection network.
3. The method according to claim 1, characterized in that Before the unlabeled water scene image template library is loaded into the debugged control neural network and the to-be-trained scene anomaly detection network, the method further includes: The unlabeled water scene image template library is input into a basic scene anomaly detection network, and according to the execution result of the basic scene anomaly detection network, the network parameters of the basic scene anomaly detection network are optimized to obtain the simulated training scene anomaly detection network.
4. The method according to claim 1, characterized in that The execution result of the network includes a probabilistic label and one or more transition component execution results; the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained according to the corresponding neural network; the error between the execution result of the control neural network and the execution result of the pseudo-training scene anomaly detection network is used to optimize the network parameters of the pseudo-training scene anomaly detection network to obtain the transition scene anomaly detection network, including: Generate a first probabilistic label cost value according to an error between the probabilistic label output by the control neural network and the corresponding probabilistic label obtained by executing the pseudo-training scene anomaly detection network; Generate a first transition component cost value according to an error between a transition component execution result output by the control neural network and a corresponding transition component execution result obtained by executing the pseudo-training scenario anomaly detection network; According to the first probabilistic labeling cost value and the first transition component cost value, the network parameters of the simulated training scene anomaly detection network are optimized to obtain the transition scene anomaly detection network.
5. The method according to claim 1, characterized in that The execution result of the network includes a probabilistic label and one or more transition component execution results; the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained according to the corresponding neural network; the error between the execution result of the transition scene anomaly detection network and the corresponding real category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, the network parameter of the transition scene anomaly detection network is optimized to obtain the target scene anomaly detection network, including: Generate a first true category label cost value according to an error between a probabilistic label obtained by executing the transition scene anomaly detection network and a corresponding true category label; Generating a second probabilistic labeling cost value according to an error between the probabilistic labeling output by the control neural network and the corresponding probabilistic labeling obtained by executing the transition scene anomaly detection network; Generate a second transition component cost value according to an error between a transition component execution result output by the control neural network and a corresponding transition component execution result obtained by executing the transition scenario anomaly detection network; According to the first true category label cost value, the second probabilistic label cost value and the second transition component cost value, the network parameters of the transition scene anomaly detection network are optimized to obtain the target scene anomaly detection network.
6. The method according to claim 2, characterized in that The execution result of the network includes a probabilistic label and one or more transition component execution results; the probabilistic label is the inference probability of the image scene classification of the water scene image template obtained according to the corresponding neural network; the error between the execution result of the basic scene anomaly detection network and the corresponding real category label, and the error between the execution result of the control neural network and the execution result of the basic scene anomaly detection network, the network parameter of the basic scene anomaly detection network is optimized to obtain the simulated training scene anomaly detection network, including: Generating a second true category label cost value according to an error between a probabilistic label obtained by executing the basic scene anomaly detection network and a corresponding true category label; Generate a third probabilistic label cost value according to an error between the probabilistic label output by the control neural network and the corresponding probabilistic label obtained by executing the basic scene anomaly detection network; Generate a third transition component cost value according to an error between a transition component execution result output by the control neural network and a corresponding transition component execution result obtained by executing the basic scenario anomaly detection network; According to the second true category label cost value, the third probabilistic label cost value and the third transition component cost value, optimizing the network parameters of the basic scene anomaly detection network to obtain the simulated training scene anomaly detection network; When there are multiple basic scenario anomaly detection networks with different component architectures or parameters, the basic scenario anomaly detection network is optimized based on the error between the execution result of the basic scenario anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scenario anomaly detection network to obtain the proposed training scenario anomaly detection network, including: For each basic scenario anomaly detection network, according to the error between the execution result of the basic scenario anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the basic scenario anomaly detection network, the network parameter variables of the basic scenario anomaly detection network are optimized to obtain the corresponding three-level preliminary optimization results; Based on a preset performance metric, one or more of the plurality of three-level preliminary optimization results are determined as the pseudo-training scenario anomaly detection network.
7. The method according to claim 3, characterized in that When there are multiple basic scenario anomaly detection networks with different component architectures or parameter variables, the basic scenario anomaly detection network is optimized according to the execution result of the basic scenario anomaly detection network to obtain the proposed training scenario anomaly detection network, including: For each basic scenario anomaly detection network, optimizing network parameters of the basic scenario anomaly detection network according to the execution result of the basic scenario anomaly detection network to obtain a corresponding pre-optimization result; Based on a preset performance metric, one or more of the plurality of pre-optimization results are determined as the pseudo-training scenario anomaly detection network.
8. The method according to any one of claims 1 to 7, characterized in that: When there are multiple pseudo-training scene anomaly detection networks with different component architectures or parameters, the pseudo-training scene anomaly detection network is optimized based on the error between the execution result of the control neural network and the execution result of the pseudo-training scene anomaly detection network to obtain a transition scene anomaly detection network, including: For each pseudo-training scene anomaly detection network, according to the error between the execution result of the control neural network and the execution result of the pseudo-training scene anomaly detection network, the network parameter variables of the pseudo-training scene anomaly detection network are optimized to obtain the corresponding secondary preliminary optimization result; Based on a preset performance metric, determining one or more of the plurality of secondary preliminary optimization results as the transition scenario anomaly detection network; The step of loading the unlabeled water scene image template library into the debugged control neural network and the to-be-trained scene anomaly detection network respectively comprises: Loading M water scene image templates in the unlabeled water scene image template library into the debugged control neural network and the simulated training scene anomaly detection network respectively; M≥1; The step of loading the labeled water scene image template library into the control neural network and the transition scene anomaly detection network respectively comprises: Loading N water scene image templates in the labeled water scene image template library into the control neural network and the transition scene anomaly detection network respectively; N≥1, M>N; The step of loading the water scene image to be subjected to anomaly detection into the target scene anomaly detection network and obtaining an anomaly detection result corresponding to the water scene image to be subjected to anomaly detection obtained by executing the target scene anomaly detection network comprises: Loading the water scene image to be detected anomaly into the target scene anomaly detection network; Extracting representation information of the water scene image to be detected as anomaly based on the target scene anomaly detection network to obtain an image representation vector of the water scene image to be detected as anomaly; Inferring the type of the water scene image to be detected as anomaly based on the image representation vector to obtain a corresponding inference result; The anomaly detection result corresponding to the water scene image to be detected is determined based on the inference result.
9. An abnormality detection device for a traffic water scene, characterized in that: The device comprises: A template library acquisition module is used to acquire a water scene image template library for scene anomaly detection, wherein the water scene image template library includes an unlabeled water scene image template library without adding real category tags and a labeled water scene image template library with adding real category tags, wherein the real category tags represent image scene classifications of the water scene image templates; A network transition training module is used to load the unlabeled water scene image template library into the debugged control neural network and the simulated training scene anomaly detection network respectively, and optimize the network parameters of the simulated training scene anomaly detection network according to the error between the execution result of the control neural network and the execution result of the simulated training scene anomaly detection network to obtain a transition scene anomaly detection network; A target network training module is used to load the labeled water scene image template library into the control neural network and the transition scene anomaly detection network respectively, and optimize the network parameters of the transition scene anomaly detection network according to the error between the execution result of the transition scene anomaly detection network and the corresponding true category label, and the error between the execution result of the control neural network and the execution result of the transition scene anomaly detection network, so as to obtain a target scene anomaly detection network; The anomaly detection module is used to load the water scene image to be detected by anomaly into the target scene anomaly detection network, and obtain the anomaly detection result corresponding to the water scene image to be detected by anomaly detection executed by the target scene anomaly detection network.
10. A computer system, characterized in that: include: one or more processors; Memory; one or more computer programs; The one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method according to any one of claims 1 to 8 is implemented.
