A method, device and medium for identifying and warning river tourist behavior

Through the drone combined with AlphaPose and YOLO algorithm, it can identify tourists stranded in the river and warn them, solving the problem of low efficiency of traditional methods, achieving efficient and accurate identification and early warning of the behavior of tourists in the river, and ensuring the safety of water release in the reservoir.

CN118247699BActive Publication Date: 2024-12-06HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410295817.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-12-06
Estimated Expiration
2044-03-15

AI Technical Summary

Technical Problem

The existing technology cannot effectively identify and warn of tourists stranded in rivers, resulting in safety hazards when releasing water in the reservoir. Traditional human patrol and camera monitoring are inefficient and cannot be fully covered.

Method used

The drone combined with improved AlphaPose and YOLO algorithms are used to obtain the pose feature information of tourists through video data, establish a water flow arrival time model, and optimize trajectory tracking and recognition using coordinate attention mechanism and genetic algorithm to achieve efficient and accurate recognition of tourists' behavior and Early warning.

Benefits of technology

It improves the safety of river tourists, ensures the timeliness and accuracy of reservoir water release, reduces artificial errors, and enhances the real-time tracking and prediction accuracy of tourists' behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118247699B_ABST
    Figure CN118247699B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and medium for identifying and warning the behavior of tourists in a river. The method includes framing the video data of tourists on the river to extract pictures, using the improved AlphaPose algorithm to obtain the character posture feature information in the picture; combining the sliding window attention mechanism of SwinTransformer with the channel attention mechanism of the AlphaPose algorithm to improve the accuracy of posture extraction and judge whether there are tourists stranded in the river; establishing a water flow arrival time model TSMS according to the reservoir water release information; and establishing a tourist trajectory tracking and recognition model to track and identify whether tourists are leaving the river; combining the improved YOLO algorithm to predict the tourist trajectory again, if it is the same as the tourist trajectory tracking and recognition result, the drone starts the expulsion or reminder program, if it is different, the prediction is re-identified; after determining that the tourists have left, the reservoir releases water. The present invention timely discovers tourists who will be in a dangerous state in the downstream river, effectively guarantees the personal safety of tourists and the timely opening of the reservoir to release water.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image recognition, and in particular relates to a method, device and medium for identifying and warning the behavior of river visitors. Background Art

[0002] As the global climate warms and extreme weather occurs frequently, it is of great significance to build reservoirs to improve flood control and save water for residents and agricultural irrigation. The construction of reservoirs often causes the river to be cut off, resulting in the river downstream of the reservoir being dry. At this time, tourists often go down to the river to play and check in. This will bring a safety hazard. When the upstream reservoir needs to release water to discharge floods, people playing in the downstream river will be in danger if they do not evacuate in time.

[0003] At present, the solution to this hidden danger mostly relies on manpower patrolling the river, or building fences and installing surveillance cameras at fixed locations. However, these methods are inefficient and cannot patrol the river one by one, so the hidden danger cannot be completely eliminated.

[0004] With the rise of drone technology, artificial intelligence and other technologies, these technologies can be applied to this field. Drones are convenient and fast to replace people, and using intelligent algorithms to identify people in pictures is faster and more efficient. By using drones, artificial intelligence and other technologies to eliminate safety hazards in the downstream river, it is more efficient and more accurate than traditional methods, greatly improving the safety of river visitors and ensuring the timeliness of reservoir water release. Summary of the invention

[0005] Purpose of the invention: The present invention proposes a method, device and medium for identifying and warning the behavior of river visitors. The use of technologies such as drones and intelligent algorithms greatly improves the safety of river visitors and ensures the timeliness of water release from reservoirs.

[0006] Technical solution: The invention discloses a method for identifying and warning the behavior of river visitors, comprising the following steps:

[0007] (1) Obtain video data of tourists on the river based on drone cameras;

[0008] (2) Frame the acquired video data to extract pictures, and use the improved AlphaPose algorithm to obtain the character posture feature information in the pictures; the improved AlphaPose algorithm introduces SwinTransformer into SPPE in Alphapose, combines the sliding window attention mechanism of SwinTransformer with the channel attention mechanism of AlphaPose algorithm, improves the accuracy of posture extraction, and determines whether there are tourists stranded in the river;

[0009] (3) Establish the water flow arrival time model TSMS based on the reservoir water release information;

[0010] (4) When the water flow arrival time is less than or equal to the preset time, the drone is used to start the expulsion program and establish a tourist trajectory tracking and recognition model to track and identify whether the tourist is leaving the river;

[0011] (5) The improved YOLO algorithm is used to predict the tourist trajectory again. The improved YOLO algorithm is to integrate the coordinate attention mechanism CA and the designed loss function SIOU, and introduce a hyperparameter θ in the loss function. The genetic algorithm is used to optimize θ, and the improved YOLO algorithm is combined with the tourist trajectory tracking and recognition results obtained in step (4) to improve the accuracy of the discrimination. If the prediction results are the same, the drone starts the expulsion or reminder program. If they are different, the drone re-identifies and predicts.

[0012] (6) After confirming that the tourists have left, the drone will transmit real-time video data back to the reservoir. Once it is confirmed that there are no tourists left in the river, the reservoir will release water.

[0013] Furthermore, the implementation process of step (2) is as follows:

[0014] The spatial transformation network STN in the symmetric spatial transformation network SSTN receives the candidate human body frame in the picture, and the spatial inverse transformation network SDTN corresponds the predicted human body posture to the original frame selection area. The mathematical expression is as follows:

[0015]

[0016] In the formula, (m s n s ) and (m t n t ) are the coordinates of the points on the human body region frame before and after the transformation; β1, β2, β3 are two-dimensional space vectors;

[0017] After obtaining the detected target through SSTN, the parameterized pose non-maximum suppression p-PoseNMS system in AlphaPose is used to eliminate the redundant bounding boxes generated by target detection. The elimination definition formula is as follows:

[0018] f(P i ,P j |Λ,η)=1,[D(P i ,P j |Λ)≤η]

[0019]

[0020]

[0021] D(Pi ,P j |Λ)=K(P i ,P j |σ1)+λH(P i ,P j |σ2)

[0022] Where P i Indicates the current posture; P j P i The reference posture of D(P i ,P j |Λ) is the attitude distance metric; Λ is a parameter set of D(·); η is the threshold; k * For joints; c * is the joint confidence; B(k i ) is k i The regional position; K is the posture distance; H is the space distance; λ is the weight coefficient; σ1 and σ2 are the parameters of the posture distance and space distance respectively;

[0023] The SwinTransformer algorithm is introduced in Alphapose. SwinTransformer encodes the relative position information of the image and integrates the relative position information into the target detection frame, which improves the accuracy of posture recognition. The formula is as follows:

[0024]

[0025] In the formula, Attention represents the target detection box; Q is the noise matrix; K is the Kalman gain; V is the target moving speed; SoftMax is a function; K T is the Kalman gain of the noise matrix Q; d is the coordinate value; B is the relative position matrix;

[0026] The posture guide generator PGPG is used to recognize the posture of the target; the recognized posture data is input into the database and compared to determine whether it is a human posture feature.

[0027] Furthermore, the implementation process of step (3) is as follows:

[0028] Continuity equation:

[0029]

[0030] Where H is the depth of water; x and y are two-dimensional coordinate axes, u and v are the water velocity components in the x and y directions respectively;

[0031] Momentum equation:

[0032]

[0033]

[0034] In the formula, Γ φ is the effective viscosity coefficient; f is the Coriolis force coefficient; ζ is the relative height of the free surface; g is the gravitational acceleration; τ x With τ y is the component of bottom resistance on the x and y axes; C is the wind force coefficient; ρ a is the atmospheric density; w is the wind speed ten meters above the water; β is the angle between the wind direction and the horizontal plane;

[0035] The control equations are discretized by the finite element method, and the numerical solutions of the equations are calculated using the finite element method of fluid mechanics, and finally the time is obtained.

[0036] Furthermore, the implementation process of step (4) is as follows:

[0037] The trajectory tracking and recognition model is as follows:

[0038]

[0039] G=T(ρ)[min||DJ||2+λ||α||]

[0040]

[0041]

[0042]

[0043] In the formula, x is the dynamic initial position of the person; k is the dynamic weight of the position; x k , x k-1 is the component of x when the dynamic weight is k and k-1; z k is the system construction when the dynamic weight is k; z 1:k-1 is the system structure whose position dynamic weight changes between (1~k-1); G is the processed tourist target image; D is the target type; J is the data sample; λ is the image standardization parameter; α is the image conversion coefficient; E is the image gray value; V is the image gray level; X is the number of image pixels; p is the image generation rate; ρ is the tourist target position; Q is the probability distribution; γ is the normalized weight; F is the value of the image signal in the spatial dimension obtained by using the maximum combined value; μ is the effective channel; v is the original output value; Sigmoid is a function; T(ρ) is the predicted position of the next image; F is the model image; ε is the regional dimension; T(ut) is the total area of ​​t tourist targets within the range of u;

[0044] Based on the image prediction position, the tourist trajectory is predicted. The calculation formula is as follows:

[0045]

[0046]

[0047] In the formula, U(i,j) represents the channel value of tourist i at the jth moment; A(i) is the moving speed of tourist i; I represents the observed data; is the gradient direction of the pixel low point; g is the gradient amplitude; S(i,j) is the trajectory of the i-th tourist at time j.

[0048] Furthermore, the preset time in step (4) is 15 minutes.

[0049] Furthermore, the implementation process of step (5) is as follows:

[0050] In order to reduce the impact of environmental noise on detection, the coordinate attention mechanism CA is integrated into the YOLO algorithm; the coordinate information embedding module embeds the coordinate information into the feature map with an input length of C, a height of H, and a width of W, and performs pooling in the horizontal and vertical directions to obtain the encoding of each channel. The calculation formula is as follows:

[0051]

[0052]

[0053] In the formula, z h and z w They are represented as aggregated feature tensors of size C×H×1 and C×W×1 respectively; H is the height of the image; W is the width of the image; X is the coordinate information; i and j are random variables that vary within the range;

[0054] The coordinate attention mechanism embeds the coordinate information into the partial output tensor and performs splicing operations according to the spatial dimension to obtain an intermediate feature map that encodes the horizontal and vertical information; after normalization and nonlinear activation processing, the feature map is divided into two independent vectors, and the corresponding weights are calculated by the following formula:

[0055] g h =σ(F h (f h ))

[0056] g w =σ(F w (f w ))

[0057] In the formula, g h and g w Represents the weights on height and width respectively; h and w represent height and width respectively; f h and f w Respectively represent the two independent vectors that are divided; Fh and F w Respectively represent f h and f w Convolution kernel conversion; σ is the sigmoid function;

[0058] Introduce the hyperparameter θ into the loss function to avoid over-optimization of shape loss and affect the free movement of the prediction box. The formula is as follows:

[0059]

[0060]

[0061]

[0062] In the formula, SIOU is the loss function; IOU is the original loss function; Ω is the shape loss; w W With w h are the loss of the image in height and width respectively; (w, h) and (w t ,h t ) represent the width and height of the predicted box and the real box respectively; θ is a hyperparameter used to control the degree of attention to shape loss;

[0063] The genetic algorithm is used to optimize the hyperparameter θ to further improve the free movement of the prediction box affected by over-optimization of the shape loss.

[0064] A device according to the present invention includes a memory and a processor, wherein:

[0065] A memory for storing computer programs that can be run on the processor;

[0066] The processor is used to execute the steps of the above-mentioned method for identifying and warning the behavior of river visitors when running the computer program.

[0067] A storage medium described in the present invention stores a computer program on the storage medium, and when the computer program is executed by at least one processor, the steps of the above-mentioned method for identifying and warning the behavior of river tourists are implemented.

[0068] Beneficial effects: Compared with the prior art, the present invention has the following beneficial effects:

[0069] 1. The present invention uses an improved AlphaPose algorithm to obtain human posture information and introduces the SwinTransformer algorithm. The algorithm adopts a method of encoding relative position information of the image and integrates the relative position information into the target detection frame, thereby improving the accuracy of posture recognition. It realizes behavior recognition without the need for human appearance feature information and is less affected by the external environment.

[0070] 2. The present invention establishes a water flow arrival time model, which takes into account many factors that affect the water flow speed in the river, such as wind speed, river resistance, etc., and uses this model to calculate the time required for the upstream reservoir to release water to the tourist location, which is more accurate, fast and efficient;

[0071] 3. The present invention establishes a tourist trajectory prediction and tracking model. The establishment of the model can predict and track the driven away tourists in real time, and then use the improved YOLO algorithm to predict the tourist trajectory again, integrate the coordinate attention mechanism CA and the designed loss function SIOU, introduce the hyperparameter θ into the loss function, and use the genetic algorithm to optimize θ, which not only improves the prediction accuracy, but also accelerates the overall convergence speed and maintains good robustness; and compared with the model prediction results, if the results are the same, that is, the tourists are leaving or staying in the river, the corresponding program will be started, that is, continue to drive away or stop driving away, which effectively ensures the accuracy of the judgment, and also ensures that the tourists being driven away leave the river in time to ensure the personal safety of the tourists. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 It is a flow chart of the method for identifying and warning the behavior of river visitors;

[0073] Figure 2 This is a flow chart of the improved AlphaPose algorithm proposed in the present invention;

[0074] Figure 3 Schematic diagram of the improved YOLO network structure proposed in the present invention. DETAILED DESCRIPTION

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

[0076] like Figure 1 As shown, the present invention proposes a method for identifying and warning the behavior of river tourists, which specifically includes the following steps:

[0077] Step 1: One hour before the reservoir opens to release water, the reservoir release information will be announced on display screens on both sides of the river, and drones will be sent to patrol the downstream river, using drone cameras to obtain video data.

[0078] Step 2: If Figure 2As shown, the acquired video data is framed to extract pictures, and the improved AlphaPose algorithm is used to obtain the character posture feature information in the picture. The improvement is to introduce SwinTransformer into SPPE (Single Person Pose Estimation, stacked hourglass model) in Alphapose. The SwinTransformer algorithm combines its unique sliding window attention mechanism with the original unique channel attention mechanism to improve the accuracy of posture extraction, so as to determine whether there are tourists stranded in the river.

[0079] The spatial transformer network (STN) in the symmetry spatial transformer network (SSTN) receives the candidate human body frame in the picture, and the spatial de-transformer network (SDTN) corresponds the predicted human body posture to the original frame selection area. The mathematical expression is as follows:

[0080]

[0081] In the formula, (m s n s ) and (m t n t ) are the coordinates of the points on the human body region frame before and after the transformation; β1, β2, β3 are two-dimensional space vectors.

[0082] After obtaining the detected target through SSTN, the parameterized pose non-maximum suppression p-PoseNMS system in AlphaPose is used to eliminate the redundant bounding boxes generated by target detection. The elimination definition formula is as follows:

[0083] f(P i ,P j |Λ,η)=1,[D(P i ,P j |Λ)≤η]

[0084]

[0085]

[0086] D(P i ,P j |Λ)=K(P i ,P j |σ1)+λH(P i ,P j |σ2)

[0087] Where P i Indicates the current posture; P j P i The reference posture of D(P i ,P j |Λ) is the attitude distance metric; Λ is a parameter set of D(·); η is the threshold; k * For joints; c * is the joint confidence; B(k i ) is k i The regional position; K is the posture distance; H is the space distance; λ is the weight coefficient; σ1 and σ2 are the parameters of the posture distance and space distance respectively.

[0088] The SwinTransformer algorithm is introduced in Alphapose. This algorithm encodes the relative position information of the image and integrates the relative position information into the target detection frame, which improves the accuracy of posture recognition. The formula is as follows:

[0089]

[0090] In the formula, Attention represents the target detection box; Q is the noise matrix; K is the Kalman gain; V is the target moving speed; SoftMax is a function; K T is the Kalman gain of the noise matrix Q; d is the coordinate value; B is the relative position matrix;

[0091] The Probabilistic Graphical Proposals Generator (PGPG) is used to perform posture recognition on the target; the recognized posture data is input into the database and compared to determine whether it is a human posture feature.

[0092] Step 3: According to the reservoir release information, establish the water flow arrival time model (Time Surface-water Modeling System, TSMS), the mathematical expression is as follows:

[0093] Continuity equation:

[0094]

[0095] Where H is the depth of water; x and y are two-dimensional coordinate axes, and u and v are the water velocity components in the x and y directions respectively.

[0096] Momentum equation:

[0097]

[0098]

[0099] Where Γ φ is the effective viscosity coefficient; f is the Coriolis force coefficient; ζ is the relative height of the free surface; g is the gravitational acceleration; τ x With τ y is the component of bottom resistance on the x and y axes; C is the wind force coefficient; ρ a is the atmospheric density; w is the wind speed ten meters above the water; β is the angle between the wind direction and the horizontal plane.

[0100] The control equation is discretized by the finite element method, and the numerical solution of the equation is calculated using the finite element method of fluid mechanics, and finally the time can be obtained.

[0101] When AlphaPose recognizes that there are tourists stranded in the river downstream of the reservoir, the water flow arrival time calculation model will calculate the time when the water flow will arrive there based on information such as the water release time of the reservoir; if the water flow arrival time is less than fifteen minutes, the drone will immediately start the expulsion procedure, that is, use sound, laser and spray to immediately expel the stranded tourists; if the water flow arrival time exceeds fifteen minutes, the drone will only use sound and laser to remind tourists that the upstream reservoir is about to release water and other information, and will not expel them immediately.

[0102] Step 4: When the water flow arrival time is less than or equal to 15 minutes, use the drone sound, light and spray to immediately drive tourists out of the river, and establish a tourist trajectory tracking and identification model to track and identify whether tourists are leaving the river.

[0103] The mathematical expression of the tourist trajectory tracking and recognition model is as follows:

[0104]

[0105] G=T(ρ)[min||DJ||2+λ||α||]

[0106]

[0107]

[0108]

[0109] In the formula, x is the dynamic initial position of the person; k is the dynamic weight of the position; x k , x k-1 is the component of x when the dynamic weight is k and k-1; z k is the system construction when the dynamic weight is k; z 1:k-1is the system structure whose position dynamic weight changes between (1~k-1); G is the processed tourist target image; D is the target type; J is the data sample; λ is the image standardization parameter; α is the image conversion coefficient; E is the image gray value; V is the image gray level; X is the number of image pixels; p is the image generation rate; ρ is the tourist target position; Q is the probability distribution; γ is the normalized weight; F is the value of the image signal in the spatial dimension obtained by using the maximum merge value; μ is the effective channel; v is the original output value; Sigmoid is a function; T(ρ) is the predicted position of the next image; F is the model image; ε is the regional dimension; T(ut) is the total area of ​​t tourist targets within the range of u.

[0110] Based on the image prediction position, the tourist trajectory is predicted. The calculation formula is as follows:

[0111]

[0112]

[0113] In the formula, U(i,j) represents the channel value of tourist i at the jth moment; A(i) is the moving speed of tourist i; I represents the observed data; is the gradient direction of the pixel low point; g is the gradient amplitude; S(i,j) is the trajectory of the i-th tourist at time j.

[0114] Step 5: Combine the improved YOLO algorithm to predict the tourist trajectory again; combine the improved YOLO algorithm with the tourist trajectory tracking and recognition results obtained in step 4 to improve the accuracy of the judgment; if the prediction results are the same, the drone will start the expulsion or reminder program, if they are different, re-identify and predict.

[0115] like Figure 3 As shown in the figure, the improved YOLO algorithm incorporates the coordinate attention mechanism CA and designs the loss function SIOU, introduces a hyperparameter θ into the loss function, and uses a genetic algorithm to optimize θ.

[0116] In order to reduce the impact of environmental noise on detection, the coordinate attention mechanism (CA) is integrated into the YOLO algorithm. CA is mainly divided into the following two steps:

[0117] In the coordinate information embedding module, the coordinate information is embedded into the feature map with an input length of C, a height of H, and a width of W, and pooled in the horizontal and vertical directions to obtain the encoding of each channel. The calculation formula is as follows:

[0118]

[0119]

[0120] In the formula, z h and z w They are represented as aggregated feature tensors of size C×H×1 and C×W×1 respectively; H is the height of the image; W is the width of the image; X is the coordinate information; i and j are random variables that vary within the range.

[0121] In the coordinate attention generation module, the tensor output by the coordinate information embedding part is spliced ​​according to the spatial dimension to obtain the intermediate feature map that encodes the horizontal and vertical direction information. After normalization and nonlinear activation processing, the feature map is further divided into two independent vectors, and the corresponding weights are calculated by the following formula:

[0122] g h =σ(F h (f h ))

[0123] g w =σ(F w (f w ))

[0124] In the formula, g h and g w Represents the weights on height and width respectively; h and w represent height and width respectively; f h and f w Respectively represent the two independent vectors that are divided; F h and F w Respectively represent f h and f w The convolution kernel conversion; σ is the sigmoid function.

[0125] Introduce the hyperparameter θ into the loss function to avoid over-optimization of shape loss and affect the free movement of the prediction box. The formula is as follows:

[0126]

[0127]

[0128]

[0129] In the formula, SIOU is the loss function; IOU is the original loss function; Ω is the shape loss; w W With w h are the loss of the image in height and width respectively; (w, h) and (w t ,h t ) represent the width and height of the predicted box and the true box respectively; θ is a hyperparameter used to control the degree of attention paid to shape loss. The hyperparameter θ is optimized using a genetic algorithm to further improve the free movement of the predicted box that is affected by over-optimization of shape loss.

[0130] If the trajectory prediction tracking recognition model and YOLO calculation determine that the tourists are leaving the river, the drone will turn off the expulsion program and only start the reminder and warning program; if the model and YOLO algorithm calculate that the tourists have not left the river, or the tourists are walking towards the river again, the drone's expulsion program will be started to drive away the tourists; if the prediction results are inconsistent, the prediction will be re-identified.

[0131] Step 6: After confirming that the tourists have left, the drone will transmit real-time video data back to the reservoir. Once it is confirmed that there are no tourists remaining in the river, the reservoir will release water.

[0132] After the drone has patrolled the corresponding river channel and driven away the tourists in the river channel, it will transmit the real-time image data back to the reservoir display terminal. After the reservoir supervisor confirms that it is correct, the reservoir will release water.

[0133] The present invention also provides a device, including a memory and a processor, wherein: the memory is used to store a computer program that can be run on the processor; the processor is used to execute the steps of the above-mentioned method for identifying and warning the behavior of river tourists when running the computer program.

[0134] The present invention also provides a storage medium having a computer program stored thereon, and when the computer program is executed by at least one processor, the steps of the above-mentioned method for identifying and warning the behavior of river visitors are implemented.

[0135] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for identifying and warning the behavior of river visitors, characterized in that: The following steps are involved: (1) Obtain video data of tourists on the river based on drone cameras; (2) Frame the acquired video data to extract pictures, and use the improved AlphaPose algorithm to obtain the character posture feature information in the pictures; the improved AlphaPose algorithm introduces SwinTransformer into SPPE in Alphapose, combines the sliding window attention mechanism of SwinTransformer with the channel attention mechanism of AlphaPose algorithm, improves the accuracy of posture extraction, and determines whether there are tourists stranded in the river; (3) Establish the water flow arrival time model TSMS based on the reservoir water release information; (4) When the water flow arrival time is less than or equal to the preset time, the drone is used to start the expulsion program and establish a tourist trajectory tracking and recognition model to track and identify whether the tourist is leaving the river; (5) The improved YOLO algorithm is used to predict the tourist trajectory again. The improved YOLO algorithm is to integrate the coordinate attention mechanism CA and the designed loss function SIOU, and introduce a hyperparameter θ in the loss function. The genetic algorithm is used to optimize θ, and the improved YOLO algorithm is combined with the tourist trajectory tracking and recognition results obtained in step (4) to improve the accuracy of the discrimination. If the prediction results are the same, the drone starts the expulsion or reminder program. If they are different, the drone re-identifies and predicts. (6) After confirming that the tourists have left, the drone will transmit real-time video data back to the reservoir. Once it is confirmed that there are no tourists staying in the river, the reservoir will release water; The implementation process of step (2) is as follows: The spatial transformation network STN in the symmetric spatial transformation network SSTN receives the candidate human body frame in the picture, and the spatial inverse transformation network SDTN corresponds the predicted human body posture to the original frame selection area. The mathematical expression is as follows: In the formula, (m s n s ) and (m t n t ) are the coordinates of the points on the human body region frame before and after the transformation; β1, β2, β3 are two-dimensional space vectors; After obtaining the detected target through SSTN, the parameterized pose non-maximum suppression p-PoseNMS system in AlphaPose is used to eliminate the redundant bounding boxes generated by target detection. The elimination definition formula is as follows: f(P i ,P j |Λ,η)=1,[D(P i ,P j |Λ)≤η] D(P i ,P j |Λ)=K(P i ,P j |σ1)+λH(P i ,P j |s2) Where P i Indicates the current posture; P j P i The reference posture of D(P i ,P j |Λ) is the attitude distance metric; Λ is a parameter set of D(·); η is the threshold; k * For joints; c * is the joint confidence; B(k i ) is k i The regional position; K is the posture distance; H is the space distance; λ is the weight coefficient; σ1 and σ2 are the parameters of the posture distance and space distance respectively; The SwinTransformer algorithm is introduced in Alphapose. SwinTransformer encodes the relative position information of the image and integrates the relative position information into the target detection frame, which improves the accuracy of posture recognition. The formula is as follows: In the formula, Attention represents the target detection box; Q is the noise matrix; K is the Kalman gain; V is the target moving speed; SoftMax is a function; K T is the Kalman gain of the noise matrix Q; d is the coordinate value; B is the relative position matrix; Use the posture guide generator PGPG to perform posture recognition on the target; input the recognized posture data into the database and compare them to determine whether they are human posture features; The implementation process of step (3) is as follows: Continuity equation: Where H is the depth of water; x and y are two-dimensional coordinate axes, u and v are the water velocity components in the x and y directions respectively; Momentum equation: Where Γφ is the effective viscosity coefficient; f is the Coriolis force coefficient; ζ is the relative height of the free surface; g is the gravitational acceleration; τ x With τ y is the component of bottom resistance on the x and y axes; C is the wind force coefficient; ρ a is the atmospheric density; w is the wind speed ten meters above the water; β is the angle between the wind direction and the horizontal plane; The control equations are discretized using the finite element method, and the numerical solutions of the equations are calculated using the finite element method of fluid mechanics, and finally the time is obtained; The implementation process of step (4) is as follows: The trajectory tracking and recognition model is as follows: G=T(ρ)[min||DJ||2+λ||α||] In the formula, x is the dynamic initial position of the person; k is the dynamic weight of the position; x k , x k-1 is the component of x when the dynamic weight is k and k-1; z k is the system construction when the dynamic weight is k; z 1:k-1 is the system structure whose position dynamic weight changes between (1~k-1); G is the processed tourist target image; D is the target type; J is the data sample; λ is the image standardization parameter; α is the image conversion coefficient; E is the image gray value; V is the image gray level; X is the number of image pixels; p is the image generation rate; ρ is the tourist target position; Q is the probability distribution; γ is the normalized weight; F is the value of the image signal in the spatial dimension obtained by using the maximum combined value; μ is the effective channel; v is the original output value; Sigmoid is a function; T(ρ) is the predicted position of the next image; F is the model image; ε is the regional dimension; T(ut) is the total area of ​​t tourist targets within the range of u; Based on the image prediction position, the tourist trajectory is predicted. The calculation formula is as follows: In the formula, U(i,j) represents the channel value of tourist i at the jth moment; A(i) is the moving speed of tourist i; I represents the observed data; is the gradient direction of the pixel low point; g is the gradient amplitude; S(i,j) is the trajectory of the i-th tourist at time j; The implementation process of step (5) is as follows: In order to reduce the impact of environmental noise on detection, the coordinate attention mechanism CA is integrated into the YOLO algorithm; the coordinate information embedding module embeds the coordinate information into the feature map with an input length of C, a height of H, and a width of W, and performs pooling in the horizontal and vertical directions to obtain the encoding of each channel. The calculation formula is as follows: In the formula, z h and z w They are represented as aggregated feature tensors of size C×H×1 and C×W×1 respectively; H is the height of the image; W is the width of the image; X is the coordinate information; i and j are random variables that vary within the range; The coordinate attention mechanism embeds the coordinate information into the partial output tensor and performs splicing operations according to the spatial dimension to obtain an intermediate feature map that encodes the horizontal and vertical information; after normalization and nonlinear activation processing, the feature map is divided into two independent vectors, and the corresponding weights are calculated by the following formula: g h =σ(F h (f h ) g w =σ(F w (f w )) In the formula, g h and g w Represents the weights on height and width respectively; h and w represent height and width respectively; f h and f w Respectively represent the two independent vectors that are divided; F h and F w Respectively represent f h and f w Convolution kernel conversion; σ is the sigmoid function; Introduce the hyperparameter θ into the loss function to avoid over-optimization of shape loss and affect the free movement of the prediction box. The formula is as follows: In the formula, SIOU is the loss function; IOU is the original loss function; Ω is the shape loss; w W With w h are the loss of the image in height and width respectively; (w, h) and (w t ,h t ) represent the width and height of the predicted box and the real box respectively; θ is a hyperparameter used to control the degree of attention to shape loss; The genetic algorithm is used to optimize the hyperparameter θ to further improve the free movement of the prediction box affected by over-optimization of the shape loss.

2. A method and system for identifying and warning the behavior of river visitors according to claim 1, characterized in that: The preset time of step (4) is 15 minutes.

3. A device, characterized in that: comprising a memory and a processor, wherein: A memory for storing computer programs that can be run on the processor; A processor is used to execute the steps of a method for identifying and warning the behavior of river visitors as described in any one of claims 1 to 2 when running the computer program.

4. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by at least one processor, implements the steps of a method for identifying and warning the behavior of river visitors as described in any one of claims 1 to 2.