Community child safety tracking system based on face recognition
By adopting facial recognition technology and ResNet-50 network model in the community child safety tracking system, combined with asymmetric histogram equalization, the problems of blind spots and poor real-time performance of traditional monitoring systems are solved, real-time and accurate monitoring of children are achieved Accurate identification in night vision scenarios has improved the level of security guarantee.
Patent Information
- Application Number
- CN202411409750.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-10-10
AI Technical Summary
Traditional monitoring systems have problems such as large blind spots in monitoring, poor real-time and low efficiency, which are difficult to meet the needs of children's safety management, especially in the case of night vision infrared scenarios.
A community child safety tracking system based on facial recognition technology was designed, including database module, monitoring module, face recognition module, display module, alarm module and data analysis module, using ResNet-50 network model and asymmetric histogram equalization The Dlib library and milvus database can realize real-time and accurate child identity recognition and tracking, and adapt to the changes in children's facial growth through the facial feature base library correction function.
Realize real-time, accurate and safe monitoring of children, improve the safety guarantee level of children in the community, solve the blind spots and real-time problems of traditional monitoring systems, improve image details and recognition accuracy, and ensure the night vision scene Accurate identification.
Smart Images

Figure CN118918629B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of safety monitoring, and in particular to a community child safety tracking system based on face recognition technology. Background Art
[0002] With the acceleration of urbanization, the population density of communities has gradually increased, and the safety of children has become the focus of attention of parents and community managers. At present, traditional monitoring systems mainly rely on video monitoring and manual patrols, which have problems such as large monitoring blind spots, poor real-time performance, and low efficiency, making it difficult to meet the needs of child safety management. As a biometric recognition technology, face recognition technology has the advantages of accurate recognition, rapid response, and a wide range of applications, and has gradually been applied to various security monitoring systems. Considering that the time period in which child safety incidents may occur is 7*24 hours, the present invention introduces a child face recognition technology for night vision infrared scenes. Summary of the invention
[0003] The purpose of the present invention is to provide a community child safety tracking system based on face recognition technology to solve the problems of large monitoring blind spots, poor real-time performance, and low efficiency in the prior art, and to achieve real-time, accurate, and safe tracking and monitoring of children. Because the facial feature points of children will change as they grow, a feature correction function is introduced. Because there are night vision scenes, child face recognition technology in night vision scenes is introduced.
[0004] In order to achieve the above-mentioned object, the present invention provides a community child safety tracking system based on face recognition, which comprises: a database module, a monitoring module, a face recognition module, a display module, an alarm module, a data analysis module, and a face feature database correction module;
[0005] The database module stores the child’s facial feature information, parent contact information, and the child’s daily activity track;
[0006] The monitoring module includes surveillance cameras distributed throughout the community, which are set up in key areas of the community to capture children's activity images in real time and transmit them to the face recognition module for processing;
[0007] Face recognition module: used to capture and identify the facial features of children entering the community, and compare them with the pre-stored information in the database to confirm the identity of the children;
[0008] Display module: used to display the real-time location and activity trajectory of children, which is convenient for parents and community managers to monitor; the display screen communicates with the system server through the WebSocket protocol, refreshes data in real time, and the delay is less than 1 second;
[0009] Alarm module: When the system detects that a child has entered a dangerous area or has stayed in an abnormal location for a long time, the alarm module will automatically send an alarm message to parents and community managers through the SMS gateway and mobile phone app;
[0010] The data analysis module performs statistical analysis on children's daily activity data. The generated analysis report includes information such as activity frequency, activity duration, and activity area distribution. It can also identify abnormal behavior patterns and provide early warning reports of potential risks.
[0011] The facial feature database correction module regularly updates and corrects the facial feature information in the database to ensure the accuracy of system recognition.
[0012] Furthermore, the database module adopts a MySQL database, and the facial feature data stored in the database is a 256-dimensional feature vector generated by a Dlib library.
[0013] Furthermore, key areas of the community include entrances and exits, playgrounds, and parking lots; the camera supports real-time video capture at 25 frames per second to ensure the clarity and smoothness of video data.
[0014] Furthermore, the face recognition module includes a data preprocessing module and a face recognition model;
[0015] The workflow of the data preprocessing module is as follows:
[0016] Step A1: obtaining the original face image from the monitoring module in real time;
[0017] Step A2: normalizing the pixel values of the captured RGB color image;
[0018] Step A3: Use the face detection tool in the Dlib library to automatically detect and align facial key points;
[0019] Step A4: Image enhancement using asymmetric histogram equalization;
[0020] The face recognition model is specifically a ResNet-50 network model. The preprocessed face features are input into the ResNet-50 network, and the output feature vectors are input into the milvus feature vector database. The database is compared through the internal cosine similarity algorithm to obtain the face feature vectors above the similarity threshold as the face recognition results.
[0021] Furthermore, the data analysis module uses the Hadoop big data platform to perform data processing and analysis.
[0022] Furthermore, the correction process of the facial feature base database correction module is as follows: every month, the facial photo of each child with the highest image quality, the highest comparison similarity and exceeding the minimum threshold is selected from the recognition records to replace the latest facial base map of the child; if the system fails to update the base map through automatic correction for more than 6 months, an alarm is generated to remind people to re-enter the map manually.
[0023] The training method of the face recognition model ResNet-50 network is as follows:
[0024] Step B1: Dataset preparation: obtain a children's facial image dataset, which covers children's facial images of different age groups, genders, and countries;
[0025] Step B2: Data preprocessing and image enhancement of night vision images using asymmetric histogram equalization; then the dataset is divided into training set, validation set and test set;
[0026] Step B3: Model training; using Adam optimization algorithm for gradient descent;
[0027] Step B4: Model optimization and evaluation; use accuracy, F1-score, and ROC curve evaluation indicators to measure the performance of the model on the validation set, obtain a trained face recognition model, and apply it to the face recognition module.
[0028] The beneficial effects of the present invention are as follows:
[0029] The present invention is based on face recognition technology, realizes real-time, accurate and safe tracking and monitoring of children, solves the problems of large blind spots, poor real-time performance and low efficiency of traditional monitoring systems, and effectively improves the safety level of children in the community; in traditional monitoring images, overexposure or too dark problems are prone to occur. The data analysis module in the present invention uses an asymmetric equalization method to enhance the dark areas of the image and maintain appropriate brightness in the bright areas, thereby improving the details and visibility of the image as a whole, making the face image clearer and improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is the overall architecture diagram of the community child safety tracking system based on face recognition of the present invention. DETAILED DESCRIPTION
[0031] A child safety tracking system based on face recognition was deployed in a community. Figure 1As shown, the system includes a database module, a monitoring module, a face recognition module, a display module, an alarm module, a data analysis module, and a face feature database correction module; when a child enters the community, the monitoring module captures his or her facial image and transmits it to the face recognition module. The face recognition module compares the captured image with the pre-stored information in the database to confirm the child's identity. The system tracks the child's activity trajectory in real time and transmits the data to the database module for storage. When the system detects that a child enters a dangerous area or stays in an abnormal position for a long time, the alarm module automatically sends an alarm message to the parents and community managers; the display module displays the child's location and activity trajectory in real time for easy monitoring; the data analysis module analyzes the child's daily activity data and provides early warning reports on behavior patterns and potential risks.
[0032] Next, each module is further explained.
[0033] The database module uses MySQL database to store children's facial feature information, parents' contact information, and children's daily activity trajectories. The facial feature data stored in the database is a 256-dimensional feature vector generated by the Dlib library.
[0034] The monitoring module includes several surveillance cameras distributed in the community, which are set up in various key areas of the community to capture children's activities in real time and transmit them to the face recognition module for processing. Specifically, they are distributed in key areas such as the main entrances and exits of the community, playgrounds, and parking lots. The camera model is Hikvision DS-2XA3T46EF-LS, with 4 million pixels and support for real-time video capture at 25 frames per second, ensuring the clarity and smoothness of video data.
[0035] Face recognition module: used to capture and identify the facial features of children entering the community, and compare it with the pre-stored information in the database to confirm the identity of the children.
[0036] Display module: used to display the real-time location and activity trajectory of children, which is convenient for parents and community managers to monitor. The display screen communicates with the system server through the WebSocket protocol and refreshes data in real time with a delay of less than 1 second.
[0037] Alarm module: When the system detects that a child enters a dangerous area (such as a parking lot) or stays in an abnormal location for a long time (such as more than 15 minutes), the alarm module will automatically send alarm information to parents and community managers through the SMS gateway and mobile phone App. The response time is less than 5 seconds to ensure timely alarm.
[0038] The data analysis module uses the Hadoop big data platform to process and analyze data and conduct statistical analysis on children's daily activity data. The generated analysis report includes information such as activity frequency, activity duration, and activity area distribution, and can identify abnormal behavior patterns and provide early warning reports of potential risks.
[0039] The facial feature base database correction module regularly updates and corrects the facial feature information in the database to ensure the accuracy of system recognition. Specifically, the system selects the facial photos of each child with the highest image quality, the highest comparison similarity and exceeding the minimum threshold from the recognition records every month to replace them with the latest facial base map of the child. Based on changes in historical data, the system can automatically adjust facial feature data to adapt to the growth and changes of children's facial features to ensure long-term recognition accuracy. If the system has not updated the base map through the automatic correction function for more than 6 months, an alarm will be generated to remind you to re-enter the data manually.
[0040] Specifically, the face recognition module includes a data preprocessing module and a face recognition model; the workflow of the data preprocessing module is as follows:
[0041] Step A1: obtaining the original face image from the monitoring module in real time;
[0042] Step A2: Grayscale normalization: Normalize the captured RGB color image pixel values to the range [0, 1]. The grayscale conversion formula is:
[0043]
[0044] Among them, R, G, B are the pixel values of the red, green, and blue channels respectively, and Y is the grayscale value after conversion.
[0045] Step A3: Image face alignment: Use the face detection tool in the Dlib library to automatically detect and align facial key points to ensure that the position and scale of the face in the image are consistent;
[0046] Step A4: using asymmetric histogram equalization to enhance the image;
[0047] Step A4.1: Dual-segment asymmetric partitioning: the histogram of the image is divided into two parts, namely, a high brightness area and a low brightness area, and different equalization strategies are used for the two areas respectively;
[0048] Each pixel has a corresponding coordinate (x, y), and the grayscale value of the pixel represents the brightness of the point, with a value of (0, 255). Low brightness area: Perform detailed equalization on the low brightness part to enhance the dark details, while limiting the increase in brightness to prevent overexposure. For the low brightness area L(x,y), L(x,y) takes the value of (0,95); High brightness area: For the high brightness part, a more moderate equalization strategy is adopted to avoid over-enhancement of the bright area, resulting in loss of details. For the low brightness area H(x,y), H(x,y) takes the value of (183,255).
[0049] For the low brightness area L(x,y), perform local histogram equalization on the grayscale value:
[0050]
[0051] in, It is the dark enhancement coefficient, which is used to adjust the dark details. Indicates the pixel value of the low brightness area in the image, L represents the low brightness area in the image; Indicates the pixel value of the low-brightness area after equalization.
[0052] Apply a gentle equalization strategy to high-brightness areas to avoid overexposure of bright areas; the gentle equalization of high-brightness areas is calculated by the following formula:
[0053]
[0054] in, It is the highlight limit coefficient to prevent overexposure of highlights. Indicates the pixel value of the high brightness area in the image, H represents the high brightness area in the image; Represents the pixel value of the high brightness area after equalization;
[0055] Step A4.2: Adaptive weight allocation: Dynamically adjust the weights based on the high brightness area and low brightness area in the image. For areas with concentrated grayscale distribution, reduce the intensity of equalization to maintain the naturalness of the image; for areas with widespread grayscale distribution, increase the intensity of equalization to improve local contrast.
[0056] Grayscale variance calculation:
[0057]
[0058] Where n is the area The number of pixels within the area Including high brightness area H(x,y) and low brightness area L(x,y), is located in The gray value at is the average gray value of the area.
[0059] Local area weight The variance of the grayscale distribution Decide:
[0060]
[0061] Regions with larger variances are given larger weights, while regions with smaller variances are treated less strongly.
[0062] Applied to asymmetric histogram equalization, the formula is as follows:
[0063] Processing of low brightness areas , T1 takes the value 95:
[0064]
[0065] in, It is the dynamic adjustment weight of low brightness area.
[0066] High brightness area processing ,T2 takes the value 193:
[0067]
[0068] in, is the dynamic adjustment weight of the high brightness area, and are the low brightness and high brightness thresholds.
[0069] If the grayscale distribution in the low-brightness area is relatively concentrated (i.e., the pixel brightness in the area does not change much), the equalization strength is weakened to avoid excessive enhancement of the noise in the dark area. If the grayscale distribution in the high-brightness area is relatively wide, the equalization strength is increased to improve the contrast of the area and make its details clearer. By calculating the grayscale variance, the equalization weights of the high-brightness area and the low-brightness area are dynamically adjusted to make the image processing more delicate. This method is particularly suitable for processing scenes with large brightness differences, such as night images and infrared images, and can enhance image details while maintaining a natural feel.
[0070] Step A4.3: Asymmetric equalization based on edge detection: Introduce edge detection mechanism to preprocess the edge area of the image before histogram equalization. By performing high-precision equalization on the edge area, key details and contour information in the image can be retained, preventing the traditional histogram equalization from over-smoothing the edge:
[0071] A more refined asymmetric equalization strategy is applied to edge areas, while a milder enhancement is applied to non-edge areas.
[0072] Asymmetric equalization of edge areas: For detected edge areas, a more refined asymmetric equalization strategy is applied, especially to enhance the details of low-brightness parts. The equalization formula for edge areas can be expressed as:
[0073]
[0074] Represents the grayscale value of the pixel in the original image. Represents the pixel value after equalization in the edge area. and are low brightness and high brightness thresholds, used to define the enhancement interval; and is the enhancement factor, which is used to control the enhancement strength of the edge area.
[0075] Step A4.4: Adaptive dynamic range compression: To avoid overexposure in high-brightness images and loss of dark areas in low-brightness images, an adaptive dynamic range compression method is used. The dynamic range of different regions is compressed according to the local brightness histogram of the image to ensure a more uniform brightness distribution of the entire image. The degree of dynamic range compression is automatically adjusted by the global contrast of the image.
[0076]
[0077] Where C is the contrast adjustment parameter, I(x, y) is the input image pixel value, is the compressed output value.
[0078] After asymmetric histogram equalization processing, the dark areas of the image are enhanced and the bright areas maintain appropriate brightness, thereby improving the details and visibility of the image as a whole; taking a specific image as an example, the average grayscale value of the original image is 70. After equalization processing, the average grayscale value rises to 120, and the standard deviation increases from 15 to 40, indicating that the image contrast is significantly improved.
[0079] The face recognition model is specifically the ResNet-50 network model; the ResNet-50 network is a 50-layer residual neural network that solves the problem of gradient disappearance during deep network training by introducing residual connections; specifically, the ResNet-50 network contains a series of convolutional layers and residual blocks, each residual block contains multiple convolutional layers, batch normalization (BatchNormalization) and ReLU activation functions, the purpose of which is to extract the spatial features of the image, and finally output a 256-dimensional feature vector through the fully connected layer as the feature representation of each face. This feature vector represents the key information of the face, and this feature vector is input into the milvus vector database. The system uses the milvus database to perform cosine similarity calculation and comparison to obtain the person ID with the highest similarity and the comparison similarity. After comparing the recognition results with the real person, it is found that when the similarity threshold is set to 0.85, the accuracy can reach 99.998%.
[0080] Specifically, the training method of the face recognition model ResNet-50 network is as follows:
[0081] Step B1: Dataset preparation: Obtain a children's facial image dataset, which covers facial images of children of different ages, genders, and races;
[0082] Step B2: Data preprocessing, including data enhancement, image face alignment, grayscale normalization, and night vision image enhancement; expand the data set through data enhancement technology, including rotation, flipping, scaling, translation, noise addition, etc., to simulate various possible scene changes and improve the generalization ability of the model. Because of the existence of face recognition in night vision scenes, about 30% of the images in the data set trained by this model are face images captured in night vision scenes. Night vision image enhancement specifically uses asymmetric histogram equalization to enhance night vision images; then the data set is divided into a training set (80%), a validation set (10%), and a test set (10%) to evaluate the training effect and generalization ability of the model.
[0083] Step B3: Model training; Adopt Adam optimization algorithm for gradient descent, and set the initial learning rate to 0.001. Adam combines the advantages of momentum method and RMSProp, and can automatically adjust the learning rate during training to improve training speed and stability. Adopt learning rate decay strategy, reduce the learning rate by half every 10 epochs to ensure that the model can steadily decline when it is close to convergence; set the batch size of each training to 64, and train 50 rounds in total, each round contains a complete data set traversal; use L2 regularization and Dropout technology (ratio of 0.5) to prevent overfitting;
[0084] Step B4: Model optimization and evaluation;
[0085] Evaluation indicators such as accuracy, F1-score, and ROC curve can be used to measure the performance of the model on the validation set.
[0086] Comparative experiments show that the recognition rate of unprocessed night vision images under certain conditions is 85%, while after asymmetric histogram equalization processing, the recognition rate is increased to 95%. The recognition speed is also optimized, and the processing time of each image is controlled within 25ms.
[0087] The system uses OpenCV and Dlib libraries for facial detection and feature extraction, with a recognition accuracy of 98.5%. This high accuracy is due to the powerful feature extraction capabilities and deep learning optimization of the model. The system includes an alarm module that automatically sends alarm information to parents and community managers when it detects that a child has entered a dangerous area (such as a parking lot) or has stayed in an abnormal location for a long time (more than 15 minutes). The SMS gateway response time is less than 5 seconds, ensuring timely alarm. This rapid response improves the practicality and safety of the system. The system automatically selects high-quality children's facial images every month to update the base map in the database to adapt to the growth and changes of children's facial features.
[0088] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. Community child safety tracking system based on face recognition, characterized by: It includes database module, monitoring module, face recognition module, display module, alarm module, data analysis module and face feature database correction module; The database module stores the child’s facial feature information, parent contact information, and the child’s daily activity track; The monitoring module includes surveillance cameras distributed throughout the community, which are set up in key areas of the community to capture children's activity images in real time and transmit them to the face recognition module for processing; Face recognition module: used to capture and identify the facial features of children entering the community, and compare them with the pre-stored information in the database to confirm the identity of the children; Display module: used to display the real-time location and activity trajectory of children, so that parents and community managers can monitor them; The display screen communicates with the system server via the WebSocket protocol, refreshing data in real time with a delay of less than 1 second; Alarm module: When the system detects that a child has entered a dangerous area or has stayed in an abnormal location for a long time, the alarm module will automatically send an alarm message to parents and community managers through the SMS gateway and mobile phone app; The data analysis module conducts statistical analysis on children's daily activity data; the generated analysis report includes activity frequency, activity duration, and activity area distribution; it can also identify abnormal behavior patterns and provide early warning reports of potential risks; The facial feature database correction module regularly updates and corrects the facial feature information in the database to ensure the accuracy of system recognition; The face recognition module includes a data preprocessing module and a face recognition model; The workflow of the data preprocessing module is as follows: Step A1: obtaining the original face image from the monitoring module in real time; Step A2: normalizing the pixel values of the captured RGB color image; Step A3: Use the face detection tool in the Dlib library to automatically detect and align facial key points; Step A4: Image enhancement using asymmetric histogram equalization; The steps of asymmetric histogram equalization are as follows: Step A4.1: Perform grayscale analysis on the image to determine the thresholds of low brightness area and high brightness area; Step A4.2: Perform local enhancement on the low-brightness area to enhance the dark details; the enhancement of the low-brightness area is calculated by the following formula: Among them, α is the dark enhancement coefficient, L(x, y) represents the pixel value of the low brightness area in the image, L represents the low brightness area in the image; L'(x, y) represents the pixel value of the low brightness area after equalization; Apply a gentle equalization strategy to high-brightness areas to avoid overexposure of bright areas; the gentle equalization of high-brightness areas is calculated by the following formula: Among them, β is the bright part limit coefficient, H(x, y) represents the pixel value of the high brightness area in the image, H represents the high brightness area in the image; H′(x, y) represents the pixel value of the high brightness area after equalization; Then dynamically adjust the enhancement strength of different areas; Step A4.3: Asymmetric equalization of edge areas; the equalization formula of edge areas can be expressed as: I(x,y) represents the gray value of the pixel in the original image, I′ E (x, y) represents the pixel value after equalization in the edge area, T1 and T2 are the thresholds of the low-brightness area and the high-brightness area, which are used to define the enhancement interval; α E and β E is the enhancement coefficient; Step A4.4: Adaptive dynamic range compression: The degree of dynamic range compression is automatically adjusted by the global contrast of the image; Where C is the contrast adjustment parameter, I(x,y) is the input image pixel value, DR X (x,y) is the compressed output value; The dynamic adjustment of the enhancement strength of different regions is specifically to dynamically adjust the weights according to the high brightness region and the low brightness region in the image; the specific steps are as follows: First calculate the grayscale variance: Where n is the region R i The number of pixels in area R i Including high brightness area H(x,y) and low brightness area L(x,y), R i (x,y) is the grayscale value at (x,y), μ i is the average gray value of the area; Local area weight w i The variance Var of the grayscale distribution i Decide: Regions with larger variances receive larger weights, while regions with smaller variances receive less intense treatment; Applied to asymmetric histogram equalization, the formula is as follows: Processing of low brightness areas: Among them, ω L is the dynamic adjustment weight of the low brightness area; Processing of high brightness areas: Among them, ω H is the dynamic adjustment weight of the high brightness area; The face recognition model is specifically a ResNet-50 network model; the preprocessed facial features are input into the ResNet-50 network, and the output feature vectors are input into the milvus feature vector database. The database calculates and compares the internal cosine similarity to obtain a facial feature vector that is higher than the similarity threshold as the face recognition result.
2. The community child safety tracking system based on face recognition according to claim 1 is characterized in that: The database module uses a MySQL database, and the facial feature data stored in the database is a 256-dimensional feature vector generated by the Dlib library.
3. The community child safety tracking system based on face recognition according to claim 1 is characterized in that: Key areas of the said community include entrances and exits, playgrounds, and parking lots; The camera supports real-time video capture at 25 frames per second.
4. The community child safety tracking system based on face recognition according to claim 3 is characterized in that: The data analysis module uses the Hadoop big data platform to perform data processing and analysis.
5. The community child safety tracking system based on face recognition according to claim 4 is characterized in that: The correction process of the facial feature database correction module is as follows: every month, the facial photo of each child with the highest image quality, the highest comparison similarity and exceeding the minimum threshold is selected from the recognition records and used to replace the latest facial base map of the child; if the system has not updated the base map through automatic correction for more than 6 months, a reminder will be given to manually re-enter the map.
6. The community child safety tracking system based on face recognition according to claim 5 is characterized in that: The training method of the face recognition model ResNet-50 network is as follows: Step B1: Dataset preparation: obtain a children's facial image dataset, which covers children's facial images of different age groups, genders, and countries; Step B2: Data preprocessing and image enhancement of night vision images using asymmetric histogram equalization; then the dataset is divided into training set, validation set and test set; Step B3: Model training; using Adam optimization algorithm for gradient descent; Step B4: Model optimization and evaluation; use accuracy, F1-score, and ROC curve evaluation indicators to measure the performance of the model on the validation set, obtain a trained face recognition model, and apply it to the face recognition module.
