Domain self-adaption-based low-illumination indoor personnel falling detection method and system
By performing random data enhancement and synchronous training on the YOLOv5 detector at night in a domain adaptation framework, the problem of indoor person fall detection under low light conditions is solved and higher detection accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202411316121.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art is difficult to effectively perform indoor personnel fall detection under low light conditions, and traditional deep learning methods perform poorly on small sample data sets, making it difficult to balance false alarm rates and false alarm rates.
A low-light indoor person fall detection method based on domain adaptation is adopted. The YOLOv5 detector is pre-trained by random enhancement at night on the general data set, and the teacher network parameters are synchronized in the domain adaptation framework, and the target domain data set is used for training. Generate fall detection models for low light conditions.
It improved the detection accuracy and adaptability of the decline detection model under low light conditions, reduced the differences between the source domain and the target domain, simplified the network training process, and obtained stable in the case of limited computing power and small data scale. Good training effect.
Smart Images

Figure CN119339316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and target detection, and in particular to a method and system for detecting indoor human falls in low light conditions based on domain adaptation. Background Art
[0002] The aging of the global population has made the health and safety of the elderly a focus of social attention. Indoor falls are one of the main causes of accidental injuries and deaths among the elderly. Therefore, indoor fall detection technology has become an important part of telemedicine and home health monitoring systems. In recent years, the development of computer vision, deep learning, and artificial intelligence has provided strong technical support for fall detection tasks. These technologies capture images or videos through cameras and use image processing and object detection algorithms to identify fall behaviors.
[0003] One of the challenges facing fall detection systems is how to find a balance between reducing false alarm rates and missing alarm rates. In addition, due to the diversity of indoor environments, factors such as lighting conditions and indoor layout may affect the detection effect. Therefore, fall detection systems also need to have good environmental adaptability to work stably in low light, complex backgrounds or dynamic environments.
[0004] However, traditional deep learning-based object detection technology is not well suited for fall detection tasks. On the one hand, compared with general object detection, the data collection of fall behavior is more complicated, resulting in a relatively small scale of existing fall detection datasets, which is difficult to fully meet the large data volume requirements of deep learning-based object detection models. The model method of general object detection does not work well in fall detection tasks and is prone to overfitting. On the other hand, traditional object detection models are often trained and verified under conditions of sufficient lighting, but in actual indoor monitoring scenarios, there will be a large number of low-light scenes at night. Low-light scenes will cause problems such as increased image noise, reduced contrast, and blurred details, which will cause the performance of the model to drop sharply under low-light conditions, and fall behavior is difficult to capture and identify. Among the existing methods, domain adaptation technology and low-light image enhancement technology can solve the above problems to a certain extent.
[0005] The goal of domain adaptation technology is to adjust the learning process of the model so that the model can not only perform well in the source domain, but also show good generalization ability in the target domain with no or only a small amount of labeled data. This usually involves reducing the difference in data distribution between the two domains so that the features learned by the model have better domain invariance. Among them, the adversarial method introduces an adversarial network so that the task features learned by the model can make a discriminator unable to distinguish whether it comes from the source domain or the target domain, thereby achieving domain confusion and reducing domain differences. The difference-based method directly quantifies and reduces the difference between the source domain and the target domain in feature space or probability distribution. This type of method usually does not rely on additional adversarial networks, but directly measures and minimizes the difference between the two domains through statistical metrics or optimization objectives. This technology can effectively solve the problem that the data set samples of fall detection are too few and traditional deep learning methods are difficult to learn.
[0006] Low-light image enhancement technology is often used to improve the quality of images acquired under low-light conditions. By increasing parameters such as image brightness and contrast, while retaining and restoring details as much as possible, the information in the originally dim scene becomes clearer and more visible. This technology can effectively improve the detection performance of traditional object detection models under low-light conditions.
[0007] One of the current state of the art is 2PC-Net, a two-phase cross-domain object detector based on the Mean-Teacher framework, in the paper “2pcnet: Two-phase consistency training for day-to-night unsupervised domain adaptive object detection”. First, the Faster-RCNN network is pre-trained using the dataset of the source domain, and the parameters of this training are put into the student network and the teacher network respectively, while the dataset of the target domain is subjected to random night-time data augmentation. Then, in the first phase of formal training, the teacher model is used to generate highly confident bounding box predictions for the data in the target domain. In the second phase of formal training, these predictions are combined with the regions proposed by the student model, and the teacher is re-evaluated to generate a mixed set of pseudo-labels with high and low confidence. After that, a weighted consistency loss is used to ensure that the training focuses more on high-quality pseudo-labels and supervise the training process. The parameters of the student network are weighted and updated to the teacher network at regular intervals. Finally, in the inference phase, the trained student network is used to predict the data in the target domain. This method uses a two-stage training method based on the Mean-Teacher framework to improve the generalization performance of Faster-RCNN in the target domain, and performs random enhancement for data in low-light environments. The disadvantage of this method is that it is only applicable to the two-stage detector Faster-RCNN. Compared with the one-stage detector YOLOv5, the two-stage detector can achieve higher accuracy, but its real-time performance is poor and it is not suitable for deployment in fall detection systems. In addition, the training process of this method is relatively complicated and takes a long time to train.
[0008] The second existing technology is a domain adaptive object detection method based on night prior in the paper "Boosting Object Detection with Zero-ShotDay-Night Domain Adaptation". First, the image in the source domain is data enhanced using the night prior to obtain the target domain image. Then, the shallow features are extracted and decomposed into illuminance L and reflectivity R through the reflectivity decoder. After that, the source and target domain image features are decomposed and reconstructed twice, and a re-decomposition consistency loss is introduced to promote the consistency between the reflectivities generated in the two decompositions, ensuring that the learned reflectivity representation is both stable and accurate. Finally, in the inference stage, the detector can better understand the characteristics of the target domain and improve the detection accuracy. This method does not need to obtain the target domain dataset, but only needs to enhance the source domain image data according to the prior knowledge of the night scene, thereby improving the detection performance of the detector in the target domain. The disadvantage of this method is that although this method can achieve good results in general night tasks, it performs poorly on datasets in specific fields such as night fall detection. Compared with the Mean-Teacher framework, the deep learning method using the night prior only approaches the target domain through data augmentation in the source domain, and cannot make up for the data distribution difference between the two, resulting in a decrease in detection performance. Summary of the invention
[0009] The purpose of the present invention is to overcome the shortcomings of the existing methods and propose a method and system for detecting indoor falls in low light based on domain adaptation. The main problem solved by the present invention is how to fully and quickly train the model using a relatively small training data set size, and how to minimize the impact of changes in lighting conditions on the model detection performance.
[0010] In order to solve the above problems, the present invention proposes a method for detecting indoor falls of people in low light conditions based on domain adaptation, and the method comprises:
[0011] Collect fall detection samples and annotate the upright and fallen states of people in the samples to obtain the target domain dataset;
[0012] The images on the COCO2017 dataset of the source domain are randomly enhanced at night, and pre-trained with the YOLOv5 detector of the student network to obtain a pre-trained student network, and its parameters are synchronized to the teacher network through the exponential moving average method to obtain a synchronized teacher network;
[0013] Using the target domain data set to train the pre-trained student network and the synchronized teacher network respectively to obtain a trained student network;
[0014] The trained YOLOv5 parameter model of the student network is deployed to the terminal, and fall detection is performed.
[0015] Preferably, the images on the general dataset COCO2017 of the source domain are randomly enhanced at night, and pre-trained through the YOLOv5 detector of the student network to obtain a pre-trained student network, and its parameters are synchronized to the teacher network by exponential moving average to obtain a synchronized teacher network, specifically:
[0016] The random data enhancement at night of the images of the general data set COCO2017 includes adding Gaussian noise to the images, performing Gaussian blur processing, and inserting glare effects. The random data enhancement at night includes both global enhancement of the images and local random enhancement of the images. After the random data enhancement at night, a training sample set is obtained;
[0017] The student network uses the YOLOv5 model as a detector, and uses the training sample set to perform supervised training on the student network. The number of training iterations is dynamically determined according to the size of the training sample set to obtain a pre-trained student network, and its loss function is:
[0018]
[0019] Where X s Refers to the prediction result of the source domain image, B s Refers to the real label of the detection box, C s Refers to the category label. is the classification loss of binary cross entropy, is the L1 regression loss, The expression is as follows:
[0020]
[0021]
[0022] Among them, p i Represents X s The classification prediction results in c i Represents C s The real classification label, n represents the total number of categories, and N is the number of detection boxes;
[0023] The expression is as follows:
[0024]
[0025] Among them, y i Represents X s The detection box prediction value in b i Indicates Bs The real value of the detection box in the figure, n is 4, which represent the length, width, horizontal coordinate and vertical coordinate of the upper left corner vertex of the detection box respectively;
[0026] The parameters of the pre-trained student network are synchronized to the teacher network that also uses the YOLOv5 model as the detector through exponential moving average to obtain the synchronized teacher network:
[0027] θ t ←αθ t +(1-α)θ s ,
[0028] Among them, θ t represents the parameters in the teacher network, θ s represents the parameters in the student network, and α is a hyperparameter.
[0029] Preferably, the pre-trained student network and the synchronized teacher network are trained respectively using the target domain data set to obtain a trained student network, specifically:
[0030] The synchronized teacher network predicts a pseudo label B for each image of the target domain dataset t and C t , according to C t Whether the confidence in exceeds the preset threshold determines whether to retain the pseudo label B t and C t ;
[0031] The pre-trained student network predicts the result X for each image of the target domain dataset t , using the pseudo label B t and C t Supervise the pre-trained student network, unsupervised loss It can be expressed as:
[0032]
[0033] in, is the classification loss of binary cross entropy, is the reconstruction loss, The calculation formula is as follows:
[0034]
[0035] Among them, p i Represents X t The classification prediction results in c i Represents C t The real classification label, n represents the total number of categories, and N is the number of detection boxes;
[0036] The calculation formula is as follows:
[0037]
[0038] Among them, α represents the confidence, y i represents the classification label in the student network prediction result, c i Classification labels representing pseudo labels predicted by the teacher network;
[0039] The parameters of the pre-trained student network are updated through unsupervised loss, and the parameters of the synchronized teacher network are updated after every 10 iterations using exponential moving average to finally obtain a trained student network.
[0040] Accordingly, the present invention also provides a low-light indoor person fall detection system based on domain adaptation, comprising:
[0041] A training data collection unit is used to collect fall detection samples and annotate the upright and fallen states of people in the samples to obtain a target domain data set;
[0042] The preprocessing and pretraining unit is used to perform random nighttime enhancement on images on the source domain's general dataset COCO2017, and pretrain the images through the YOLOv5 detector of the student network to obtain a pretrained student network, and synchronize its parameters to the teacher network through an exponential moving average to obtain a synchronized teacher network;
[0043] A network training unit, used to train the pre-trained student network and the synchronized teacher network respectively using the target domain data set to obtain a trained student network;
[0044] The deployment and application unit is used to deploy the YOLOv5 parameter model of the trained student network to the terminal and perform fall detection.
[0045] The implementation of the present invention has the following beneficial effects:
[0046] The present invention generalizes the YOLOv5 model trained on a general data set to a fall detection model with a small sample size, while ensuring the detection efficiency of YOLOv5, so that it can obtain better detection accuracy in the fall detection scenario, and solves the problem that the traditional deep learning method is not effective due to too few samples. By introducing the night random image enhancement method in the domain adaptation framework, the present invention further reduces the difference between the source domain and the target domain, improves the performance of the domain adaptation method, and also improves the final detection effect. At the same time, the network training process of the present invention is relatively simple, and can be trained under limited computing power and small data scale to achieve stable and good training results. In addition, the present invention deploys the algorithm on the detection terminal, which can effectively process the video data streams generated by multiple cameras efficiently and accurately, meeting the needs of fall detection tasks in medical and residential environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flow chart of a method for detecting a person falling in a low-light indoor environment based on domain adaptation according to an embodiment of the present invention;
[0048] Figure 2 It is a network structure of indoor personnel fall detection based on domain adaptation in low light according to an embodiment of the present invention;
[0049] Figure 3 It is a structural diagram of a low-light indoor personnel fall detection system based on domain adaptation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Figure 1 is a flow chart of a method for detecting a person falling in a low-light indoor environment based on domain adaptation according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0052] S1, collect fall detection samples and annotate the upright and fallen states of people in the samples to obtain the target domain dataset, with 100 samples;
[0053] S2, randomly enhance the images on the source domain’s general dataset COCO2017 at night, and pre-train them through the YOLOv5 detector of the student network to obtain the pre-trained student network, and synchronize its parameters to the teacher network through the exponential moving average method to obtain the synchronized teacher network;
[0054] S3, using the target domain data set to train the pre-trained student network and the synchronized teacher network respectively to obtain a trained student network. The pre-training and training of the teacher network and the student network are as follows: Figure 2 As shown;
[0055] S4, deploying the trained YOLOv5 parameter model of the student network to the terminal, and performing fall detection.
[0056] Step S2, such as Figure 2 As shown, the details are as follows:
[0057] S2-1, random data enhancement at night of the images of the general dataset COCO2017 includes adding Gaussian noise to the images, performing Gaussian blur processing, and inserting glare effects. Random data enhancement at night includes both global enhancement of the images and local random enhancement of the images. After random data enhancement at night, a training sample set is obtained;
[0058] S2-2, the student network uses the YOLOv5 model as a detector, and uses the training sample set to perform supervised training on the student network. The number of training iterations is dynamically determined according to the size of the training sample set. Here, it is iterated 10,000 times to obtain a pre-trained student network, and its loss function is:
[0059]
[0060] Where X s Refers to the prediction result of the source domain image, B s Refers to the real label of the detection box, C s Refers to the category label. is the classification loss of binary cross entropy, is the L1 regression loss, The expression is as follows:
[0061]
[0062]
[0063] Among them, p i Represents X s The classification prediction results in c i Represents C sThe real classification label, n represents the total number of categories, and N is the number of detection boxes;
[0064] The expression is as follows:
[0065]
[0066] Among them, y i Represents X s The detection box prediction value in b i Indicates B s The real value of the detection box in the figure, n is 4, which represent the length, width, horizontal coordinate and vertical coordinate of the upper left corner vertex of the detection box respectively;
[0067] S2-3, synchronize the parameters of the pre-trained student network to the teacher network that also uses the YOLOv5 model as a detector through an exponential moving average method to obtain a synchronized teacher network:
[0068] θ t ←αθ t +(1-α)θ s ,
[0069] Among them, θ t represents the parameters in the teacher network, θ s represents the parameters in the student network, and α is a hyperparameter.
[0070] Step S3 is as follows:
[0071] S3-1, the synchronized teacher network predicts a pseudo label B for each image of the target domain dataset t and C t , according to C t Whether the confidence in exceeds the preset threshold determines whether to retain the pseudo label B t and C t ;
[0072] S3-2, the pre-trained student network predicts the result X of each image in the target domain dataset t , using the pseudo label B t and C t Supervise the pre-trained student network, unsupervised loss It can be expressed as:
[0073]
[0074] in, is the classification loss of binary cross entropy, is the reconstruction loss, The calculation formula is as follows:
[0075]
[0076] Among them, p i Represents X t The classification prediction results in c i Represents C t The real classification label, n represents the total number of categories, and N is the number of detection boxes;
[0077] The calculation formula is as follows:
[0078]
[0079] Among them, α represents the confidence, y i represents the classification label in the student network prediction result, c i Classification labels representing pseudo labels predicted by the teacher network;
[0080] S3-3, the parameters of the pre-trained student network are updated through unsupervised loss, and the parameters of the synchronized teacher network are updated through exponential moving average after every 10 iterations, and finally a trained student network is obtained.
[0081] Step S4 is as follows:
[0082] S4-1, using PyTorch's YOLOv5 model, export the trained student network's YOLOv5 model as an ONNX model file through the framework's tools, and verify the model's integrity and correctness. Then, use TensorRT's Python API to load this ONNX model and automatically optimize it, including operator fusion and parallel optimization, and then generate an engine executable file optimized for a specific GPU. Finally, use DeepStream to deploy the TensorRT engine to the terminal to achieve high-speed and efficient reasoning services.
[0083] S4-2, according to the IP address and port number of the network camera, connect the video stream data to the DeepStream framework, then write a UI interface on the terminal to display the output results of the model in real time on the UI interface, and finally, send the prediction results of each frame in the video stream to the server for storage and analysis for subsequent processing.
[0084] Accordingly, the present invention also provides a low-light indoor person fall detection system based on domain adaptation, such as Figure 3 As shown, including:
[0085] A training data collection unit 1 is used to collect fall detection samples and annotate the standing and falling states of people in the samples to obtain a target domain data set;
[0086] Preprocessing and pretraining unit 2 is used to perform random nighttime enhancement on images on the general dataset COCO2017 of the source domain, and pretrain the images through the YOLOv5 detector of the student network to obtain a pretrained student network, and synchronize its parameters to the teacher network through an exponential moving average method to obtain a synchronized teacher network;
[0087] Specifically, the random data enhancement at night of the images of the general data set COCO2017 includes adding Gaussian noise to the images, performing Gaussian blur processing, and inserting glare effects. The random data enhancement at night includes both global enhancement of the images and local random enhancement of the images. After the random data enhancement at night, a training sample set is obtained.
[0088] The student network uses the YOLOv5 model as a detector, and uses the training sample set to perform supervised training on the student network. The number of training iterations is dynamically determined according to the size of the training sample set to obtain a pre-trained student network, and its loss function is:
[0089]
[0090] Where X s Refers to the prediction result of the source domain image, B s Refers to the real label of the detection box, C s Refers to the category label. is the classification loss of binary cross entropy, is the L1 regression loss, The expression is as follows:
[0091]
[0092]
[0093] Among them, p i Represents X s The classification prediction results in c i Represents C s The real classification label, n represents the total number of categories, and N is the number of detection boxes;
[0094] The expression is as follows:
[0095]
[0096] Among them, y i Represents X s The detection box prediction value in b i Indicates B sThe real value of the detection box in the figure, n is 4, which represent the length, width, horizontal coordinate and vertical coordinate of the upper left corner vertex of the detection box respectively;
[0097] The parameters of the pre-trained student network are synchronized to the teacher network that also uses the YOL0v5 model as a detector through exponential moving average to obtain the synchronized teacher network:
[0098] θ t ←αθ t +(1-α)θ s ,
[0099] Among them, θ t represents the parameters in the teacher network, θ s represents the parameters in the student network, α is a hyperparameter
[0100] A network training unit 3 is used to train the pre-trained student network and the synchronized teacher network respectively using the target domain data set to obtain a trained student network;
[0101] Specifically, the synchronized teacher network predicts a pseudo label B for each image of the target domain dataset. t and C t , according to C t Whether the confidence in exceeds the preset threshold determines whether to retain the pseudo label B t and C t ;
[0102] The pre-trained student network predicts the result X for each image of the target domain dataset t , using the pseudo label B t and C t Supervise the pre-trained student network, unsupervised loss It can be expressed as:
[0103]
[0104] in, is the classification loss of binary cross entropy, is the reconstruction loss, The calculation formula is as follows:
[0105]
[0106] Among them, p i Represents X t The classification prediction results in c i Represents C t The real classification label, n represents the total number of categories, and N is the number of detection boxes;
[0107] The calculation formula is as follows:
[0108]
[0109] Among them, α represents the confidence, y i represents the classification label in the student network prediction result, c i Classification labels representing pseudo labels predicted by the teacher network;
[0110] The parameters of the pre-trained student network are updated through unsupervised loss, and the parameters of the synchronized teacher network are updated through exponential moving average after every 10 iterations, ultimately obtaining a trained student network.
[0111] A deployment and application unit 4 is used to deploy the YOLOv5 parameter model of the trained student network to the terminal and perform fall detection;
[0112] Specifically, using the YOLOv5 model of PyTorch, the YOLOv5 model of the trained student network is exported as an ONNX model file through the framework's tools, and the model is verified for integrity and correctness. Then, the ONNX model is loaded using the Python API of TensorRT, and automatically optimized, including operator fusion and parallel optimization, and then an engine executable file optimized for a specific GPU is generated. Finally, the TensorRT engine is deployed to the terminal using DeepStream to achieve high-speed and efficient reasoning services.
[0113] According to the IP address and port number of the network camera, the video stream data is connected to the DeepStream framework. Then, a UI interface is written on the terminal to display the output results of the model in real time on the UI interface. Finally, the prediction results of each frame in the video stream are sent to the server for storage and analysis for subsequent processing.
[0114] Therefore, the present invention generalizes the YOLOv5 model trained on a general data set to a fall detection model with a small sample size, while ensuring the detection efficiency of YOLOv5, so that it can obtain better detection accuracy in the fall detection scenario, and solves the problem that the traditional deep learning method is not effective due to too few samples. By introducing the night random image enhancement method in the domain adaptation framework, the present invention further reduces the difference between the source domain and the target domain, improves the performance of the domain adaptation method, and also improves the final detection effect. At the same time, the network training process of the present invention is relatively simple, and can be trained and obtain stable and good training results under the conditions of limited computing power and small data scale. In addition, the present invention deploys the algorithm to the detection terminal, which can effectively process the video data streams generated by multiple cameras efficiently and accurately, meeting the needs of fall detection tasks in medical and residential environments.
[0115] The above is a detailed introduction to the domain-adaptive low-light indoor person fall detection method and system provided in the embodiments of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A domain-adaptive method for detecting indoor falls in low light conditions, characterized in that: The method comprises: Collect fall detection samples and annotate the upright and fallen states of people in the samples to obtain the target domain dataset; The images on the COCO2017 dataset of the source domain are randomly enhanced at night, and pre-trained through the YOLOv5 detector of the student network to obtain a pre-trained student network, and its parameters are synchronized to the teacher network through the exponential moving average method to obtain a synchronized teacher network; Using the target domain data set to train the pre-trained student network and the synchronized teacher network respectively to obtain a trained student network; The trained YOLOv5 parameter model of the student network is deployed to the terminal, and fall detection is performed.
2. The method for detecting indoor falls of people in low light conditions based on domain adaptation as claimed in claim 1, characterized in that: The images on the general dataset COCO2017 of the source domain are subjected to random data augmentation at night, and pre-trained through the YOLOv5 detector of the student network to obtain a pre-trained student network, and its parameters are synchronized to the teacher network through an exponential moving average method to obtain a synchronized teacher network, specifically: The random data enhancement at night of the images of the general data set COCO2017 includes adding Gaussian noise to the images, performing Gaussian blur processing, and inserting glare effects. The random data enhancement at night includes both global enhancement of the images and local random enhancement of the images. After the random data enhancement at night, a training sample set is obtained; The student network uses the YOLOv5 model as a detector, and uses the training sample set to perform supervised training on the student network. The number of training iterations is dynamically determined according to the size of the training sample set to obtain a pre-trained student network, and its loss function is: Where X s Refers to the prediction result of the source domain image, B s Refers to the real label of the detection box, C s Refers to the category label. is the classification loss of binary cross entropy, is the L1 regression loss, The expression is as follows: Among them, p i Represents X s The classification prediction results in c i Represents C s The real classification label, n represents the total number of categories, and N is the number of detection boxes; The expression is as follows: Among them, y i Represents X s The detection box prediction value in b i Indicates B s The real value of the detection box in the figure, n is 4, which represent the length, width, horizontal coordinate and vertical coordinate of the upper left corner vertex of the detection box respectively; The parameters of the pre-trained student network are synchronized to the teacher network that also uses the YOLOv5 model as the detector through exponential moving average to obtain the synchronized teacher network: i t ←th t +(1-α)θ s , Among them, θ t represents the parameters in the teacher network, θ s represents the parameters in the student network, and α is a hyperparameter.
3. The method for detecting indoor falls of people in low light conditions based on domain adaptation as claimed in claim 1, characterized in that: The method of using the target domain data set to train the pre-trained student network and the synchronized teacher network to obtain a trained student network is specifically as follows: The synchronized teacher network predicts a pseudo label B for each image of the target domain dataset t and C t , according to C t Whether the confidence in exceeds the preset threshold determines whether to retain the pseudo label B t and C t ; The pre-trained student network predicts the result X for each image of the target domain dataset t , using the pseudo label B t and C t Supervise the pre-trained student network, unsupervised loss It can be expressed as: in, is the classification loss of binary cross entropy, is the reconstruction loss, The calculation formula is as follows: Among them, p i Represents X t The classification prediction results in c i Represents C t The real classification label, n represents the total number of categories, and N is the number of detection boxes; The calculation formula is as follows: Among them, α represents the confidence, y i represents the classification label in the student network prediction result, c i Classification labels representing pseudo labels predicted by the teacher network; The parameters of the pre-trained student network are updated through unsupervised loss, and the parameters of the synchronized teacher network are updated through exponential moving average after every 10 iterations, ultimately obtaining a trained student network.
4. A domain-adaptive low-light indoor fall detection system, characterized in that: The system comprises: A training data collection unit is used to collect fall detection samples and annotate the upright and fallen states of people in the samples to obtain a target domain data set; The preprocessing and pretraining unit is used to perform random nighttime enhancement on images on the source domain's general dataset COCO2017, and pretrain the images through the YOLOv5 detector of the student network to obtain a pretrained student network, and synchronize its parameters to the teacher network through an exponential moving average to obtain a synchronized teacher network; A network training unit, used to train the pre-trained student network and the synchronized teacher network respectively using the target domain data set to obtain a trained student network; The deployment and application unit is used to deploy the YOLOv5 parameter model of the trained student network to the terminal and perform fall detection.
5. The domain-adaptive low-light indoor person fall detection system according to claim 4, characterized in that: The preprocessing and pretraining unit is used to perform random nighttime enhancement on images on the general dataset COCO2017 of the source domain, and pretrain the images through the YOLOv5 detector of the student network to obtain a pretrained student network, and synchronize its parameters to the teacher network through an exponential moving average to obtain a synchronized teacher network, specifically: The random data enhancement at night of the images of the general data set COCO2017 includes adding Gaussian noise to the images, performing Gaussian blur processing, and inserting glare effects. The random data enhancement at night includes both global enhancement of the images and local random enhancement of the images. After the random data enhancement at night, a training sample set is obtained; The student network uses the YOLOv5 model as a detector, and uses the training sample set to perform supervised training on the student network. The number of training iterations is dynamically determined according to the size of the training sample set to obtain a pre-trained student network, and its loss function is: Where X s Refers to the prediction result of the source domain image, B s Refers to the real label of the detection box, C s Refers to the category label. is the classification loss of binary cross entropy, is the L1 regression loss, The expression is as follows: Among them, p i Represents X s The classification prediction results in c i Represents C s The real classification label, n represents the total number of categories, and N is the number of detection boxes; The expression is as follows: Among them, y i Represents X s The detection box prediction value in b i Indicates B s The real value of the detection box in the figure, n is 4, which represent the length, width, horizontal coordinate and vertical coordinate of the upper left corner vertex of the detection box respectively; The parameters of the pre-trained student network are synchronized to the teacher network that also uses the YOLOv5 model as the detector through exponential moving average to obtain the synchronized teacher network: i t ←th t +(1-α)θ s , Among them, θ t represents the parameters in the teacher network, θ s represents the parameters in the student network, and α is a hyperparameter.
6. The domain-adaptive low-light indoor person fall detection system according to claim 4, characterized in that: The network unsupervised training unit is used to train the pre-trained student network and the synchronized teacher network respectively using the target domain data set to obtain a trained student network, specifically: The synchronized teacher network predicts a pseudo label B for each image of the target domain dataset t and C t , according to C t Whether the confidence in exceeds the preset threshold determines whether to retain the pseudo label B t and C t ; The pre-trained student network predicts the result X for each image of the target domain dataset t , using the pseudo label B t and C t Supervise the pre-trained student network, unsupervised loss It can be expressed as: in, is the classification loss of binary cross entropy, is the reconstruction loss, The calculation formula is as follows: Among them, p i Represents X t The classification prediction results in c i Represents C t The real classification label, n represents the total number of categories, and N is the number of detection boxes; The calculation formula is as follows: Among them, α represents the confidence, y i represents the classification label in the student network prediction result, c i Classification labels representing pseudo labels predicted by the teacher network; The parameters of the pre-trained student network are updated through unsupervised loss, and the parameters of the synchronized teacher network are updated through exponential moving average after every 10 iterations, ultimately obtaining a trained student network.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Night picture field adaptive method based on semantic segmentation and self-training
CN116524326A
Self-adaptive semantic segmentation method and device under severe conditions
CN116645512A
Noise-resistant cassava leaf disease classification method and system based on curriculum knowledge distillation
CN117274657A
Unsupervised domain adaptive semantic segmentation method based on characteristic disturbance consistency
CN117726819A
Model training method, cross-domain target detection method and electronic equipment
CN118038163A