Swimming pool drowning prevention early warning method and system based on binocular vision
Through the anti-drowning warning method of swimming pool based on binocular vision, the CNN neural network and state parameter mapping equations are used to achieve accurate judgment of the personalized drowning risk of swimmers, solving the problem of misjudgment in the existing technology, and improving the anti-drowning warning effectiveness.
Patent Information
- Application Number
- CN202411571354.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing anti-drowning warning methods may lead to misjudgment due to the use of fixed standards to determine the swimmer's movement characteristics, which may increase the risk of drowning accidents.
Using a swimming pool drowning warning method based on binocular vision, the CNN neural network classification model and state parameter mapping equation are constructed by setting multiple types of swimmers' external physiological characteristics and swimming state parameter types. , collect and analyze swimmer status data in real time, and conduct personalized drowning risk judgments.
Through personalized drowning risk determination, the accuracy of drowning risks for swimmers is improved, misjudgment is reduced, and the effectiveness of drowning warning is enhanced.
Smart Images

Figure CN119445767A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of drowning prevention warning, and in particular, relates to a swimming pool drowning prevention warning method and system based on binocular vision. Background Art
[0002] Chinese patent CN102693606B discloses a swimming pool drowning prevention warning method and system based on a camera network, in which a fixed above-water camera and a rotatable underwater camera are respectively installed above and below the water surface of the swimming pool; the signal outputs of the above-water camera and the underwater camera are connected to a PC or a DSP and a PC through various video acquisition cards, and the PC or DSP outputs a control signal to connect an alarm and a stepper motor, and the stepper motor controls the rotation of the pan / tilt.
[0003] Most of the existing drowning prevention warning methods compare the swimmer's swimming posture and swimming-related characteristic data with the swimming posture and swimming-related characteristic data under a fixed normal state to determine whether the swimmer is at risk of drowning; however, different swimmers have different personal habits, which makes their swimming movement characteristics themselves different. If a fixed standard is used to determine whether the movement characteristics of different swimmers pose a drowning risk, it may lead to a misjudgment of whether there is a drowning risk or not, which may lead to drowning accidents. Summary of the invention
[0004] In view of the problems in the related art, the present invention proposes a swimming pool drowning prevention warning method and system based on binocular vision to overcome the above-mentioned technical problems existing in the existing related technology.
[0005] To solve the above technical problems, the present invention is achieved through the following technical solutions:
[0006] The present invention is a swimming pool drowning prevention warning method based on binocular vision, comprising the following steps:
[0007] S1, setting a plurality of characteristic types reflecting the external physiology of the swimmer and the type of state parameters during swimming and collecting the swimmer's state parameter data during swimming at a plurality of historical time points, obtaining a set of the swimmer's physiological characteristic types, a set of the swimmer's state parameter types and a set of historical swimmer's state parameter data matrices; performing clustering processing on the historical swimmer's state parameter data matrix set to obtain a swimmer's normal state parameter data matrix;
[0008] S2, constructing a final CNN neural network classification model and collecting swimmer state parameter data of multiple swimmers in abnormal and normal states and corresponding drowning risk warning level data according to the swimmer state parameter type set and merging them to obtain a merged swimmer state parameter data matrix and a merged level data set;
[0009] S3, constructing a final state parameter mapping equation using the merged level data set and the merged swimmer state parameter data matrix;
[0010] S4, using the final state parameter mapping equation to map the real-time state parameter data of each swimmer in the current swimming pool to obtain a real-time drowning risk warning level data set; using the final CNN neural network classification model according to the swimmer's physiological characteristic type set to collect the physiological characteristic data of each swimmer in the current swimming pool in real time to obtain a real-time swimmer physiological characteristic data matrix;
[0011] S5, determining whether to issue an alarm based on the real-time swimmer's physiological characteristics data matrix, the swimmer's normal state parameter data matrix, and the real-time drowning risk alarm level data set;
[0012] The swimming postures of different people are generally different. Therefore, for different swimmers, in addition to making a general analysis of their swimming postures, it is also necessary to consider the differences between different swimmers, so that it is possible to more accurately judge whether the swimmer is at risk when swimming, and thus issue an accurate alarm. Based on this, in this scheme, multiple feature types reflecting the external physiology of the swimmer and the type of swimming state parameters are set, among which the external physiological feature type can accurately locate each different individual swimmer, and then compare and analyze the individual swimmer separately; and the swimming state parameter type can reflect whether there is an abnormality in its swimming posture, and then determine whether an alarm is needed; by collecting the physiological feature data of multiple swimmers and the swimmer state parameters when swimming at multiple historical time points The data provided by the algorithm provide data support for the subsequent analysis of the state parameter data of each swimmer with different physiological characteristics under normal conditions, and further provide a basis for individual determination of whether there is a drowning risk in the current swimming pool; by collecting the swimmer state parameter data of multiple swimmers in abnormal and normal states and the corresponding drowning risk warning level data according to the swimmer state parameter type set and merging them, data support is provided for the subsequent construction of the final state parameter mapping equation; by constructing the final state parameter mapping equation, a mapping tool is provided for the subsequent acquisition of the real-time drowning risk warning level data of each swimmer in the current swimming pool; by constructing the final CNN neural network classification model, a model is provided for the subsequent acquisition of the physiological characteristic data of each swimmer in the current swimming pool.
[0013] Preferably, the S1 comprises the following steps:
[0014] S11, set a plurality of characteristic types reflecting the external physiology of the swimmer, and obtain the physiological characteristic type set a of the swimmer = {a1, a2, ..., a i ,...,a a′}, a irepresents the set physiological characteristic type of the i-th swimmer, a′ represents the total number of the set physiological characteristic types of the swimmers; and then multiple swimmers' state parameter types are set when swimming to obtain the swimmer state parameter type set Indicates the type of the i-th swimming state parameter set. Indicates the total number of the set swimming status parameter types;
[0015] According to the swimmer's physiological characteristic type set a={a1, a2, ..., a i ,...,a a′} and the swimmer status parameter type set Build a swimming database;
[0016] S12, according to the swimmer's physiological characteristic type set a={a1, a2, ..., a i ,...,a a′} and the swimmer status parameter type set Collect the physiological characteristic data of multiple swimmers and use binocular camera equipment to collect the state parameter data of swimmers when swimming at multiple historical time points, and obtain the historical swimmer physiological characteristic data matrix b1 and the historical swimmer state parameter data matrix set b2 = {b 21 ,b 22 ,...,b 2i ,...,b 2b′}, b 2i b1 and b2 represent the data matrix of the swimmer's state parameter collected at the i-th historical time point, respectively; b′ represents the total number of historical time points corresponding to the collected data matrix of the swimmer's state parameter; b1, b 2i They are as follows:
[0017]
[0018] Among them, b 1jk , b 2ijk Represents the k-th type of physiological characteristic data of the j-th swimmer in b1 and b 2i The state parameter data of the kth type of the jth swimmer in, Indicates the total number of swimmers corresponding to the collected data;
[0019] S13, filling the swimming database with data;
[0020] The swimmer's physiological characteristic type set includes height, weight, body shape, arms, eye color, eye shape, size, spacing, skin color and hairstyle; the swimmer's state parameter type set includes the swimmer's speed, trajectory, behavioral characteristics, etc.; by collecting the swimmer's state parameter data when swimming at multiple historical time points, the collected swimmer's state parameter data is made more comprehensive and accurate; by building a swimming database, the acquired swimmer's state parameter data is stored for subsequent call.
[0021] Preferably, the S13 comprises the following steps:
[0022] S131, clustering the state parameter data of each swimmer in the historical swimmer state parameter data matrix according to the time point to obtain the historical swimmer state parameter classification center data set matrix as follows,
[0023]
[0024] in, represents the jth swimmer state parameter classification center data set obtained by clustering the swimmer state parameter data of the i-th swimmer according to the time point, c represents the total number of swimmer state parameter data classification matrices obtained by clustering the swimmer state parameter data sets of each swimmer according to the time point; express The k-th type of swimmer status parameter data;
[0025] S132: classify the historical swimmer status parameter central data set matrix The classification center data set with the largest number of corresponding swimmer state parameter data sets for each swimmer in is used as the swimmer's normal state parameter data set, and the swimmer's normal state parameter data matrix c' is obtained; as follows,
[0026]
[0027] Among them, c i ' j represents the j-th type of swimmer state parameter data under the normal condition of the i-th swimmer;
[0028] S133, storing the swimmer's normal state parameter data matrix c' and the historical swimmer's physiological characteristic data matrix b1 into a swimming database;
[0029] Through clustering, similar state parameters of each swimmer are aggregated into one category, among which the state parameter data center corresponding to the category with the largest amount of data can represent the normal state parameter data of the swimmer; it provides a comparative basis for the subsequent specificity analysis of the state parameter data of the swimmers in the current swimming pool.
[0030] Preferably, the S131 includes the following steps:
[0031] S1311, build the first pigeon population represents the i-th pigeon in the first pigeon population, represents the size of the first pigeon population; the maximum number of iterations of the first pigeon population is set to d1, and the current number of iterations is set to d2, which are respectively recorded as the first maximum number of iterations and the first current number of iterations; the search space dimension of the first pigeon population is
[0032] S1312, randomly selecting a number of swimmer state parameter data sets from the swimmer state parameter data of each swimmer at each time point in the historical swimmer state parameter data matrix set as the initial position of each pigeon in the first pigeon population, and obtaining an initial position matrix set d i ' represents the initial position matrix of the i-th pigeon in the first pigeon population; as follows,
[0033]
[0034] in, represents the position component set of the kth swimmer state parameter classification center data set dimension of the i-th pigeon in the first pigeon population; express The position component in the dimension of the k′th type of swimmer state parameter data;
[0035] S1313, using the initial position matrix set d′={d1′, d2′, ..., d i ′,...,d c ' ~1 The initial position matrix of each pigeon in} classifies the historical swimmer state parameter data matrix set and calculates the Euclidean distance sum data of the historical swimmer state parameter data corresponding to each swimmer to obtain the Euclidean distance sum data set Represents the Euclidean distance sum data of the historical swimmer state parameter data corresponding to the i-th swimmer in the historical swimmer state parameter data matrix set;
[0036] According to the Euclidean distance sum dataset Construct the fitness function of the first pigeon population as follows,
[0037]
[0038] S1314, start iteration, set the first current iteration number d2 to 1 before iteration; use the fitness function of the first pigeon population in the first round of iteration Calculate the fitness value corresponding to each initial position matrix in the initial position matrix set to obtain a first fitness value set; use the maximum fitness value and the corresponding initial position matrix in the first fitness value set as the first global optimal fitness and the first global optimal position respectively; update the initial position matrix of each pigeon in the initial position matrix set according to the first global optimal fitness and the first global optimal position; after the update is completed, add 1 to the first current iteration number d2 and enter the next round of iteration;
[0039] In each other iteration, the fitness function of the first pigeon population is used Calculate the fitness value of the position matrix of each pigeon updated in the previous round of iterations to obtain a second fitness value set; use the maximum fitness value and the corresponding position matrix in the second fitness value set as the second global optimal fitness and the second global optimal position respectively; update the position matrix of each pigeon updated in the previous round of iterations according to the second global optimal fitness and the second global optimal position; after the update is completed, add 1 to the first current iteration number d2 and enter the next round of iterations;
[0040] S1315, when d2≥d1, stop iteration and obtain the first final global best position; use the first final global best position as the historical swimmer state parameter classification center data set matrix Otherwise, continue to iterate until d2≥d1;
[0041] The pigeon swarm optimization algorithm can quickly explore the search space and find better solutions. It has strong self-adjustment and evolution capabilities, continuously optimizes the quality of the solution during the search process, and can effectively find the global optimal solution or the approximate optimal solution. Based on the above, this scheme uses the pigeon swarm optimization algorithm to cluster the state parameter data of each swimmer in the historical swimmer state parameter data matrix set according to the time point, and takes the sum of the overall Euclidean distance of the historical swimmer state parameter data matrix set as the fitness function. Therefore, as the iteration proceeds, the overall discrete degree of the historical swimmer state parameter data matrix set becomes lower and lower, indicating that the classification center data of each classification obtained is more accurate.
[0042] Preferably, S2 comprises the following steps:
[0043] S21, collecting image data of multiple swimmers while swimming and collecting corresponding physiological characteristic data of the swimmers according to the physiological characteristic type set of the swimmers, to obtain a swimmer image data set e1 = {e 11 ,e 12,...,e 1i ,...,e 1e′} and the physiological characteristic data matrix e2, e 1i represents the image data collected of the i-th swimmer while swimming, e′ represents the total number of swimmers collected; e2 is as follows,
[0044]
[0045] Among them, e 2ij represents the jth type of physiological characteristic data collected from the i-th swimmer while swimming;
[0046] S22, constructing an initial CNN neural network classification model; using the swimmer image dataset
[0047] e1={e 11 ,e 12 ,...,e 1i ,...,e 1e′} and the to-be-used swimmer physiological characteristic data matrix e2 to train and test the initial CNN neural network classification model to obtain the final CNN neural network classification model;
[0048] S23. Set drowning risk warning level set They represent the common warning level, emergency warning level, fatal warning level and normal level respectively;
[0049] According to the swimmer state parameter type set and the drowning risk warning level set, swimmer state parameter data of multiple swimmers before multiple drowning accidents occurred in the past, swimmer state parameter data of multiple swimmers in normal state and corresponding drowning risk warning level data are collected to obtain a first standby swimmer state parameter data matrix and corresponding drowning risk warning level data set, a second standby swimmer state parameter data matrix and corresponding normal level data set;
[0050] The first standby swimmer state parameter data matrix and the second standby swimmer state parameter data matrix are merged, and the drowning risk warning level data set and the normal level data set are merged to obtain a merged swimmer state parameter data matrix e3 and a merged level data set. e 4i Represents the i-th level data after merging, Indicates the total amount of level data collected; e3 is as follows,
[0051]
[0052] Among them, e 3ijrepresents the j-th type of swimmer state parameter data in the i-th group of swimmer state parameter data sets after merging;
[0053] By collecting image data of multiple swimmers while swimming and the corresponding physiological characteristic data of the swimmers, data support is provided for the subsequent construction of the final CNN neural network classification model. It provides the setting of multiple drowning risk alarm levels and the collection of corresponding state parameter data, including normal levels and levels with drowning risk, so that the collected state parameter data is more comprehensive, and the final state parameter mapping equation subsequently constructed based on this data is more adaptable.
[0054] Preferably, the S22 comprises the following steps:
[0055] S221, constructing an initial CNN neural network classification model and setting a training data ratio; dividing the swimmer image data set and the to-be-used swimmer physiological characteristic data matrix according to the training data ratio to obtain a swimmer image training data set, a to-be-used swimmer physiological characteristic training data matrix, a swimmer image test data set, and a to-be-used swimmer physiological characteristic test data matrix;
[0056] S222, setting a training error threshold; inputting the swimmer image training data set and the to-be-used swimmer physiological feature training data matrix into the initial CNN neural network classification model for training; during the training process, when the training error is less than the training error threshold, stopping the training to obtain a trained CNN neural network classification model; otherwise, continuing the training until the training error is less than the training error threshold;
[0057] S223, setting a test accuracy threshold; inputting the swimmer image test data set and the to-be-used swimmer physiological characteristic test data matrix into the trained CNN neural network classification model for testing; after the test is completed, obtaining the test accuracy; when the test accuracy is greater than or equal to the test accuracy threshold, using the trained CNN neural network classification model as the final CNN neural network classification model; otherwise, returning to S222 to continue training the trained CNN neural network classification model until the test accuracy is greater than or equal to the test accuracy threshold;
[0058] By training and testing the initial CNN neural network classification model using the swimmer image training data set, the swimmer physiological characteristics training data matrix to be used, the swimmer image test data set, and the swimmer physiological characteristics test data matrix to be used, the final CNN neural network classification model has better classification ability for swimmer image data.
[0059] Preferably, S3 comprises the following steps:
[0060] S31, construct the initial state parameter mapping equation; as follows,
[0061]
[0062] Where, f is the dependent variable, indicating the drowning risk warning level data; f2′ i is the ith independent variable, representing the state parameter data of the ith type of swimmer; f1′ i f2′ i The undetermined coefficient of Represents the bias; cell represents the rounding function;
[0063] S32, substituting the merged swimmer state parameter data matrix into the initial state parameter mapping equation for mapping, to obtain a mapping data set e 5i represents the i-th drowning risk warning level data obtained by mapping;
[0064] Setting a risk warning level error threshold; when the absolute value of the difference between the drowning risk warning level data present in the mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, optimizing the initial state parameter mapping equation until the absolute value of the difference between the drowning risk warning level data present in the mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, obtaining a final state parameter mapping equation; otherwise, there is no need to optimize the initial state parameter mapping equation, and the initial state parameter mapping equation is used as the final state parameter mapping equation;
[0065] By constructing the final state parameter mapping equation, a mapping tool is provided for the subsequent acquisition of real-time drowning risk warning level data for each swimmer in the current swimming pool.
[0066] Preferably, optimizing the initial state parameter mapping equation in S32 includes the following steps:
[0067] S321. Constructing the second pigeon population represents the i-th pigeon in the second pigeon population, represents the size of the second pigeon population; the maximum number of iterations of the second pigeon population is set to d3, and the current number of iterations is set to d4, which are recorded as the second maximum number of iterations and the second current number of iterations respectively; the search space dimension of the second pigeon population is
[0068] S322, setting the value interval of each undetermined coefficient and bias in the initial state parameter mapping equation to obtain a set of value intervals of the undetermined coefficients And the bias value range respectively represent the lower limit and upper limit of the bias value in the initial state parameter mapping equation; as follows,
[0069]
[0070] in, respectively represent the lower limit and upper limit of the value of the i-th undetermined coefficient in the initial state parameter mapping equation;
[0071] The initial position of each pigeon in the second pigeon population is set according to the undetermined coefficient value interval set and the bias value interval to obtain the first initial position matrix g; as follows,
[0072]
[0073] Among them, g ij represents the component of the initial position of the i-th pigeon in the second pigeon population in the j-th search space dimension; g ij , The calculation formulas are as follows:
[0074]
[0075]
[0076] In the formula, rand ij , Respectively for g ij , Generate a random number between 0 and 1;
[0077] S323, constructing a fitness function of the second pigeon population according to the mapping data set and the merged level data set as follows,
[0078]
[0079] In the formula, β is a positive number, indicating the correction parameter;
[0080] S324, start iteration, before iteration, set the second current iteration number d4 to 1; in the first round of iteration, use the fitness function of the second pigeon population Calculate the fitness value corresponding to each initial position in the first initial position matrix to obtain a third fitness value set; use the maximum fitness value in the third fitness value set and the corresponding initial position matrix as the third global optimal fitness and the third global optimal position respectively; update the initial position of each pigeon in the first initial position matrix according to the third global optimal fitness and the third global optimal position; after the update is completed, add 1 to the second current iteration number d4 and enter the next round of iteration;
[0081] The fitness function of the second pigeon population is used in each other iteration process Calculate the fitness value of the position of each pigeon updated in the previous round of iteration to obtain a fourth fitness value set; use the maximum fitness value and the corresponding position matrix in the fourth fitness value set as the fourth global optimal fitness and the fourth global optimal position respectively; update the position of each pigeon updated in the previous round of iteration again according to the fourth global optimal fitness and the fourth global optimal position; after the update is completed, add 1 to the second current iteration number d4 and enter the next round of iteration;
[0082] S325, when d4≥d3, stop iteration and obtain the second final global optimal position; otherwise, continue iteration until d2≥d1;
[0083] Substituting the second final global optimal position into the initial state parameter mapping equation to obtain the adjusted state parameter mapping equation; substituting the merged swimmer state parameter data matrix into the adjusted state parameter mapping equation for mapping to obtain an adjusted mapping data set; when the absolute value of the difference between the drowning risk warning level data that does not exist in the adjusted mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, using the adjusted state parameter mapping equation as the final state parameter mapping equation; otherwise, returning to S324 to continue iterating until the absolute value of the difference between the drowning risk warning level data that does not exist in the adjusted mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold;
[0084] By using the pigeon flock optimization algorithm to perform multiple iterative optimizations on each independent variable coefficient and the bias machine of the initial state parameter mapping equation, the error between the drowning risk warning level mapped by the initial state parameter mapping equation and the actual drowning risk warning level is used as the fitness function. Therefore, as the iteration proceeds, the mapping of the initial state parameter mapping equation becomes more and more accurate.
[0085] Preferably, S4 comprises the following steps:
[0086] S41, according to the swimmer state parameter type set, the state parameter data of each swimmer in the current swimming pool is collected in real time to obtain a real-time state parameter data matrix g1′; then according to the swimmer physiological characteristic type set and using the final CNN neural network classification model, the physiological characteristic data of each swimmer in the current swimming pool is obtained in real time to obtain a real-time swimmer physiological characteristic data matrix g′2; g1′ and g′2 are respectively as follows,
[0087]
[0088] Among them, g1′ ij , g′ 2ij represents the j-th type of real-time status parameter data and real-time physiological characteristic data of the i-th swimmer in the current swimming pool, Indicates the total number of swimmers in the current pool;
[0089] S42, inputting the state parameter data of each swimmer in the real-time state parameter data matrix into the final state parameter mapping equation for mapping, and obtaining a real-time drowning risk warning level data set represents the real-time drowning risk warning level data of the i-th swimmer in the current swimming pool;
[0090] By acquiring the physiological characteristic data of each swimmer in the current swimming pool in real time, data support is provided for subsequent comparison with the physiological characteristic data in the swimming database; by mapping the status parameter data of each swimmer, the corresponding real-time drowning risk alarm level data is obtained, which provides a basis for subsequent determination of whether a drowning alarm is needed.
[0091] Preferably, the S5 comprises the following steps:
[0092] S51, setting a physiological characteristic similarity threshold; when the real-time drowning risk warning level data set contains real-time drowning risk warning level data of one of the ordinary warning level, the emergency warning level and the fatal warning level, calculating the similarity between the physiological characteristic data of the corresponding swimmer in the real-time swimmer physiological characteristic data matrix and the physiological characteristic data of each historical swimmer in the swimming database to obtain the physiological characteristic similarity;
[0093] S52, setting a state parameter similarity threshold; when the physiological characteristic similarity is greater than or equal to the physiological characteristic similarity threshold, performing similarity calculation on the swimmer's normal state parameter data corresponding to the historical swimmer's physiological characteristic data in the swimming database and the swimmer's real-time state parameter data to obtain the state parameter similarity; when the state parameter similarity is greater than or equal to the state parameter similarity threshold, no alarm is required; otherwise, an alarm is issued;
[0094] When a swimmer is judged to be at risk of drowning through his real-time drowning risk alarm level data, the swimmer's physiological characteristic data is matched with the physiological characteristic data in the swimming database for similarity, and then the corresponding normal state parameter data is compared with the state parameter data collected in real time. If they are similar, it indicates that there is no abnormality in the current swimmer's state parameter data compared with his previous state parameter data during swimming, and no alarm is needed. Otherwise, an alarm is required.
[0095] A binocular vision-based swimming pool drowning prevention warning system includes a physiological characteristic type setting module, a state parameter type setting module, a swimmer data acquisition and processing module, a clustering processing module, a classification model construction module, a historical data acquisition module, a state parameter mapping equation construction module, a mapping module, a real-time physiological characteristic data acquisition module and a judgment alarm module.
[0096] The present invention has the following beneficial effects:
[0097] 1. In the present invention, when the swimmer is judged to be at risk of drowning by the real-time drowning risk warning level data of the swimmer, the physiological characteristic data of the swimmer is matched with the physiological characteristic data in the swimming database for similarity, and then the corresponding normal state parameter data is compared with the state parameter data collected in real time. If they are similar, the current state parameter data of the swimmer is not abnormal compared with the state parameter data of the swimmer during previous swimming, and no alarm is needed. Otherwise, an alarm is needed. Through the double comparison, the final judgment result is made more accurate, and accurate alarm can be given.
[0098] 2. In the present invention, by collecting swimmer state parameter data of multiple swimmers in abnormal and normal states and corresponding drowning risk warning level data according to the swimmer state parameter type set and merging them, data support is provided for the subsequent construction of the final state parameter mapping equation; by constructing the final state parameter mapping equation, a mapping tool is provided for the subsequent acquisition of the real-time drowning risk warning level data of each swimmer in the current swimming pool; by constructing the final CNN neural network classification model, a model is provided for the subsequent acquisition of the physiological characteristic data of each swimmer in the current swimming pool.
[0099] 3. In the present invention, each independent variable coefficient and bias of the initial state parameter mapping equation are iteratively optimized multiple times by using the pigeon flock optimization algorithm, and the error between the drowning risk warning level mapped by the initial state parameter mapping equation and the actual drowning risk warning level is used as the fitness function, so that the mapping of the initial state parameter mapping equation becomes more and more accurate.
[0100] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0102] Figure 1 The present invention is a flow chart of a binocular vision-based swimming pool drowning prevention and early warning method. DETAILED DESCRIPTION
[0103] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.
[0104] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0105] Embodiment 1
[0106] This embodiment is a swimming pool drowning prevention warning method based on binocular vision, comprising the following steps:
[0107] S1, setting a plurality of characteristic types reflecting the external physiology of the swimmer and the type of state parameters during swimming and collecting the swimmer's state parameter data during swimming at a plurality of historical time points, obtaining a set of the swimmer's physiological characteristic types, a set of the swimmer's state parameter types and a set of historical swimmer's state parameter data matrices; performing clustering processing on the historical swimmer's state parameter data matrix set to obtain a swimmer's normal state parameter data matrix;
[0108] The S1 comprises the following steps:
[0109] S11, set a plurality of characteristic types reflecting the external physiology of the swimmer, and obtain the physiological characteristic type set a of the swimmer = {a1, a2, ..., a i ,...,a a′}, a i represents the set physiological characteristic type of the i-th swimmer, a′ represents the total number of the set physiological characteristic types of the swimmers; and then multiple swimmers' state parameter types are set when swimming to obtain the swimmer state parameter type set Indicates the type of the i-th swimming state parameter set. Indicates the total number of the set swimming status parameter types;
[0110] According to the swimmer's physiological characteristic type set a={a1, a2, ..., a i ,...,a a′} and the swimmer status parameter type set Build a swimming database;
[0111] S12, according to the swimmer's physiological characteristic type set a={a1, a2, ..., a i ,...,a a′} and the swimmer status parameter type set Collect the physiological characteristic data of multiple swimmers and use binocular camera equipment to collect the state parameter data of swimmers when swimming at multiple historical time points, and obtain the historical swimmer physiological characteristic data matrix b1 and the historical swimmer state parameter data matrix set b2 = {b 21 ,b 22 ,...,b 2i ,...,b 2b′}, b 2i b1 and b2 represent the data matrix of the swimmer's state parameter collected at the i-th historical time point, respectively; b′ represents the total number of historical time points corresponding to the collected data matrix of the swimmer's state parameter; b1, b 2i They are as follows:
[0112]
[0113] Among them, b 1jk , b 2ijk Represents the k-th type of physiological characteristic data of the j-th swimmer in b1 and b 2i The state parameter data of the kth type of the jth swimmer in, Indicates the total number of swimmers corresponding to the collected data;
[0114] S13, filling the swimming database with data;
[0115] The S13 comprises the following steps:
[0116] S131, clustering the state parameter data of each swimmer in the historical swimmer state parameter data matrix according to the time point to obtain the historical swimmer state parameter classification center data set matrix as follows,
[0117]
[0118] in, represents the jth swimmer state parameter classification center data set obtained by clustering the swimmer state parameter data of the i-th swimmer according to the time point, c represents the total number of swimmer state parameter data classification matrices obtained by clustering the swimmer state parameter data sets of each swimmer according to the time point; express The k-th type of swimmer status parameter data;
[0119] The S131 includes the following steps:
[0120] S1311, build the first pigeon population represents the i-th pigeon in the first pigeon population, represents the size of the first pigeon population; the maximum number of iterations of the first pigeon population is set to d1, and the current number of iterations is set to d2, which are respectively recorded as the first maximum number of iterations and the first current number of iterations; the search space dimension of the first pigeon population is
[0121] S1312, randomly selecting a number of swimmer state parameter data sets from the swimmer state parameter data of each swimmer at each time point in the historical swimmer state parameter data matrix set as the initial position of each pigeon in the first pigeon population, and obtaining an initial position matrix set d i ' represents the initial position matrix of the i-th pigeon in the first pigeon population; as follows,
[0122]
[0123] in, represents the position component set of the kth swimmer state parameter classification center data set dimension of the i-th pigeon in the first pigeon population; express The position component in the dimension of the k′th type of swimmer state parameter data;
[0124] S1313, using the initial position matrix set The initial position matrix of each pigeon in the data matrix classifies the historical swimmer state parameter data matrix set and calculates the Euclidean distance sum data of the historical swimmer state parameter data corresponding to each swimmer to obtain the Euclidean distance sum data set Represents the Euclidean distance sum data of the historical swimmer state parameter data corresponding to the i-th swimmer in the historical swimmer state parameter data matrix set;
[0125] According to the Euclidean distance sum dataset Construct the fitness function of the first pigeon population as follows,
[0126]
[0127] S1314, start iteration, set the first current iteration number d2 to 1 before iteration; use the fitness function of the first pigeon population in the first round of iteration Calculate the fitness value corresponding to each initial position matrix in the initial position matrix set to obtain a first fitness value set; use the maximum fitness value and the corresponding initial position matrix in the first fitness value set as the first global optimal fitness and the first global optimal position respectively; update the initial position matrix of each pigeon in the initial position matrix set according to the first global optimal fitness and the first global optimal position; after the update is completed, add 1 to the first current iteration number d2 and enter the next round of iteration;
[0128] In each other iteration, the fitness function of the first pigeon population is used Calculate the fitness value of the position matrix of each pigeon updated in the previous round of iterations to obtain a second fitness value set; use the maximum fitness value and the corresponding position matrix in the second fitness value set as the second global optimal fitness and the second global optimal position respectively; update the position matrix of each pigeon updated in the previous round of iterations according to the second global optimal fitness and the second global optimal position; after the update is completed, add 1 to the first current iteration number d2 and enter the next round of iterations;
[0129] S1315, when d2≥d1, stop iteration and obtain the first final global best position; use the first final global best position as the historical swimmer state parameter classification center data set matrix Otherwise, continue to iterate until d2≥d1;
[0130] S132: classify the historical swimmer status parameter central data set matrix The classification center data set with the largest number of corresponding swimmer state parameter data sets for each swimmer in is used as the swimmer's normal state parameter data set, and the swimmer's normal state parameter data matrix c' is obtained; as follows,
[0131]
[0132] Among them, c i ' j represents the j-th type of swimmer state parameter data under the normal condition of the i-th swimmer;
[0133] S133, storing the swimmer's normal state parameter data matrix c' and the historical swimmer's physiological characteristic data matrix b1 into a swimming database;
[0134] S2, constructing a final CNN neural network classification model and collecting swimmer state parameter data of multiple swimmers in abnormal and normal states and corresponding drowning risk warning level data according to the swimmer state parameter type set and merging them to obtain a merged swimmer state parameter data matrix and a merged level data set;
[0135] The S2 comprises the following steps:
[0136] S21, collecting image data of multiple swimmers while swimming and collecting corresponding physiological characteristic data of the swimmers according to the physiological characteristic type set of the swimmers, to obtain a swimmer image data set e1 = {e 11 ,e 12 ,...,e 1i ,...,e 1e′} and the physiological characteristic data matrix e2, e 1i represents the image data collected of the i-th swimmer while swimming, e′ represents the total number of swimmers collected; e2 is as follows,
[0137]
[0138] Among them, e 2ij represents the jth type of physiological characteristic data collected from the i-th swimmer while swimming;
[0139] S22, constructing an initial CNN neural network classification model; using the swimmer image dataset
[0140] e1={e 11 ,e 12 ,...,e 1i ,...,e 1e′} and the to-be-used swimmer physiological characteristic data matrix e2 to train and test the initial CNN neural network classification model to obtain the final CNN neural network classification model;
[0141] The S22 comprises the following steps:
[0142] S221, constructing an initial CNN neural network classification model and setting a training data ratio; dividing the swimmer image data set and the to-be-used swimmer physiological characteristic data matrix according to the training data ratio to obtain a swimmer image training data set, a to-be-used swimmer physiological characteristic training data matrix, a swimmer image test data set, and a to-be-used swimmer physiological characteristic test data matrix;
[0143] S222, setting a training error threshold; inputting the swimmer image training data set and the to-be-used swimmer physiological feature training data matrix into the initial CNN neural network classification model for training; during the training process, when the training error is less than the training error threshold, stopping the training to obtain a trained CNN neural network classification model; otherwise, continuing the training until the training error is less than the training error threshold;
[0144] S223, setting a test accuracy threshold; inputting the swimmer image test data set and the to-be-used swimmer physiological characteristic test data matrix into the trained CNN neural network classification model for testing; after the test is completed, obtaining the test accuracy; when the test accuracy is greater than or equal to the test accuracy threshold, using the trained CNN neural network classification model as the final CNN neural network classification model; otherwise, returning to S222 to continue training the trained CNN neural network classification model until the test accuracy is greater than or equal to the test accuracy threshold;
[0145] S23. Set drowning risk warning level set They represent the common warning level, emergency warning level, fatal warning level and normal level respectively;
[0146] According to the swimmer state parameter type set and the drowning risk warning level set, swimmer state parameter data of multiple swimmers before multiple drowning accidents occurred in the past, swimmer state parameter data of multiple swimmers in normal state and corresponding drowning risk warning level data are collected to obtain a first standby swimmer state parameter data matrix and corresponding drowning risk warning level data set, a second standby swimmer state parameter data matrix and corresponding normal level data set;
[0147] The first standby swimmer state parameter data matrix and the second standby swimmer state parameter data matrix are merged, and the drowning risk warning level data set and the normal level data set are merged to obtain a merged swimmer state parameter data matrix e3 and a merged level data set. e 4i Represents the i-th level data after merging, Indicates the total amount of level data collected; e3 is as follows,
[0148]
[0149] Among them, e 3ij represents the j-th type of swimmer state parameter data in the i-th group of swimmer state parameter data sets after merging;
[0150] S3, constructing a final state parameter mapping equation using the merged level data set and the merged swimmer state parameter data matrix;
[0151] The S3 comprises the following steps:
[0152] S31, construct the initial state parameter mapping equation; as follows,
[0153]
[0154] Where, f is the dependent variable, indicating the drowning risk warning level data; f2′ i is the ith independent variable, representing the state parameter data of the ith type of swimmer; f1′ i f2′ i The undetermined coefficient of Represents the bias; cell represents the rounding function;
[0155] S32, substituting the merged swimmer state parameter data matrix into the initial state parameter mapping equation for mapping, and obtaining a mapping data set e5={e 51 ,e 52 ,...,e 5i ,...,e 5e~},e 5i represents the i-th drowning risk warning level data obtained by mapping;
[0156] Setting a risk warning level error threshold; when the absolute value of the difference between the drowning risk warning level data present in the mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, optimizing the initial state parameter mapping equation until the absolute value of the difference between the drowning risk warning level data present in the mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, obtaining a final state parameter mapping equation; otherwise, there is no need to optimize the initial state parameter mapping equation, and the initial state parameter mapping equation is used as the final state parameter mapping equation;
[0157] Optimizing the initial state parameter mapping equation in S32 includes the following steps:
[0158] S321. Constructing the second pigeon population represents the i-th pigeon in the second pigeon population, represents the size of the second pigeon population; the maximum number of iterations of the second pigeon population is set to d3, and the current number of iterations is set to d4, which are recorded as the second maximum number of iterations and the second current number of iterations respectively; the search space dimension of the second pigeon population is
[0159] S322, setting the value interval of each undetermined coefficient and bias in the initial state parameter mapping equation to obtain a set of value intervals of the undetermined coefficients And the bias value range respectively represent the lower limit and upper limit of the bias value in the initial state parameter mapping equation; as follows,
[0160]
[0161] in, respectively represent the lower limit and upper limit of the value of the i-th undetermined coefficient in the initial state parameter mapping equation;
[0162] The initial position of each pigeon in the second pigeon population is set according to the undetermined coefficient value interval set and the bias value interval to obtain the first initial position matrix g; as follows,
[0163]
[0164] Among them, g ij represents the component of the initial position of the i-th pigeon in the second pigeon population in the j-th search space dimension; g ij , The calculation formulas are as follows:
[0165]
[0166] In the formula, rand ij , Respectively for g ij , Generate a random number between 0 and 1;
[0167] S323, constructing a fitness function of the second pigeon population according to the mapping data set and the merged level data set as follows,
[0168]
[0169] In the formula, β is a positive number, indicating the correction parameter;
[0170] S324, start iteration, before iteration, set the second current iteration number d4 to 1; in the first round of iteration, use the fitness function of the second pigeon population Calculate the fitness value corresponding to each initial position in the first initial position matrix to obtain a third fitness value set; use the maximum fitness value in the third fitness value set and the corresponding initial position matrix as the third global optimal fitness and the third global optimal position respectively; update the initial position of each pigeon in the first initial position matrix according to the third global optimal fitness and the third global optimal position; after the update is completed, add 1 to the second current iteration number d4 and enter the next round of iteration;
[0171] The fitness function of the second pigeon population is used in each other iteration process Calculate the fitness value of the position of each pigeon updated in the previous round of iteration to obtain a fourth fitness value set; use the maximum fitness value and the corresponding position matrix in the fourth fitness value set as the fourth global optimal fitness and the fourth global optimal position respectively; update the position of each pigeon updated in the previous round of iteration again according to the fourth global optimal fitness and the fourth global optimal position; after the update is completed, add 1 to the second current iteration number d4 and enter the next round of iteration;
[0172] S325, when d4≥d3, stop iteration and obtain the second final global optimal position; otherwise, continue iteration until d2≥d1;
[0173] Substituting the second final global optimal position into the initial state parameter mapping equation to obtain the adjusted state parameter mapping equation; substituting the merged swimmer state parameter data matrix into the adjusted state parameter mapping equation for mapping to obtain an adjusted mapping data set; when the absolute value of the difference between the drowning risk warning level data that does not exist in the adjusted mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, using the adjusted state parameter mapping equation as the final state parameter mapping equation; otherwise, returning to S324 to continue iterating until the absolute value of the difference between the drowning risk warning level data that does not exist in the adjusted mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold;
[0174] S4, using the final state parameter mapping equation to map the real-time state parameter data of each swimmer in the current swimming pool to obtain a real-time drowning risk warning level data set; using the final CNN neural network classification model according to the swimmer's physiological characteristic type set to collect the physiological characteristic data of each swimmer in the current swimming pool in real time to obtain a real-time swimmer physiological characteristic data matrix;
[0175] The S4 comprises the following steps:
[0176] S41, according to the swimmer state parameter type set, the state parameter data of each swimmer in the current swimming pool is collected in real time to obtain a real-time state parameter data matrix g1′; then according to the swimmer physiological characteristic type set and using the final CNN neural network classification model, the physiological characteristic data of each swimmer in the current swimming pool is obtained in real time to obtain a real-time swimmer physiological characteristic data matrix g′2; g1′ and g′2 are respectively as follows,
[0177]
[0178] Among them, g1′ ij , g′ 2ij represents the j-th type of real-time status parameter data and real-time physiological characteristic data of the i-th swimmer in the current swimming pool, Indicates the total number of swimmers in the current pool;
[0179] S42, inputting the state parameter data of each swimmer in the real-time state parameter data matrix into the final state parameter mapping equation for mapping, and obtaining a real-time drowning risk warning level data set represents the real-time drowning risk warning level data of the i-th swimmer in the current swimming pool;
[0180] S5, determining whether to issue an alarm based on the real-time swimmer's physiological characteristics data matrix, the swimmer's normal state parameter data matrix, and the real-time drowning risk alarm level data set;
[0181] The S5 comprises the following steps:
[0182] S51, setting a physiological characteristic similarity threshold; when the real-time drowning risk warning level data set contains real-time drowning risk warning level data of one of the ordinary warning level, the emergency warning level and the fatal warning level, calculating the similarity between the physiological characteristic data of the corresponding swimmer in the real-time swimmer physiological characteristic data matrix and the physiological characteristic data of each historical swimmer in the swimming database to obtain the physiological characteristic similarity;
[0183] S52, setting a state parameter similarity threshold; when the physiological characteristic similarity is greater than or equal to the physiological characteristic similarity threshold, performing similarity calculation on the swimmer's normal state parameter data corresponding to the historical swimmer's physiological characteristic data in the swimming database and the swimmer's real-time state parameter data to obtain the state parameter similarity; when the state parameter similarity is greater than or equal to the state parameter similarity threshold, no alarm is required; otherwise, an alarm is issued.
[0184] Embodiment 2
[0185] This embodiment discloses a swimming pool drowning prevention warning system based on binocular vision, which can implement the method of the above embodiment, including a physiological characteristic type setting module, a state parameter type setting module, a swimmer data collection and processing module, a clustering processing module, a classification model construction module, a historical data collection module, a state parameter mapping equation construction module, a mapping module, a real-time physiological characteristic data collection module and a judgment and alarm module;
[0186] The physiological characteristic type setting module is used to set a plurality of characteristic types reflecting the external physiology of the swimmer to obtain a set of physiological characteristic types of the swimmer;
[0187] The state parameter type setting module is used to set the state parameter types of multiple swimmers when they are swimming, and obtain a set of swimmer state parameter types;
[0188] The swimmer data collection and processing module is used to collect swimmer physiological characteristic data of multiple swimmers and swimmer state parameter data of multiple swimmers when swimming at multiple historical time points according to the swimmer physiological characteristic type set and the swimmer state parameter type set, and obtain a historical swimmer physiological characteristic data matrix and a historical swimmer state parameter data matrix set;
[0189] The cluster processing module is used to perform cluster processing on the historical swimmer state parameter data matrix set to obtain the swimmer normal state parameter data matrix;
[0190] The classification model building module is used to use the image data of multiple swimmers while swimming and the corresponding physiological characteristic data of the swimmers to build a final CNN neural network classification model;
[0191] The historical data collection module is used to collect swimmer state parameter data of multiple swimmers before multiple drowning accidents occurred in the past, swimmer state parameter data of multiple swimmers in normal state, and corresponding drowning risk warning level data according to the swimmer state parameter type set, and merge them to obtain a merged swimmer state parameter data matrix and a merged level data set;
[0192] The state parameter mapping equation construction module is used to construct a final state parameter mapping equation using the merged level data set and the merged swimmer state parameter data matrix;
[0193] The mapping module is used to map the real-time state parameter data of each swimmer in the current swimming pool using the final state parameter mapping equation to obtain a real-time drowning risk warning level data set;
[0194] The real-time physiological characteristic data acquisition module is used to collect the physiological characteristic data of each swimmer in the current swimming pool in real time according to the physiological characteristic type set of the swimmers by using the final CNN neural network classification model to obtain a real-time physiological characteristic data matrix of the swimmers;
[0195] The alarm determination module is used to determine whether to issue an alarm based on the real-time swimmer's physiological characteristic data matrix, the swimmer's normal state parameter data matrix and the real-time drowning risk alarm level data set.
[0196] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0197] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A swimming pool drowning prevention warning method based on binocular vision, characterized in that: The following steps are involved: S1, setting a plurality of characteristic types reflecting the external physiology of the swimmer and the type of state parameters during swimming and collecting the swimmer's state parameter data during swimming at a plurality of historical time points, obtaining a set of the swimmer's physiological characteristic types, a set of the swimmer's state parameter types and a set of historical swimmer's state parameter data matrices; performing clustering processing on the historical swimmer's state parameter data matrix set to obtain a swimmer's normal state parameter data matrix; S2, constructing a final CNN neural network classification model and collecting swimmer state parameter data of multiple swimmers in abnormal and normal states and corresponding drowning risk warning level data according to the swimmer state parameter type set and merging them to obtain a merged swimmer state parameter data matrix and a merged level data set; S3, constructing a final state parameter mapping equation using the merged level data set and the merged swimmer state parameter data matrix; S4, using the final state parameter mapping equation to map the real-time state parameter data of each swimmer in the current swimming pool to obtain a real-time drowning risk warning level data set; According to the physiological characteristic type set of the swimmers, the final CNN neural network classification model is used to collect the physiological characteristic data of each swimmer in the current swimming pool in real time to obtain the real-time swimmer physiological characteristic data matrix; S5. Determine whether to issue an alarm based on the real-time swimmer's physiological characteristic data matrix, the swimmer's normal state parameter data matrix, and the real-time drowning risk alarm level data set.
2. A swimming pool drowning prevention warning method based on binocular vision according to claim 1, characterized in that: The S1 comprises the following steps: S11, setting a plurality of characteristic types reflecting the external physiology of the swimmer to obtain a set of physiological characteristic types of the swimmer; then setting a plurality of state parameter types of the swimmer when swimming to obtain a set of state parameter types of the swimmer; and constructing a swimming database according to the set of physiological characteristic types of the swimmer and the set of state parameter types of the swimmer; S12, collecting swimmer physiological characteristic data of multiple swimmers according to the swimmer physiological characteristic type set and the swimmer state parameter type set, and using a binocular camera device to collect swimmer state parameter data when swimming at multiple historical time points, to obtain a historical swimmer physiological characteristic data matrix and a historical swimmer state parameter data matrix set; S13, filling the swimming database with data.
3. A swimming pool drowning prevention warning method based on binocular vision according to claim 2, characterized in that: The S13 comprises the following steps: S131, clustering the state parameter data of each swimmer in the historical swimmer state parameter data matrix according to the time point to obtain a historical swimmer state parameter classification center data set matrix; S132, taking the classification center data set with the largest number of corresponding swimmer state parameter data sets for each swimmer in the historical swimmer state parameter classification center data set matrix as the swimmer's normal state parameter data set, to obtain the swimmer's normal state parameter data matrix; S133, storing the swimmer's normal state parameter data matrix and the historical swimmer's physiological characteristic data matrix into a swimming database.
4. A binocular vision-based swimming pool drowning prevention warning method according to claim 3, characterized in that: In S131, the state parameter data of each swimmer in the historical swimmer state parameter data matrix are clustered according to time points using a pigeon flock optimization algorithm.
5. A binocular vision-based swimming pool drowning prevention warning method according to claim 4, characterized in that: The S2 comprises the following steps: S21, collecting image data of multiple swimmers while swimming and collecting corresponding physiological characteristic data of swimmers according to the physiological characteristic type set of swimmers, to obtain a swimmer image data set and a to-be-used swimmer physiological characteristic data matrix; S22, constructing an initial CNN neural network classification model; using the swimmer image data set and the to-be-used swimmer physiological characteristic data matrix to train and test the initial CNN neural network classification model to obtain a final CNN neural network classification model; S23. Set a drowning risk warning level set; collect swimmer state parameter data of multiple swimmers before multiple drowning accidents occurred in the past, swimmer state parameter data of multiple swimmers in normal states, and corresponding drowning risk warning level data according to the swimmer state parameter type set and the drowning risk warning level set, and merge them to obtain a merged swimmer state parameter data matrix and a merged level data set.
6. A binocular vision-based swimming pool drowning prevention warning method according to claim 5, characterized in that: The S3 comprises the following steps: S31, constructing an initial state parameter mapping equation; S32, substituting the combined swimmer state parameter data matrix into the initial state parameter mapping equation for mapping, to obtain a mapping data set; A risk warning level error threshold is set; when the absolute value of the difference between the drowning risk warning level data present in the mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, the initial state parameter mapping equation is optimized until the absolute value of the difference between the drowning risk warning level data present in the mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, and a final state parameter mapping equation is obtained; otherwise, the initial state parameter mapping equation does not need to be optimized, and the initial state parameter mapping equation is used as the final state parameter mapping equation.
7. A binocular vision-based swimming pool drowning prevention warning method according to claim 6, characterized in that: Optimizing the initial state parameter mapping equation in S32 includes the following steps: S321, constructing a second pigeon population; setting the maximum number of iterations of the second pigeon population to d3 and the current number of iterations to d4, which are recorded as the second maximum number of iterations and the second current number of iterations respectively; S322, setting the value interval of each undetermined coefficient and bias in the initial state parameter mapping equation to obtain a set of undetermined coefficient value intervals and a bias value interval; setting the initial position of each pigeon in the second pigeon population according to the set of undetermined coefficient value intervals and the bias value interval to obtain a first initial position matrix; S323, constructing a fitness function of a second pigeon population according to the mapping data set and the merged level data set; S324, start iteration; in each round of iteration, use the fitness function of the second pigeon population to calculate the fitness value of the position of each pigeon updated in the previous round of iteration, and update the position of each pigeon updated in the previous round of iteration; S325, when d4≥d3, stop iteration and obtain the second final global optimal position; otherwise, continue iteration until d2≥d1; Substitute the second final global optimal position into the initial state parameter mapping equation to obtain the adjusted state parameter mapping equation; substitute the merged swimmer state parameter data matrix into the adjusted state parameter mapping equation for mapping to obtain an adjusted mapping data set; when the absolute value of the difference between the drowning risk warning level data that does not exist in the adjusted mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold, use the adjusted state parameter mapping equation as the final state parameter mapping equation; otherwise, return to S324 to continue iterating until the absolute value of the difference between the drowning risk warning level data that does not exist in the adjusted mapping data set and the corresponding drowning risk warning level data in the merged level data set is greater than or equal to the risk warning level error threshold.
8. A binocular vision-based swimming pool drowning prevention warning method according to claim 7, characterized in that: The S4 comprises the following steps: S41, collecting state parameter data of each swimmer in the current swimming pool in real time according to the swimmer state parameter type set to obtain a real-time state parameter data matrix; then acquiring the physiological characteristic data of each swimmer in the current swimming pool in real time according to the swimmer physiological characteristic type set and using the final CNN neural network classification model to obtain a real-time swimmer physiological characteristic data matrix; S42, inputting the state parameter data of each swimmer in the real-time state parameter data matrix into the final state parameter mapping equation for mapping, and obtaining a real-time drowning risk warning level data set.
9. A binocular vision-based swimming pool drowning prevention warning method according to claim 8, characterized in that: The S5 comprises the following steps: S51, setting a physiological characteristic similarity threshold; when the real-time drowning risk warning level data set contains real-time drowning risk warning level data of one of the ordinary warning level, the emergency warning level and the fatal warning level, calculating the similarity between the physiological characteristic data of the corresponding swimmer in the real-time swimmer physiological characteristic data matrix and the physiological characteristic data of each historical swimmer in the swimming database to obtain the physiological characteristic similarity; S52, setting a state parameter similarity threshold; when the physiological characteristic similarity is greater than or equal to the physiological characteristic similarity threshold, performing similarity calculation on the swimmer's normal state parameter data corresponding to the historical swimmer's physiological characteristic data in the swimming database and the swimmer's real-time state parameter data to obtain the state parameter similarity; when the state parameter similarity is greater than or equal to the state parameter similarity threshold, no alarm is required; otherwise, an alarm is issued.
10. A system for implementing the binocular vision-based swimming pool drowning prevention warning method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
A method and system for preventing drowning in swimming pools based on camera networks
CN102693606B