Monitoring camera image anomaly detection method and system
By combining quantum state bit vector encoding and physical rule verification, the problems of poor detection robustness and high false alarm rate in existing technologies are solved, and high-precision, low-false-alarm image anomaly detection is achieved.
Patent Information
- Application Number
- CN202510822303.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-10-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing quantum computing-based image anomaly detection methods have poor robustness in the face of dynamic lighting and environmental noise, and lack physical rule verification mechanisms, resulting in a high false alarm rate.
By jointly encoding the pixel matrix and motion vector field of the video stream into a quantum state bit vector, quantum state evolution calculation is performed. Combined with adaptive segmentation and physical rule verification, anomaly alarm signals are generated, and the detection operator is dynamically updated by injecting quantum noise.
It improves the robustness and accuracy of detection, reduces the false alarm rate, and ensures the physical authenticity of the detection results.
Smart Images

Figure CN120808256A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent monitoring, and particularly relates to a monitoring camera image anomaly detection method and system. BACKGROUND
[0002] The intelligent video monitoring system is widely applied in key fields such as security and industry quality inspection, and its core value depends on the real-time and accurate detection ability of abnormal events in the video stream, such as the identification of object intrusion, behavior anomaly and the like. Such ability is directly related to the risk warning efficiency and system reliability, and therefore the development of high-precision and low-false alarm abnormal detection technology has become the core requirement of the industry.
[0003] However, the existing image anomaly detection method based on quantum computing has significant defects: although quantum feature encoding can improve the data processing dimension, when facing environmental noise such as dynamic light, rain and fog interference, the quantum state evolution process is easy to lose stability, resulting in feature drift and decline of model generalization ability; more importantly, the existing technology generally lacks real-time verification mechanism for the physical authenticity of the detection result, and fails to incorporate the object motion acceleration constraint principle in Newtonian mechanics and the surface reflection angle consistency in optical law into the discrimination process, so that the system is easily disturbed by non-real threat sources such as light and shadow artifacts and high-speed moving objects, and the false alarm rate is high, which seriously restricts the practicalization process of the technology. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a monitoring camera image anomaly detection method to solve the problems of poor detection robustness caused by unstable quantum feature evolution and high false alarm rate caused by lack of physical rule verification mechanism.
[0006] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a monitoring camera image anomaly detection method, which comprises: obtaining an original video stream, extracting a pixel matrix of a current frame and a motion vector field of an adjacent frame to jointly encode a quantum state bit vector, inputting the quantum state bit vector into a pre-constructed anomaly detection operator, performing quantum state evolution calculation in a Hilbert space, and outputting a two-dimensional distribution matrix of each pixel region; performing adaptive segmentation processing on the two-dimensional distribution matrix, screening out a pixel region with a probability value exceeding a dynamic judgment standard, and generating a binary image marking a potential abnormal region; analyzing a time-space motion trajectory of the marked binary image, simultaneously extracting a motion state feature and an optical reflection feature, inputting the motion state feature and the optical reflection feature into a physical rule knowledge base for compliance verification of mechanical laws and optical laws, and outputting a physical verification conclusion; comprehensively marking the binary image and the physical verification conclusion, when a quantum anomaly probability value reaches an alarm standard and passes the physical verification, outputting an abnormal alarm signal; converting the abnormal alarm signal into an adversarial training sample, generating a cross-scene virtual sample through quantum noise injection, and dynamically updating the anomaly detection operator.
[0007] As a preferred scheme of the monitoring camera image anomaly detection method, the pixel matrix of the current frame and the motion vector field of the adjacent frame are jointly encoded into a quantum state bit vector, and the specific steps are as follows, The motion displacement vector of each pixel point between the adjacent frames is calculated through an optical flow algorithm, and the pixel coordinate information and the motion displacement vector are bound as a composite data unit according to the spatial position; Each composite data unit is mapped into a quantum bit ground state, and a controlled quantum gate operation is applied to generate an entangled state; the entangled state is encoded into a high-dimensional state vector through quantum Fourier transform, and a quantum state bit vector carrying space-time correlation characteristics is output.
[0008] As a preferred scheme of the monitoring camera image anomaly detection method, the pre-constructed anomaly detection operator refers to a linear transformation model constructed through quantum eigenvalue spectrum decomposition; In the eigenstate of the linear transformation model, a first group of eigenstates map quantum state space distribution characteristics of a normal scene, and a second group of eigenstates map quantum state space distribution characteristics of an abnormal scene; The specific steps of performing quantum state evolution calculation in the Hilbert space and outputting a two-dimensional distribution matrix of each pixel region are as follows, A continuous unitary transformation based on the Schrodinger equation is applied to the input quantum state bit vector to simulate the dynamic evolution process of the quantum system; An orthogonal projection operation is performed on the evolved quantum state bit vector to decompose it into two complementary subspaces of normal state and abnormal state, the probability amplitude modulus square of quantum state collapse to the projection direction of the abnormal subspace is calculated, and the quantum anomaly probability value corresponding to each pixel is generated; The quantum anomaly probability value is mapped to an image pixel coordinate system, and a two-dimensional distribution matrix is output. The row and column indexes of the two-dimensional distribution matrix correspond to image pixel coordinates, and the matrix element value is the quantum anomaly probability value of the corresponding position.
[0009] As a preferred scheme of the monitoring camera image anomaly detection method, the dynamic determination criterion is to calculate the gray level co-occurrence matrix entropy value of the image region based on the block, and dynamically adjust the anomaly probability threshold value according to the gray level co-occurrence matrix entropy value.
[0010] As a preferred scheme of the monitoring camera image anomaly detection method, the output physical verification conclusion has the following specific steps, The motion acceleration vector and the surface reflection angle are extracted from the space-time motion trajectory of the abnormal area. The motion acceleration vector is input into the Newtonian mechanics rule library to verify the linear constraint relationship between force and acceleration, and the surface reflection angle is input into the geometric optics rule library to verify the identity principle of incident angle and reflection angle. When and only when the motion acceleration vector satisfies the linear constraint relationship between force and acceleration of the Newtonian mechanics rule library, and the surface reflection angle satisfies the identity principle of incident angle and reflection angle of the geometric optics rule library, the verification passing conclusion is output.
[0011] As a preferred scheme of the monitoring camera image anomaly detection method, the alarm criterion is a joint determination condition for triggering an abnormal alarm when the quantum anomaly probability value exceeds the preset threshold, and the physical verification conclusion is passed. The abnormal alarm signal includes a positioning coordinate of a three-dimensional geodetic coordinate system and an abnormal probability thermodynamic map of the corresponding area; and the three-dimensional geodetic coordinate system is calculated by the binocular parallax triangulation principle.
[0012] As a preferred scheme of the monitoring camera image anomaly detection method, the dynamic updating of the anomaly detection operator has the following specific steps, The original video frame is located according to the abnormal alarm signal, and the quantum state vector of the corresponding frame is extracted as the original training sample. The environmental noise is generated by the quantum decoherence process to simulate the generation of countermeasures, the eigenvalue distribution of the anomaly detection operator is optimized, and the parameters of the controlled quantum gate operation are updated online.
[0013] In a second aspect, the present application provides a monitoring camera image anomaly detection system, comprising a quantum encoding module, an image segmentation module, a physical verification module, an alarm generation module and an adversarial training module; the quantum encoding module is used to obtain an original video stream, extract a pixel matrix of a current frame and a motion vector field of an adjacent frame to jointly encode a quantum state bit vector, input the quantum state bit vector into a pre-constructed anomaly detection operator, perform quantum state evolution calculation in a Hilbert space, and output a two-dimensional distribution matrix of each pixel region; the image segmentation module is used to perform adaptive segmentation processing on the two-dimensional distribution matrix, filter out pixel regions with a probability value exceeding a dynamic judgment standard, and generate a binary image marking a potential abnormal region; the physical verification module is used to analyze a space-time motion trajectory of the marked binary image, extract a motion state feature and an optical reflection feature, input the motion state feature and the optical reflection feature into a physical rule knowledge base to verify compliance with mechanical laws and optical laws, and output a physical verification conclusion; the alarm generation module is used to comprehensively consider the marked binary image and the physical verification conclusion, output an abnormal alarm signal when the quantum anomaly probability value reaches an alarm standard and the physical verification is passed; and the adversarial training module is used to convert the abnormal alarm signal into an adversarial training sample, generate cross-scene virtual samples through quantum noise injection, and dynamically update the anomaly detection operator.
[0014] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, any step of the monitoring camera image anomaly detection method according to the first aspect of the present application is implemented.
[0015] In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any step of the monitoring camera image anomaly detection method according to the first aspect of the present application is implemented.
[0016] The present application has the following beneficial effects: in the quantum state bit vector generation step, the pixel matrix and the motion vector field are jointly encoded into a quantum state bit vector carrying space-time correlation characteristics, the quantumization expression of the motion features between video frames is realized, and the extraction capability of abnormal features is enhanced; in the Hilbert space quantum state evolution step, the quantum state bit vector is subjected to unitary transformation and orthogonal projection operation to generate an accurately quantized abnormal probability distribution matrix, and the accurate evaluation of abnormal risks is realized. Meanwhile, in the physical rule verification step, the abnormal region is subjected to mechanical and optical double verification, and the physical authenticity of the detection result is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without any creative effort.
[0018] Fig. 1 The flow chart of the monitoring camera image anomaly detection method.
[0019] Fig. 2 The flow chart of outputting the two-dimensional distribution matrix of each pixel region.
[0020] Fig. 3 The flow chart of outputting the physical verification conclusion.
[0021] Fig. 4 The flow chart of dynamically updating the anomaly detection operator. DETAILED DESCRIPTION
[0022] In order to make the above objectives, features and advantages of the present application more apparent and comprehensible, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0023] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application, therefore the present application is not limited to the specific embodiments disclosed below.
[0024] Secondly, the "one embodiment" or "embodiment" referred to herein means that the specific features, structures or characteristics can be included in at least one implementation of the present application. "In one embodiment" appearing in different places in the specification does not mean the same embodiment, nor is it an independent or alternative embodiment that excludes other embodiments.
[0025] REFERENCE Figs. 1-4 For one embodiment of the present application, the embodiment provides a monitoring camera image anomaly detection method, comprising the following steps: S1: acquiring an original video stream, extracting a pixel matrix of a current frame and a motion vector field of an adjacent frame to jointly encode a quantum state bit vector, inputting to a pre-constructed anomaly detection operator, performing quantum state evolution calculation in a Hilbert space, and outputting a two-dimensional distribution matrix of each pixel region.
[0026] S1.1: acquiring an original video stream, extracting a pixel matrix of a current frame and a motion vector field of an adjacent frame to jointly encode a quantum state bit vector.
[0027] Specifically, the current frame with timestamp and the adjacent previous frame with timestamp are extracted from the original video stream; the original video stream is stored as a sequence of continuous frames, each frame storing pixel values in a two-dimensional array.
[0028] Let the pixel matrix of the current frame be denoted as , where the element in the pixel matrix represents the pixel value (such as RGB value or grayscale value) at pixel coordinate ; the pixel matrix of the adjacent frame is denoted as . Further, the motion displacement vector of each pixel point between the adjacent frames is calculated by the optical flow algorithm, and the pixel coordinate information and the motion displacement vector are bound as a composite data unit according to the spatial position; Specifically, the optical flow algorithm (Horn-Schunck method is adopted, because it is a classic optical flow algorithm and meets the requirement of “calculating the motion displacement vector of each pixel point”) is applied to process and .
[0029] Specifically, the Horn-Schunck optical flow algorithm is used to calculate the motion vector field (where each element is a two-dimensional motion displacement vector), and the displacement vector of each pixel is solved by minimizing the global energy function , and the expression is: ; ; In the formula, is the motion displacement vector at pixel coordinate , representing the motion direction and distance of the pixel from the adjacent frame to the current frame, represents the row index in the image matrix, represents the column index in the image matrix, represents the horizontal component of the displacement vector, represents the continuous horizontal coordinate (horizontal direction) in the image plane, represents the vertical component of the displacement vector, the continuous vertical coordinate (vertical direction) in the image plane, represents the spatial gradient of the image in the axis direction, represents the spatial gradient of the image in the axis direction, represents the spatial gradient of the image in the time dimension, represents the spatial gradient of , and represents the spatial gradient of the displacement component , and Total variation regularization term of displacement field, to enforce the smoothness of the motion vector field, denotes the spatial gradient modulus square of , denotes the spatial gradient modulus square of , denotes the smoothing coefficient , to control the weight balance of the smoothing term and the data term (typical value ), is the global energy summation, which is the double integral over the whole image domain; binds the pixel coordinate and the motion displacement vector as a composite data unit, the expression is: ; wherein, denotes the four-dimensional spatiotemporal feature vector bound at the pixel coordinate ; It should be noted that the composite data unit is stored as a four-dimensional vector, representing the position and motion attributes. The output is a matrix of composite data units, with a size consistent with the image resolution (such as an M x N matrix), where M typically represents the number of rows (height) and N represents the number of columns (width).
[0030] Furthermore, each composite data unit is mapped to a qubit ground state, and a controlled quantum gate operation is applied to generate an entangled state; through quantum Fourier transform, the entangled state is encoded into a high-dimensional state vector, outputting a quantum state bit vector carrying spatiotemporal correlation characteristics.
[0031] Specifically, a quantum bit is assigned to each composite data unit, initialized to the ground state , and a Hadamard gate is applied to generate a uniform superposition state.
[0032] The state of each quantum bit is represented as: ; wherein, denotes the state of the quantum bit at the pixel coordinate , denotes the Hadamard gate (quantum gate operation), which converts the ground state to a uniform superposition state, denotes the ground state of the quantum bit, denotes the excited state of the quantum bit, is the superposition state after the Hadamard gate, indicating that the quantum bit is in and with equal probability; for the pixel coordinate and The state of the quantum bit (i.e., the adjacent quantum bit and ) performs the CNOT operation, the expression is: ; Where, Represents a controlled-NOT gate, a two-qubit gate where the first bit is the control bit and the second bit is the target bit. is the tensor product operation, representing the joint state of two quantum bits, Represents pixel coordinates and The direct product state of the quantum bit, represents modulo 2 addition (binary XOR operation), Indicates that the target bit state is updated to the modulo 2 addition result of the control bit and the target bit; Entangled state Applying quantum Fourier transform , output high-dimensional state vector, the expression is: ; Where, represents the high-dimensional state vector after quantum Fourier transform, Represents vector, represents the quantum Fourier transform, which converts the quantum state from position basis to frequency basis, represents the entangled state of the input, stands for entangled. represents the total number of quantum bits, Indicates the A computational basis state, Indicates the calculation of the base state index, Represents the phase information, The amplitude and phase of is the complex phase factor, indicating that the quantum state is Phase rotation on .
[0033] S1.2: Input to the pre-built anomaly detection operator, perform quantum state evolution calculation in Hilbert space, and output the two-dimensional distribution matrix of each pixel area.
[0034] It should be noted that the pre-built anomaly detection operator refers to a linear transformation model constructed by quantum eigenspectral decomposition; among the eigenstates of the linear transformation model, the first group of eigenstates maps the quantum state spatial distribution characteristics of normal scenarios, and the second group of eigenstates maps the quantum state spatial distribution characteristics of abnormal scenarios; Specifically, the pre-built anomaly detection operator is a linear transformation model, whose eigenstates are divided into two groups: The normal eigenstate expression is: ; The abnormal eigenstate expression is: ; Wherein, represents the eigenstate of the normal scene, represents the index number of the normal eigenstate, is the normal subspace dimension (i.e. the total number of normal eigenstates), represents the eigenstate of the abnormal scene, represents the index number of the abnormal eigenstate, represents the total dimension of the Hilbert space, represents the total number of quantum bits; Further, a continuous unitary transformation based on the Schrödinger equation is applied to the input quantum state vector to simulate the dynamic evolution process of the quantum system. Specifically, the input linear transformation model is subjected to a unitary transformation based on the Schrödinger equation to simulate time evolution.
[0035] The evolved quantum state vector is: ; In the formula, represents the evolved quantum state vector carrying the spatiotemporal dynamic information, represents the time evolution operator constructed based on the Schrödinger equation; An orthogonal projection operation is performed on the evolved quantum state vector to decompose it into two complementary subspaces of normal state and abnormal state, and the probability amplitude modulus square of the quantum state collapsing to the projection direction of the abnormal subspace is calculated to generate the quantum abnormal probability value corresponding to each pixel; Specifically, the abnormal subspace projection operator is defined on ; The orthogonal projection is performed to decompose it into two complementary subspaces of normal state and abnormal state. The probability amplitude modulus square of the quantum state collapsing to the abnormal subspace is calculated to generate the quantum abnormal probability value corresponding to each pixel , the expression is: ; In the formula, represents the quantum abnormal probability value of the pixel coordinate , represents the linear transformation of by the abnormal subspace projection operator to extract the component of the quantum state vector on the abnormal eigenstate basis vector; It should be noted that the process of defining the anomaly subspace projection operator is as follows: Based on the eigenspectral decomposition results of the pre-constructed anomaly detection operator, the quantum state space is explicitly divided into a normal subspace and an anomaly subspace. The anomaly subspace is completely spanned by all eigenstates that represent anomaly scenarios. These eigenstates correspond to various possible anomaly patterns in the image. By linearly superposing the outer product operators corresponding to these anomaly eigenstates, the complete anomaly subspace projection operator can be constructed.
[0036] Furthermore, the quantum anomaly probability value is mapped to the image pixel coordinate system and a two-dimensional distribution matrix is output; Among them, the row and column indexes of the two-dimensional distribution matrix correspond to the image pixel coordinates, and the matrix element values are the quantum anomaly probability values at the corresponding positions.
[0037] Specifically, each pixel position The quantum anomaly probability value The image is organized into a two-dimensional distribution matrix based on row and column indices. The matrix row index corresponds to the pixel's ordinate, the column index corresponds to the pixel's abscissa, and the element value is the quantum anomaly probability value at the corresponding position. The output two-dimensional distribution matrix has the same size as the input image (e.g., an M×N matrix).
[0038] S2: Adaptively segment the two-dimensional distribution matrix to screen out pixel areas whose probability values exceed the dynamic judgment criteria, and generate a binary image marking potential abnormal areas.
[0039] The dynamic judgment standard refers to calculating the gray-level co-occurrence matrix entropy value of the image area based on the block, and dynamically adjusting the abnormal probability threshold according to the size of the gray-level co-occurrence matrix entropy value.
[0040] Specifically, the two-dimensional distribution matrix composed of quantum anomaly probability values is divided into non-overlapping rectangular blocks.
[0041] It should be noted that the non-overlapping rectangular block size should be selected as 8×8 to balance the efficiency of texture feature calculation and the preservation of spatial details. If the image edge cannot form a complete block, the boundary is filled with mirroring to complete the non-overlapping rectangular block size.
[0042] Furthermore, for each 8×8 non-overlapping rectangular block image area that has been divided, a texture feature extraction operation is performed.
[0043] Specifically, all quantum anomaly probability values within non-overlapping rectangular blocks are extracted and linearly normalized to grayscale (e.g., integer grayscale of 0-255). Based on the normalized grayscale non-overlapping rectangular blocks, a grayscale co-occurrence matrix is generated with a 1-pixel spacing in the 0° direction. The process of generating the gray-level co-occurrence matrix is achieved by counting the frequencies of co-occurrence of pairs of gray levels at adjacent horizontal positions.
[0044] Specifically, normalize each element of the gray level co-occurrence matrix to a probability value, calculate the product of the probability value and the natural logarithm for each non-zero probability element and take the opposite number, and finally accumulate the product results of all non-zero elements to obtain the non-overlapping rectangular block entropy value that accurately reflects the texture complexity: Further, after completing the non-overlapping rectangular block entropy value calculation of all blocks in the whole image, the average entropy value benchmark of the whole image is determined. Based on the average entropy value benchmark of the whole image, the abnormal probability threshold of each non-overlapping rectangular block is dynamically adjusted in proportion.
[0045] Specifically, the non-overlapping rectangular block with an average entropy value higher than the average value is raised in the entropy difference proportion to raise the abnormal probability threshold; the non-overlapping rectangular block with an average entropy value lower than the average value is lowered in the entropy difference proportion to lower the abnormal probability threshold; and at the same time, the abnormal probability threshold is constrained in a reasonable fluctuation range (for example, the abnormal probability threshold is constrained in the [0.5, 0.9] interval); Example: After completing the non-overlapping rectangular block entropy value calculation of the whole image, assuming that the average entropy value of the whole image is 5.2, at this time it is detected that the entropy value of a certain non-overlapping rectangular block A is 6.8 (higher than the average value), then the abnormal probability threshold of A is raised in the entropy difference proportion (6.8-5.2=1.6), and the specific raising amplitude is 1.6x0.03=0.048, if the basic abnormal probability threshold is 0.7, then the adjusted abnormal probability threshold of A block is 0.7+0.048=0.748; At the same time, another non-overlapping rectangular block B has an entropy value of 4.0 (lower than the average value), then the abnormal probability threshold of B is lowered in the entropy difference proportion (5.2-4.0=1.2), and the specific lowering amplitude is 1.2x0.02=0.024, the adjusted abnormal probability threshold of B block is 0.7-0.024=0.676; Finally, all the adjusted abnormal probability thresholds are constrained, for example, the abnormal probability threshold of A block 0.748 is constrained to 0.748 (not exceeding the upper limit of 0.9), and the abnormal probability threshold of B block 0.676 is constrained to 0.676 (not lower than the lower limit of 0.5), so as to ensure that the abnormal probability thresholds of all non-overlapping rectangular blocks dynamically fluctuate in the reasonable range of [0.5, 0.9].
[0046] According to the row and column coordinates mapping of the pixels, determine the non-overlapping rectangular block area to which the pixel belongs, and compare the quantum abnormal probability value of each pixel with the abnormal probability threshold of the non-overlapping rectangular block to which it belongs in real time. When the probability value reaches or exceeds the abnormal probability threshold of the non-overlapping rectangular block, mark the pixel as a potential abnormal area; otherwise, mark it as a normal area.
[0047] It should be noted that the output result is a binary matrix completely matched with the size of the input two-dimensional distribution matrix, in which the element value 0 represents a normal pixel and 1 represents a potential abnormal pixel, forming a complete binary labeled image.
[0048] S3: Analyzing the spatio-temporal motion trajectory of the labeled binary image, while extracting the motion state feature and optical reflection feature as input to the physical rule knowledge base for verification of the compliance of mechanical law and optical law, and outputting the physical verification conclusion.
[0049] S3.1: Analyzing the spatio-temporal motion trajectory of the labeled binary image, and extracting the motion acceleration vector and surface reflection angle from the spatio-temporal motion trajectory of the abnormal area.
[0050] Specifically, the binary image is combined into a binary image sequence according to the video time sequence; Based on the binary image sequence, a cross-frame target association operation is performed on each abnormal pixel area labeled as 1; An overlapping area matching algorithm is used to calculate the pixel overlap rate of the abnormal area of the current frame and the abnormal area of the adjacent frame. If the overlap rate exceeds the standard (such as the overlap rate exceeding 50%), it is determined as the same target, and a spatio-temporal motion trajectory point sequence is generated.
[0051] It should be noted that the spatio-temporal motion trajectory point sequence is composed of a plurality of spatio-temporal motion trajectory points in time sequence, wherein each spatio-temporal motion trajectory point contains a timestamp, an image pixel coordinate and a region pixel set, which collectively represent the complete motion process of the target.
[0052] Furthermore, for each target's spatio-temporal motion trajectory point sequence, take the continuous three trajectory points (timestamp , , ), calculate the instantaneous acceleration at the middle time .
[0053] Specifically, by analyzing the change of the target pixel coordinates in the continuous frames, the velocity change amount in the horizontal and vertical directions is determined. Based on the time interval between the video frames, the velocity change amount in the two directions is divided by the time interval respectively to obtain the acceleration components in the horizontal and vertical directions. Finally, the two acceleration components are combined into a complete two-dimensional acceleration feature, and the two-dimensional acceleration feature is associated with the corresponding target area.
[0054] Extracting the RGB pixel value of the target area in the current frame, converting to the HSV color space to obtain the brightness component, and calculating the target surface normal vector direction through three-dimensional reconstruction (binocular disparity triangulation).
[0055] According to the preset light source direction (for example, the azimuth angle of the monitoring fill light), the included angle between the incident light and the surface normal is calculated as the surface reflection angle.
[0056] S3.2: Input the motion acceleration vector into the Newtonian mechanics rule library to verify the linear constraint relationship between force and acceleration; input the surface reflection angle into the geometric optics rule library to verify the identity principle of the incident angle and the reflection angle.
[0057] Specifically, the motion acceleration vector of the input target is verified against the Newtonian mechanics rule base.
[0058] Query the mass range and maximum force constraint of the same object (such as pedestrians, vehicles) in the rule base (for example, the mass of pedestrians is 50-100 kg, and the maximum thrust is 1000 N); Calculate the acceleration modulus, the expression is: ; In the formula, represents the horizontal component of the motion acceleration vector, represents the vertical component of the motion acceleration vector; Verify whether ( is the maximum force, is the minimum mass) Example: pedestrian target , verify , the condition is true.
[0059] Further, input the surface reflection angle (incidence angle) to perform geometric-optical rule base verification.
[0060] Specifically, the direction of the reflected light spot of the target area is extracted from the monitoring picture, and the actual reflection angle is calculated.
[0061] The direction of the reflected light spot of the target area is extracted from the monitoring picture, and the actual reflection angle is calculated.
[0062] Verify whether (optical measurement tolerance).
[0063] Example: , the condition is true.
[0064] S3.3: If and only if the motion acceleration vector satisfies the force and acceleration linear constraint relationship of the Newtonian mechanics rule base, and the surface reflection angle satisfies the incidence angle and reflection angle equivalence principle of the geometric-optical rule base, output the verification passed conclusion.
[0065] Specifically, if the motion acceleration vector of the target passes the Newtonian mechanics rule base verification (condition 1) and the surface reflection angle passes the geometric-optical rule base verification (condition 2), output that the target "physical verification passed".
[0066] If any condition is not met (for example or ), output "physical verification failed", and output the structured verification result.
[0067] wherein, the structured verification result includes, target ID (based on spatio-temporal trajectory identification); Newtonian mechanics verification result: Boolean value (True / False); geometric optics verification result: Boolean value (True / False); final conclusion: Boolean value (output True only when both are True).
[0068] It should be noted that True indicates that the physical verification is passed (in line with the mechanical or optical rules), and False indicates that the verification is not passed (violates the physical rules).
[0069] S4: Integrate the binary image of the labeled target and the physical verification conclusion, and output an abnormal alarm signal when the quantum abnormal probability value reaches the alarm standard and passes the physical verification.
[0070] wherein, the alarm standard refers to the joint decision condition for triggering an abnormal alarm when the quantum abnormal probability value exceeds the pre-set confidence threshold and the physical verification conclusion is passed; the abnormal alarm signal includes outputting the positioning coordinates of the three-dimensional geodetic coordinate system and the abnormal probability heat map of the corresponding area; the three-dimensional geodetic coordinate system is obtained by calculating the binocular parallax triangulation principle.
[0071] It should be noted that the pre-set confidence threshold refers to the quantum abnormal probability decision threshold value determined in advance through historical abnormal data statistical analysis and actual scene verification.
[0072] Specifically, the setting of the pre-set confidence threshold includes the following three technical levels: based on the labeled real abnormal event data in the verification sample library, the quantum abnormal probability distribution interval of the correct alarm case is counted, and the lower limit of the distribution interval is taken as the basic threshold value; dynamically adjust according to the risk level requirements of different monitoring scenes, for example, a high threshold of 0.85 is used in the financial security scene to reduce the false alarm rate, and a threshold of 0.7 is used in the industrial dangerous area monitoring to improve the sensitivity; continuously optimize through online incremental learning mechanism, recalculate the ROC curve to determine the confidence threshold every time 100 verification samples are added, and ensure that the confidence threshold reflects the current environment optimal decision balance point (the initial experience value is set to 0.8). The setting process is completed before system deployment and is fixed to the configuration parameter library, and is used as a fixed threshold in the joint decision in the running stage.
[0073] S4.1: Traverse all physical verification targets (structured verification results from S3 output), and perform joint decision for each target.
[0074] Specifically, the maximum quantum abnormal probability value in the target area is extracted from the binary image, and it is checked whether it meets: maximum quantum abnormal probability value≥pre-set confidence threshold (for example, 0.8); The physical verification conclusion of the target is "pass" (i.e., the final conclusion of S3 output is True) at the same time, and only when the two conditions are met at the same time, the corresponding target is marked as a target to be alarmed.
[0075] S4.2: Perform binocular disparity triangulation positioning on each target to be alarmed.
[0076] Specifically, the left and right view pixel coordinates of the target are obtained from the binocular camera, and the depth distance of the target in the three-dimensional space is calculated according to the binocular baseline distance and focal length parameters.
[0077] The image pixel coordinates are converted into three-dimensional geodetic coordinates (east-north-sky direction) through a coordinate transformation matrix, and the positioning coordinates are output; Based on the image pixel area range corresponding to the positioning coordinates, the quantum anomaly probability value of the corresponding area is extracted from the two-dimensional distribution matrix, and the probability value is normalized to a unified range (such as 0-255 range) to generate a quantum anomaly probability heat map.
[0078] Based on the abnormal pixel area marked as 1 in the binary image, the target contour boundary line is extracted through an edge detection algorithm, and is superimposed on the quantum anomaly probability heat map to generate an abnormal alarm signal for each target to be alarmed.
[0079] Among them, the abnormal alarm signal includes three-dimensional geodetic coordinates: floating point data (unit: meter); Abnormal probability heat map: gray image matrix matched with target area; Time stamp: accurate time of alarm triggering time (synchronous video stream time stamp).
[0080] S5: Convert the abnormal alarm signal into an adversarial training sample, generate a cross-scene virtual sample through quantum noise injection, and dynamically update the anomaly detection operator.
[0081] S5.1: According to the abnormal alarm signal, locate the original video frame, and extract the quantum state bit vector of the corresponding frame as the original training sample; Specifically, according to the time stamp in the abnormal alarm signal, the corresponding frame in the original video stream is located, and the composite data unit is reconstructed based on the pixel coordinates of the frame. The composite data unit is re-input into the quantum encoding process: apply Hadamard gate to generate superposition state, perform CNOT gate entanglement operation, and output the quantum state bit vector of the frame through quantum Fourier transform as the original training sample.
[0082] S5.2: Generate adversarial samples through quantum decoherence process to simulate environmental noise, optimize the intrinsic spectral distribution of the anomaly detection operator, and update the parameters of the controlled quantum gate operation online.
[0083] Specifically, random amplitude perturbation (for example, ±5% deviation) is applied to the quantum state bit vector of the original training sample to simulate the probability amplitude imbalance caused by sensor noise; Adding random offset (e.g. Gaussian distribution noise) on complex phase, destroying quantum coherence. Generate adversarial samples after decoherence disturbance, simulate cross-scene interference (such as rain, fog, light mutation); Merge the original training samples with the adversarial samples into the training set, optimize the eigenvalue distribution of the anomaly detection operator by calculating the projection difference of the samples in the normal subspace and the abnormal subspace, and simultaneously adjust the controlled quantum gate operation parameters (such as the probability weight of the control bit of the CNOT gate), to realize the online dynamic update of the operator.
[0084] The embodiment also provides a monitoring camera image anomaly detection system, comprising: a quantum encoding module, configured to acquire an original video stream, extract a pixel matrix of a current frame and a motion vector field of an adjacent frame to jointly encode into a quantum state bit vector, input into a pre-constructed anomaly detection operator, perform quantum state evolution calculation in a Hilbert space, and output a two-dimensional distribution matrix of each pixel region; an image segmentation module, configured to perform adaptive segmentation processing on the two-dimensional distribution matrix, filter out pixel regions with probability values exceeding a dynamic judgment standard, and generate a binary image marking potential abnormal regions; a physical verification module, configured to analyze the time and space motion trajectory of the marked binary image, extract motion state features and optical reflection features, and input them into a physical rule knowledge base to perform compliance verification of mechanical laws and optical laws, and output a physical verification conclusion; an alarm generation module, configured to comprehensively consider the marked binary image and the physical verification conclusion, output an abnormal alarm signal when the quantum anomaly probability value reaches an alarm standard and passes the physical verification; and an adversarial training module, configured to convert the abnormal alarm signal into an adversarial training sample, generate cross-scene virtual samples through quantum noise injection, and dynamically update the anomaly detection operator.
[0085] The embodiment also provides a computer device suitable for the monitoring camera image anomaly detection method, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the monitoring camera image anomaly detection method proposed in the above embodiment.
[0086] The computer device can be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is configured to perform wired or wireless communication with an external terminal. The wireless communication can be achieved by WIFI, an operator network, NFC (Near Field Communication) or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0087] The embodiment also provides a storage medium having a computer program stored thereon, the program being executed by a processor to implement the method for monitoring camera image anomaly detection proposed in the above embodiment. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk or an optical disk.
[0088] In summary, the present application generates a quantum state vector by combining a pixel matrix and a motion vector field to encode a quantum state vector carrying space-time correlation characteristics, thereby realizing quantum expression of the motion characteristics between video frames and enhancing the extraction capability of abnormal features. In combination with the Hilbert space quantum state evolution step, the quantum state vector is subjected to unitary transformation and orthogonal projection operation to generate an accurately quantized abnormal probability distribution matrix, thereby realizing accurate evaluation of the abnormal risk. Meanwhile, the physical rule verification step performs mechanical and optical double verification on the abnormal area, thereby ensuring the physical authenticity of the detection result.
[0089] It should be noted that the above examples are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalently replaced, without departing from the spirit and scope of the technical solutions of the present application, which should be covered in the scope of the claims of the present application.
Claims
1. A method for detecting anomalies in surveillance camera images, characterized by: include, Obtain the original video stream, extract the pixel matrix of the current frame and the motion vector field of the adjacent frame, and jointly encode them into a quantum state bit vector. Input it into the pre-built anomaly detection operator, perform quantum state evolution calculation in Hilbert space, and output a two-dimensional distribution matrix for each pixel area. Adaptively segment the two-dimensional distribution matrix to screen out pixel areas with probability values exceeding the dynamic judgment standard, and generate a binary image marking potential abnormal areas; Analyze the spatiotemporal motion trajectory of the marked binary image, extract the motion state characteristics and optical reflection characteristics, input them into the physical rule knowledge base to verify the compliance of mechanical and optical laws, and output the physical verification conclusion; Based on the binary image of the comprehensive mark and the physical verification conclusion, when the quantum anomaly probability value reaches the alarm standard and passes the physical verification, an abnormal alarm signal is output; The abnormal alarm signal is converted into adversarial training samples, cross-scene virtual samples are generated through quantum noise injection, and the anomaly detection operator is dynamically updated.
2. The method for detecting anomalies in surveillance camera images according to claim 1, wherein: The pixel matrix of the current frame and the motion vector field of the adjacent frame are jointly encoded into a quantum state vector. The specific steps are as follows: The motion displacement vector of each pixel between adjacent frames is calculated using the optical flow algorithm, and the pixel coordinate information and the motion displacement vector are bound together into a composite data unit according to the spatial position; Each composite data unit is mapped to a quantum bit ground state, and a controlled quantum gate operation is applied to generate an entangled state; the entangled state is encoded into a high-dimensional state vector through quantum Fourier transform, and a quantum state bit vector carrying space-time correlation characteristics is output.
3. The method for detecting anomalies in surveillance camera images according to claim 2, wherein: The pre-built anomaly detection operator refers to a linear transformation model constructed by quantum eigenspectral decomposition; In the eigenstates of the linear transformation model, the first group of eigenstates maps the quantum state space distribution characteristics of normal scenes, and the second group of eigenstates maps the quantum state space distribution characteristics of abnormal scenes; The quantum state evolution calculation is performed in the Hilbert space to output a two-dimensional distribution matrix of each pixel area. The specific steps are as follows: Apply continuous unitary transformation based on the Schrödinger equation to the input quantum state vector to simulate the dynamic evolution process of the quantum system; An orthogonal projection operation is performed on the evolved quantum state potential vector to decompose it into two complementary subspaces: normal state and abnormal state. The square of the probability amplitude modulus of the quantum state collapsing into the projection direction of the abnormal subspace is calculated to generate the quantum abnormal probability value corresponding to each pixel. Map the quantum anomaly probability value to the image pixel coordinate system and output a two-dimensional distribution matrix; The row and column indexes of the two-dimensional distribution matrix correspond to the image pixel coordinates, and the matrix element values are the quantum anomaly probability values of the corresponding positions.
4. The method for detecting anomalies in surveillance camera images according to claim 3, wherein: The dynamic judgment standard refers to calculating the gray level co-occurrence matrix entropy value of the image area based on the block, and dynamically adjusting the abnormal probability threshold according to the size of the gray level co-occurrence matrix entropy value.
5. The method for detecting anomalies in surveillance camera images according to claim 4, wherein: The specific steps of outputting the physical verification conclusion are as follows: Extract the motion acceleration vector and surface reflection angle from the spatiotemporal motion trajectory of the abnormal area; Input the motion acceleration vector into the Newtonian mechanics rule library to verify the linear constraint relationship between force and acceleration; input the surface reflection angle into the geometric optics rule library to verify the equivalence principle between the incident angle and the reflection angle; The output verification passes the conclusion if and only if the motion acceleration vector satisfies the linear constraint relationship between force and acceleration in the Newtonian mechanics rule base, and the surface reflection angle satisfies the principle of equality between the incident angle and the reflection angle in the geometric optics rule base.
6. The method for detecting anomalies in surveillance camera images according to claim 5, wherein: The alarm standard refers to the joint judgment condition that triggers the abnormal alarm when the quantum anomaly probability value exceeds the preset confidence threshold and the physical verification conclusion is passed; The abnormal alarm signal includes outputting the positioning coordinates of a three-dimensional geodetic coordinate system and an abnormal probability heat map of the corresponding area; the three-dimensional geodetic coordinate system is calculated by binocular parallax triangulation measurement principle.
7. The method for detecting anomalies in surveillance camera images according to claim 6, wherein: The specific steps of dynamically updating the anomaly detection operator are as follows: Locate the original video frame according to the abnormal alarm signal and extract the quantum state bit vector of the corresponding frame as the original training sample; Adversarial samples are generated by simulating environmental noise through the quantum decoherence process, the eigenspectral distribution of the anomaly detection operator is optimized, and the parameters of the controlled quantum gate operation are updated online.
8. A surveillance camera image anomaly detection system, based on the surveillance camera image anomaly detection method according to any one of claims 1 to 7, characterized in that: Including quantum coding module, image segmentation module, physical verification module, alarm generation module and adversarial training module; The quantum coding module is used to obtain the original video stream, extract the pixel matrix of the current frame and the motion vector field of the adjacent frame, and jointly encode them into a quantum state bit vector. The vector is input into a pre-built anomaly detection operator, and the quantum state evolution calculation is performed in the Hilbert space to output a two-dimensional distribution matrix for each pixel area. The image segmentation module is used to perform adaptive segmentation processing on the two-dimensional distribution matrix, screen out pixel areas with probability values exceeding the dynamic judgment standard, and generate a binary image marking potential abnormal areas; The physical verification module is used to analyze the spatiotemporal motion trajectory of the marked binary image, extract motion state features and optical reflection features, input them into the physical rule knowledge base to verify the compliance of mechanical laws and optical laws, and output physical verification conclusions; The alarm generation module is used to integrate the marked binary image and the physical verification conclusion, and output an abnormal alarm signal when the quantum anomaly probability value reaches the alarm standard and passes the physical verification; The adversarial training module is used to convert abnormal alarm signals into adversarial training samples, generate cross-scenario virtual samples through quantum noise injection, and dynamically update the anomaly detection operator.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the surveillance camera image anomaly detection method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the surveillance camera image anomaly detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Quantum neural network based on local region dynamic evolution
CN121480566A
Abnormal behavior real-time detection and early warning system based on video analysis
CN122248170A