A method for detecting pet leash entering ladder based on semantic analysis
Through deep learning algorithms and semantic analysis technology, an accurate mapping model between elevator camera images and object categories is established, which solves the problem of difficulty in identifying pet traction ropes in traditional elevator systems, achieves accurate identification and alarm of slender and flexible objects, and improves elevator efficiency. Security.
Patent Information
- Application Number
- CN202410718652.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-05
AI Technical Summary
It is difficult for traditional elevator safety systems to identify and prevent slender, flexible objects such as pet leashes. As a result, the leash may be caught when the elevator door is closed, causing a serious safety hazard for pets being hoisted.
A pet leash entry detection method based on semantic analysis is adopted. Through deep learning algorithms and semantic analysis technology, an accurate mapping model between elevator camera images and object categories is established to identify pet leash entry events in real time and output an alarm signal. This method includes object annotation, event annotation, preprocessing, deep learning network model training and real-time prediction, combined with self-attention mechanism and dynamic snake convolution to enhance the detection ability of flexible objects.
It achieves accurate identification of slender and flexible objects such as pet traction ropes during elevator operation, improves the identification accuracy of the elevator safety system and its adaptability to different lighting and viewing angle conditions, and reduces the risk of pets being pinched.
Smart Images

Figure CN118298285B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traction rope detection, and in particular to a method for detecting pet traction ropes entering stairs based on semantic analysis. Background Art
[0002] Traditional elevator safety systems are inadequate in identifying and preventing slender, flexible objects (such as pet leashes). Due to technical limitations, traditional elevator light curtains may not be able to effectively identify such objects, which may cause the elevator door to clamp the leash when closing, resulting in serious safety hazards such as pets being lifted up.
[0003] With the advancement of computer vision and artificial intelligence technology, the present invention combines deep learning algorithms and semantic analysis technology to establish an accurate mapping model between elevator camera images and object categories, thereby achieving accurate recognition of slender and flexible objects such as pet leashes during elevator operation. Summary of the invention
[0004] In order to accurately identify slender and flexible objects such as pet leashes during elevator operation, the present invention proposes a method for detecting pet leashes entering an elevator based on semantic analysis, including:
[0005] Obtain a pet entering an elevator image set, perform object labeling and event labeling on the pet entering an elevator images in the pet entering an elevator image set based on the elements of the pet leash entering an elevator event, obtain a labeled image set, and preprocess the labeled image set to obtain a pet entering an elevator data set;
[0006] Build a deep learning network model, and train and test the deep learning network model using the pet entry dataset to obtain the target network model;
[0007] The real-time images inside and outside the elevator are obtained through the elevator camera, and the target network model is input in real time to predict whether the current real-time image belongs to the event of a pet leash entering the elevator, and the prediction result is saved in the sequential logic buffer;
[0008] If the current real-time image belongs to a pet leash entering the elevator event, it is determined whether there is a preset percentage of images in the timing logic buffer and the corresponding prediction results all belong to the pet leash entering the elevator event. If so, an alarm signal is output; the timing logic buffer stores the prediction results corresponding to the latest continuous images inside and outside the car in a preset frame.
[0009] Furthermore, the elements of the pet leash entering the elevator event include: pet leash, pet, elevator door opening state, and elevator entry state;
[0010] The object labeling means labeling the category of the object; the category labeling of the object includes: pet leash labeling, pet labeling, leash person labeling, elevator door labeling and elevator door opening status labeling.
[0011] Furthermore, the event annotation includes: elevator entry status annotation and timestamp annotation; the timestamp annotation is used to annotate continuous frame images in a pet elevator entry image set; the elevator entry status annotation represents the use of multiple categories of annotations to annotate the elevator entry status; the multiple categories of annotations include: entering the elevator, exiting the elevator and stationary state.
[0012] Further, obtaining a set of pet entering elevator images includes:
[0013] Real images of pets entering and exiting the elevator are obtained in different real elevator car environments, and the images are preprocessed; an elevator car simulation environment is constructed, and a pet leash entering the elevator event is created in this environment, and a simulation screen when the event occurs is obtained, that is, an image of the pet being pulled in and out of the elevator; a pet entering the elevator image set is constructed using the simulation screen and the preprocessed real images.
[0014] Furthermore, the annotated image set is preprocessed, including:
[0015] The images in the image set are scaled and unified to a preset pixel size, and data cleaning and enhancement operations are performed on the scaled images.
[0016] Furthermore, the target network model is obtained by training and testing the deep learning network model using the pet entry dataset, including:
[0017] The deep learning network model is trained and tested using the pet entry dataset and loss function to obtain the initial network model.
[0018] The target network model is obtained by quantifying the weight parameters in the initial network model to obtain the weight values corresponding to each weight parameter, and removing the weight parameters whose weight values are less than the preset values.
[0019] Furthermore, the target network model includes:
[0020] Input layer, used to input the image to be predicted;
[0021] A downsampling layer, used to downsample the image to be predicted to obtain a first feature map;
[0022] The first branch module and the second branch module, wherein:
[0023] The first branch module includes a first high-resolution module and a plurality of sequentially connected spatial feature extraction modules; the second branch module includes a first low-resolution module, a feature pyramid module and a plurality of sequentially connected semantic feature extraction modules;
[0024] The first high-resolution module is used to extract spatial information of the first feature map and input it into the spatial feature extraction module; the first low-resolution module is used to extract semantic information of the first feature map and input it into the semantic information extraction module;
[0025] The spatial feature extraction module is used to extract spatial features through the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a spatial feature image;
[0026] The semantic information extraction module is used to extract semantic features through the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module, and the semantic information extracted by the first low-resolution module or the output of the previous semantic information extraction module to obtain a semantic feature image; the spatial feature extraction module corresponds to the semantic feature extraction module one by one; the feature pyramid module is used to perform snake convolution processing on the semantic feature image extracted by the last semantic information extraction module to obtain multiple convolution feature images;
[0027] A fusion module is used to fuse multiple convolution feature images with the spatial feature image extracted by the last spatial feature extraction module to obtain a fused feature image;
[0028] The segmentation head is used to generate pixel-level category annotations for the fused feature image to obtain an annotated image;
[0029] Upsampling layer, used to upsample the labeled image;
[0030] The segmentation image layer is used to segment the upsampled labeled image to obtain a segmented image and output it; each pixel in the segmented image is assigned a corresponding category label.
[0031] Furthermore, the spatial feature extraction module includes:
[0032] The first self-attention module, the second high-resolution module and the first residual module;
[0033] The first self-attention module is used to enhance the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a self-attention feature image;
[0034] The first residual module is used to perform residual calculation on the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module to obtain residual features;
[0035] The second high-resolution module is used to extract spatial features through the self-attention feature image and the residual feature to obtain a spatial feature image.
[0036] Furthermore, the semantic information extraction module includes:
[0037] A second self-attention module, a second low-resolution module, and a second residual module;
[0038] The second self-attention module is used to enhance the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a self-attention feature image;
[0039] The second residual module is used to perform residual calculation on the spatial information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain residual features;
[0040] The second low-resolution module is used to extract semantic features through the self-attention feature image and the residual feature to obtain a semantic feature image.
[0041] Furthermore, the feature pyramid module includes:
[0042] A first dynamic snake convolution is used to perform snake convolution processing on the semantic feature image to obtain a first convolution feature image;
[0043] A second dynamic snake convolution is used to perform snake convolution processing on the semantic feature image to obtain a second convolution feature image;
[0044] Dynamic separable convolution is used to perform separate convolution on the semantic feature image to obtain a third convolution feature image.
[0045] Compared with the prior art, the present invention has at least the following beneficial effects:
[0046] (1) The present invention performs object labeling and event labeling on pet elevator images in a pet elevator image set based on the elements of a pet leash entering an elevator event, and performs preprocessing to obtain a pet elevator entering an elevator data set; and trains and tests a deep learning network model using the pet elevator entering an elevator data set to obtain a target network model; predicts whether the current real-time image belongs to a pet leash entering an elevator event using the target network model, and saves the prediction result; if the current real-time image belongs to a pet leash entering an elevator event, determines whether there is a preset percentage of images in a timing logic buffer whose corresponding prediction results all belong to the pet leash entering an elevator event, and if so, outputs an alarm signal; that is, the present invention combines a deep learning algorithm with a semantic analysis technology to establish an accurate mapping model between elevator camera images and object categories, thereby achieving accurate recognition of slender and flexible objects such as pet leashes during elevator operation;
[0047] (2) The present invention improves the quality of the pet elevator dataset and enhances the generalization ability of the model and its adaptability to different lighting, viewing angles and other conditions by preprocessing the annotated image set, including: scaling the images in the image set and unifying them into a preset pixel size, and performing data cleaning and enhancement operations (flipping, occlusion, rotation, color perturbation, and overall contrast and brightness adjustment) on the scaled images.
[0048] (3) The present invention uses the first branch module and the second branch module, and the two dual paths perform bidirectional reasoning on the low-resolution image after downsampling, aiming to enable different paths to capture different image features, and achieve information sharing through the self-attention mechanism after the feature fusion method, thereby improving the recognition accuracy of the model. At the same time, the present invention enhances the model's ability to detect and recognize flexible objects by adding dynamic snake convolution to the feature pyramid module in the second branch module;
[0049] (4) The present invention improves the model's understanding and learning of the temporal characteristics of the dynamic process of the traction rope entering the ladder by timestamping the continuous frame images in the pet entering the ladder image set, thereby improving the model's prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of a method for detecting pet leash entering a ladder based on semantic analysis;
[0051] Figure 2 This is the target network model structure diagram. DETAILED DESCRIPTION
[0052] The following are specific embodiments of the present invention and the accompanying drawings to further describe the technical solution of the present invention, but the present invention is not limited to these embodiments.
[0053] In order to accurately identify slender and flexible objects such as pet leashes during elevator operation, Figure 1 As shown, the present invention proposes a method for detecting a pet leash entering a ladder based on semantic analysis, comprising:
[0054] Obtain a pet entering an elevator image set, perform object labeling and event labeling on the pet entering an elevator images in the pet entering an elevator image set based on the elements of the pet leash entering an elevator event, obtain a labeled image set, and preprocess the labeled image set to obtain a pet entering an elevator data set;
[0055] In this embodiment, a pet leash incident refers to the process in which the pet leash (i.e., the rope of the handle or ring device connecting the pet and the owner) comes into contact with, crosses, or may cause entanglement risks with the elevator door, door frame, or other internal structures of the elevator when the pet owner brings the pet into or out of the elevator during use of the elevator. This incident includes the following situations:
[0056] 1. Pet leash enters the elevator car: When the pet owner leads the pet into the elevator, the leash moves with the pet and passes through the elevator door. At this time, the leash may come into contact with the elevator door, the edge of the door frame, the threshold, etc., especially when the pet enters quickly or the owner acts improperly, there is a risk of the leash being caught by the door.
[0057] 2. The pet leash leaves the elevator car: Similarly, when the pet owner leaves the elevator with the pet, the leash will move out of the elevator with the pet. During this process, the leash may also come into contact with the elevator door, door frame or threshold. If the elevator door closes too quickly or is operated improperly, the leash may be pinched.
[0058] 3. The pet leash moves inside the elevator: During the operation of the elevator, if the pet moves in the car, the leash may touch the handrails, buttons, gaps or other structures inside the elevator. Especially when the pet is excited or restless, the swing amplitude of the leash increases, increasing the possibility of entanglement with the internal components of the elevator.
[0059] 4. Traction rope jam: In any of the above stages, if the traction rope is accidentally caught by the elevator door or entangled with the internal structure of the elevator, the traction rope cannot move smoothly or is tightened, resulting in jam. This may not only damage the traction rope, but also endanger the safety of the pet, such as the pet being lifted or dragged.
[0060] In this embodiment, object labeling and event labeling are performed on the pet entering the elevator images in the pet entering the elevator image set based on the elements of the pet leash entering the elevator event, specifically referring to:
[0061] Associating pet entering elevator images with pet leash entering elevator events: carefully annotate each image containing a pet leash, clearly mark the elements in the image related to the pet leash entering elevator event, and establish a direct connection between the image content and the elevator entry event. The elements of the pet leash entering elevator event include: pet leash, pet, elevator door open state, elevator entry state, etc.
[0062] Get the pet elevator image set, including:
[0063] Real images of pets entering and exiting the elevator are obtained in different real elevator car environments, and the images are preprocessed; an elevator car simulation environment is constructed, and a pet leash entering the elevator event is created in this environment, and a simulation screen when the event occurs is obtained, that is, an image of the pet being pulled in and out of the elevator; a pet entering the elevator image set is constructed using the simulation screen and the preprocessed real images.
[0064] It should be noted that obtaining real images of pets entering and exiting elevators in different real elevator car environments includes: simulating people leading pets in and out of elevators in real environments (i.e., pet traction rope entering elevator events). Specifically, the following different variables are selected for combination, including: elevator car type (passenger elevator, freight elevator, etc.), elevator floor type (stainless steel, tile / marble, carpet, etc.), elevator camera installation location (next to the car door, car corner, etc.), different elevator camera configurations (focal length, field of view, resolution, etc.), pet type (such as small dogs, large dogs, cats, etc.), traction rope type (such as nylon rope, leather rope, telescopic traction rope, etc.), etc., and data collection is performed on the scenes of the above variable combinations to obtain real images of pets entering and exiting elevators.
[0065] The image is preprocessed, specifically: objects in the real picture are transformed by image editing means; specifically, foreground objects in the elevator car are added, deleted, and replaced, and background objects are changed. For example, in some embodiments, the elevator floor is replaced from tiles to carpets; the red leash is replaced by a black leash, so as to expand the pet entering the elevator image set.
[0066] In this embodiment, an elevator car simulation environment is constructed, and a pet traction rope entering the elevator event is created in this environment, and a simulation screen when the event occurs is obtained, that is, an image when the pet is pulled in and out of the elevator; specifically:
[0067] According to the actual situation, a high-fidelity elevator car simulation environment is constructed, and an event of a person leading a pet in and out of the elevator (i.e., a pet traction rope entering the elevator event) is established to obtain the elevator camera image in the elevator car simulation environment. Specifically, the first step is to establish an elevator car simulation environment. The simulation environment is based on Unreal Engine 5 as the core framework, combined with an elevator simulation plug-in and a virtual environment simulation plug-in to provide a simulation effect that matches the actual elevator operation and environment. On this basis, the realism of the simulation environment is further enhanced by importing the texture information, lighting settings and other environmental elements inside the elevator into the Unreal Engine. For example, the opening and closing process of the elevator door, the lighting changes inside the elevator, and the environmental changes when the elevator reaches different floors are simulated. In addition, in order to simulate the event of a person leading a pet in and out of the elevator, virtual characters and pet models will be added to the simulation environment, and their actions of entering and exiting the elevator will be simulated through animation technology. The images of this series of actions are captured through the virtual camera set in the elevator car simulation environment.
[0068] Preprocess the annotated image set, including:
[0069] The images in the image set are scaled and unified to a preset pixel size, and the scaled images are cleaned and enhanced (flipped, occluded, angle rotated, color disturbed, image contrast adjusted, and image brightness adjusted).
[0070] The object labeling means labeling the category of the object; the category labeling of the object includes: pet leash labeling, pet labeling, leash person labeling, elevator door labeling and elevator door opening status labeling.
[0071] The event annotation includes: elevator entry status annotation and timestamp annotation; the timestamp annotation is used to annotate continuous frame images in the pet elevator entry image set; the elevator entry status annotation means using multiple categories of annotations to annotate the elevator entry status; the multiple categories of annotations include: entering the elevator, exiting the elevator and stationary state.
[0072] Build a deep learning network model, and train and test the deep learning network model using the pet entry dataset to obtain the target network model;
[0073] The target network model is obtained by training and testing the deep learning network model through the pet elevator dataset, including:
[0074] The deep learning network model is trained and tested using the pet entry dataset and loss function to obtain the initial network model.
[0075] Specifically:
[0076] Divide the pet elevator dataset into a training set and a test set according to a preset ratio;
[0077] Train the deep learning network model through training sets and loss functions;
[0078] The formula expression of the loss function is: ;
[0079] In the formula, L is the final loss, H and W are the height and width of the original image, and M is the number of categories. is the true value label for category c, Predict the probability value for category c.
[0080] When the loss function value of the deep learning network model is less than the threshold, the deep learning network model is used to predict the test set to determine whether the accuracy of the trained deep learning network model reaches the preset value; if the accuracy and the time to infer each image meet the expected values, the model selection and training are terminated to obtain the initial network model;
[0081] The calculation formula of the accuracy is: ;
[0082] In the formula, IOU (Intersection over Union) represents the ratio of the intersection and union of the predicted pixels and the real pixels of this class, MIOU represents the average IOU of all categories, k represents the number of all categories, P represents the predicted pixels of this class, and G represents the real pixels of this class.
[0083] ;
[0084] In the formula, A function to determine whether to end training;
[0085] The target network model is obtained by quantifying the weight parameters in the initial network model to obtain the weight values corresponding to each weight parameter, and removing the weight parameters whose weight values are less than the preset values.
[0086] It needs to be explained that the weight parameters of the model are quantized, and the floating-point weights in the model are converted into integers with low bit width. By analyzing the importance of the model weight parameters and removing those weights with less influence, the network can be made sparse. There are two ways of quantization, one is perceptual quantization, which is to introduce quantization operations during the training process, and the other is to perform quantization after the training is completed. The present invention adopts the latter, and performs weight quantization and sparsification before entering actual use. These two steps are performed after the model training is completed, which helps to deploy the reasoning efficiency of the model. After the model training is completed, the weights of the model are fixed, and the fixed weights can be easily obtained at this time.
[0087] Quantization refers to converting the floating-point weights in the model into integers or floating-point numbers with lower digits, which can speed up the model reasoning. Sparsification refers to cutting off the small weight connections after quantization. Since most of the weights in the model are zero, the model can be stored in a sparse format, thereby reducing storage space and achieving acceleration on specific hardware.
[0088] like Figure 2 As shown in the figure (in the figure, Nx indicates that the corresponding dotted box modules, i.e., the spatial feature extraction module and the semantic feature extraction module, will be repeated N times), the target network model includes:
[0089] Input layer, used to input the image to be predicted;
[0090] A downsampling layer, used to downsample the image to be predicted to obtain a first feature map;
[0091] The first branch module and the second branch module, wherein:
[0092] The first branch module includes a first high-resolution module and a plurality of sequentially connected spatial feature extraction modules; the second branch module includes a first low-resolution module, a feature pyramid module and a plurality of sequentially connected semantic feature extraction modules;
[0093] It should be noted that the first branch module is mainly used to extract the spatial information and detail information of the image, such as texture, edge, etc. The second branch module is mainly used to process the global information of the image, covering the semantic information of larger-scale objects and background areas.
[0094] In order to achieve a good balance between speed and resolution, the feature map size of the first branch module is always fixed and no downsampling operation is performed, in order to retain the spatial details of the image, obtain fine position information, and reduce the loss of spatial information. The low-resolution module in the second branch module will first be downsampled to reduce the resolution, thereby increasing the prediction speed of the model.
[0095] The first high-resolution module is used to extract spatial information of the first feature map and input it into the spatial feature extraction module; the first low-resolution module is used to extract semantic information of the first feature map and input it into the semantic information extraction module;
[0096] The spatial feature extraction module is used to extract spatial features through the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a spatial feature image;
[0097] Specifically, when the spatial feature extraction module is not the first spatial feature extraction module, the spatial features are extracted through the output of the previous spatial feature extraction module and the output of the previous semantic feature extraction module to obtain a spatial feature image; when the spatial feature extraction module is the first spatial feature extraction module, the spatial features are extracted through the spatial information extracted by the first high-resolution module and the semantic information extracted by the first low-resolution module to obtain a spatial feature image.
[0098] The spatial feature extraction module specifically includes:
[0099] The first self-attention module, the second high-resolution module and the first residual module;
[0100] The first self-attention module is used to enhance the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a self-attention feature image;
[0101] Specifically, when the spatial feature extraction module corresponding to the first self-attention module is not the first spatial feature extraction module, the first self-attention module enhances the output of the previous spatial feature extraction module and the output of the previous semantic feature extraction module; when the spatial feature extraction module corresponding to the first self-attention module is the first spatial feature extraction module, the first self-attention module enhances the spatial information extracted by the first high-resolution module and the semantic information extracted by the first low-resolution module.
[0102] The first residual module is used to perform residual calculation on the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module to obtain residual features;
[0103] Specifically, when the spatial feature extraction module corresponding to the first residual module is not the first spatial feature extraction module, the first residual module performs residual calculation on the output of the previous spatial feature extraction module; when the spatial feature extraction module corresponding to the first residual module is the first spatial feature extraction module, the first residual module performs residual calculation on the spatial information extracted by the first high-resolution module.
[0104] The second high-resolution module is used to extract spatial features through the self-attention feature image and the residual feature to obtain a spatial feature image.
[0105] The semantic information extraction module is used to extract semantic features through the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic information extraction module to obtain a semantic feature image;
[0106] Specifically, when the semantic information extraction module is not the first semantic information extraction module, the semantic features are extracted by combining the output of the previous spatial feature extraction module and the output of the previous semantic feature extraction module to obtain a semantic feature image; when the semantic information extraction module is the first semantic information extraction module, the semantic features are extracted by combining the spatial information extracted by the first high-resolution module and the semantic information extracted by the first low-resolution module to obtain a semantic feature image.
[0107] The semantic information extraction module comprises:
[0108] A second self-attention module, a second low-resolution module, and a second residual module;
[0109] The second self-attention module is used to enhance the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a self-attention feature image;
[0110] Specifically, when the semantic information extraction module corresponding to the second self-attention module is not the first semantic information extraction module, the second self-attention module enhances the output of the previous spatial feature extraction module and the output of the previous semantic feature extraction module; when the semantic information extraction module corresponding to the second self-attention module is the first semantic information extraction module, the second self-attention module enhances the spatial information extracted by the first high-resolution module and the semantic information extracted by the first low-resolution module.
[0111] That is, the present invention performs bidirectional feature fusion multiple times at different stages (the corresponding two modules: spatial feature extraction module and semantic feature extraction module are represented as one stage) to achieve full fusion of spatial information and semantic information. This process can effectively combine the detail information and overall semantic information in the image, thereby achieving a better balance between resolution and accuracy.
[0112] The second residual module is used to perform residual calculation on the spatial information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain residual features;
[0113] Specifically, when the semantic feature extraction module corresponding to the second residual module is not the first semantic feature extraction module, the second residual module performs residual calculation on the output of the previous semantic feature extraction module; when the semantic feature extraction module corresponding to the second residual module is the first semantic feature extraction module, the second residual module performs residual calculation on the spatial information extracted by the first low-resolution module.
[0114] The second low-resolution module is used to extract semantic features through the self-attention feature image and the residual feature to obtain a semantic feature image.
[0115] The spatial feature extraction module corresponds to the semantic feature extraction module one by one;
[0116] The feature pyramid module is used to perform snake convolution processing on the semantic feature image extracted by the last semantic information extraction module to obtain multiple convolution feature images;
[0117] The feature pyramid module includes:
[0118] A first dynamic snake convolution is used to perform snake convolution processing on the semantic feature image to obtain a first convolution feature image;
[0119] A second dynamic snake convolution is used to perform snake convolution processing on the semantic feature image to obtain a second convolution feature image;
[0120] Dynamic separable convolution is used to perform separate convolution on the semantic feature image to obtain a third convolution feature image.
[0121] It should be noted that, considering the slenderness and flexibility of pet ropes, the change of traditional convolution values depends on the final loss constraint feedback of the network. This change process is relatively free, which can easily cause the model to lose small structural features that account for a small proportion, that is, lose slender and flexible structures. Therefore, the present invention introduces a dynamic snake-shaped convolution kernel in the model, thereby introducing continuity constraints. Each convolution position is based on its previous position as a reference, and the swing direction can be freely selected, thereby ensuring the continuity of the receptive field while freely selecting. The model's attention to slender and continuous features is enhanced, thereby enhancing the model's ability to detect pet traction rope targets.
[0122] Fusion Module ( Figure 2 ⊕ in the image), used to fuse multiple convolution feature images (first convolution feature image, second convolution feature image, third convolution feature image) with the spatial feature image extracted by the last spatial feature extraction module to obtain a fused feature image;
[0123] The segmentation head is used to generate pixel-level category annotations for the fused feature image to obtain an annotated image;
[0124] Upsampling layer, used to upsample the labeled image;
[0125] The segmentation image layer is used to segment the upsampled labeled image to obtain a segmented image and output it; each pixel in the segmented image is assigned a corresponding category label.
[0126] In this embodiment, an edge computing box is provided in the elevator car, the target network model is deployed in the edge computing box, and a sequential logic buffer is also provided in the edge computing box. The sequential logic buffer is used to cache the prediction results of the latest 15 frames, and the data is stored in a first-in-first-out manner. When new data is stored, the earliest data is deleted.
[0127] The edge computing box is a hardware device with computing power that processes data close to the data source (built-in camera in the elevator) to reduce data transmission delay and achieve real-time analysis. Deploying the model to the edge computing box means that the model can perform reasoning operations directly on the elevator site without relying on cloud servers, which improves the response speed and real-time performance of the system.
[0128] The real-time images inside and outside the elevator are obtained through the elevator camera, and the target network model is input in real time to predict whether the current real-time image belongs to the event of a pet leash entering the elevator, and the prediction result (i.e. whether there is a pet leash) is saved in the sequential logic buffer;
[0129] If the current real-time image belongs to a pet leash entering the elevator event, then within a preset time length (for example, the time length from the current real-time image being predicted as a pet leash entering the elevator event to continuing to predict 15 frames continuously) it is continuously determined whether there is a preset percentage (80%) of the images in the timing logic buffer corresponding to the prediction results that all belong to the pet leash entering the elevator event. If so, an alarm signal is output; the timing logic buffer stores the prediction results corresponding to the latest continuous images inside and outside the car of the preset frames (15 frames).
[0130] The present invention performs object annotation and event annotation on pet entering elevator images in a pet entering elevator image set based on the elements of the pet leash entering elevator event, and performs preprocessing to obtain a pet entering elevator data set; and trains and tests a deep learning network model through the pet entering elevator data set to obtain a target network model; predicts whether the current real-time picture belongs to the pet leash entering elevator event through the target network model, and saves the prediction result; if the current real-time picture belongs to the pet leash entering elevator event, determines whether there is a preset percentage of pictures in the timing logic buffer whose corresponding prediction results all belong to the pet leash entering elevator event, and if so, outputs an alarm signal; that is, the present invention combines deep learning algorithms and semantic analysis technology to establish a precise mapping model between elevator camera images and object categories, thereby realizing accurate recognition of slender and flexible objects such as pet leashes during elevator operation.
[0131] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0132] In addition, in the present invention, descriptions such as "first", "second", "one", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0133] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0134] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
Claims
1. A method for detecting pet traction rope entering a ladder based on semantic analysis, characterized in that: include: Obtain a pet entering an elevator image set, perform object labeling and event labeling on the pet entering an elevator images in the pet entering an elevator image set based on the elements of the pet leash entering an elevator event, obtain a labeled image set, and preprocess the labeled image set to obtain a pet entering an elevator data set; A deep learning network model is constructed, and the target network model is obtained by training and testing the deep learning network model through the pet entry dataset; the target network model includes: Input layer, used to input the image to be predicted; A downsampling layer, used to downsample the image to be predicted to obtain a first feature map; The first branch module and the second branch module, wherein: The first branch module includes a first high-resolution module and a plurality of sequentially connected spatial feature extraction modules; the second branch module includes a first low-resolution module, a feature pyramid module and a plurality of sequentially connected semantic feature extraction modules; The first high-resolution module is used to extract spatial information of the first feature map and input it into the spatial feature extraction module; the first low-resolution module is used to extract semantic information of the first feature map and input it into the semantic feature extraction module; The spatial feature extraction module is used to extract spatial features through the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a spatial feature image; The semantic feature extraction module is used to extract semantic features through the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module, and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a semantic feature image; the spatial feature extraction module corresponds to the semantic feature extraction module one by one; the feature pyramid module is used to perform snake convolution processing on the semantic feature image extracted by the last semantic feature extraction module to obtain multiple convolution feature images; A fusion module is used to fuse multiple convolution feature images with the spatial feature image extracted by the last spatial feature extraction module to obtain a fused feature image; The segmentation head is used to generate pixel-level category annotations for the fused feature image to obtain an annotated image; Upsampling layer, used to upsample the labeled image; A segmentation image layer, used to segment the upsampled labeled image to obtain a segmented image and output it; each pixel in the segmented image is assigned a corresponding category label; The spatial feature extraction module comprises: The first self-attention module, the second high-resolution module and the first residual module; The first self-attention module is used to enhance the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a self-attention feature image; The first residual module is used to perform residual calculation on the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module to obtain residual features; The second high-resolution module is used to extract spatial features through the self-attention feature image and the residual feature to obtain a spatial feature image; The semantic feature extraction module comprises: A second self-attention module, a second low-resolution module, and a second residual module; The second self-attention module is used to enhance the spatial information extracted by the first high-resolution module or the output of the previous spatial feature extraction module and the semantic information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain a self-attention feature image; The second residual module is used to perform residual calculation on the spatial information extracted by the first low-resolution module or the output of the previous semantic feature extraction module to obtain residual features; The second low-resolution module is used to extract semantic features through the self-attention feature image and the residual feature to obtain a semantic feature image; The feature pyramid module includes: A first dynamic snake convolution is used to perform snake convolution processing on the semantic feature image to obtain a first convolution feature image; A second dynamic snake convolution is used to perform snake convolution processing on the semantic feature image to obtain a second convolution feature image; Dynamic separable convolution, used to perform separation convolution on the semantic feature image to obtain a third convolution feature image; The real-time images inside and outside the elevator are obtained through the elevator camera, and the target network model is input in real time to predict whether the current real-time image belongs to the event of a pet leash entering the elevator, and the prediction result is saved in the sequential logic buffer; If the current real-time image belongs to a pet leash entering the elevator event, it is determined whether there is a preset percentage of images in the timing logic buffer and the corresponding prediction results all belong to the pet leash entering the elevator event. If so, an alarm signal is output; the timing logic buffer stores the prediction results corresponding to the latest continuous images inside and outside the car in a preset frame.
2. A method for detecting pet traction rope entering a ladder based on semantic analysis according to claim 1, characterized in that: The elements of the pet leash entering the elevator event include: pet leash, pet, elevator door opening status, and elevator entry status; The object labeling means labeling the category of the object; the category labeling of the object includes: pet leash labeling, pet labeling, leash person labeling, elevator door labeling and elevator door opening status labeling.
3. A method for detecting a pet leash entering a ladder based on semantic analysis according to claim 2, characterized in that: The event annotation includes: elevator entry status annotation and timestamp annotation; the timestamp annotation is used to annotate continuous frame images in the pet elevator entry image set; the elevator entry status annotation means using multiple categories of annotations to annotate the elevator entry status; the multiple categories of annotations include: entering the elevator, exiting the elevator and stationary state.
4. A method for detecting pet traction rope entering a ladder based on semantic analysis according to claim 3, characterized in that: Get the pet elevator image set, including: Real images of pets entering and exiting the elevator are obtained in different real elevator car environments, and the images are preprocessed; an elevator car simulation environment is constructed, and a pet leash entering the elevator event is created in this environment, and a simulation screen when the event occurs is obtained, that is, an image of the pet being pulled in and out of the elevator; a pet entering the elevator image set is constructed using the simulation screen and the preprocessed real images.
5. A method for detecting pet traction rope entering a ladder based on semantic analysis according to claim 4, characterized in that: Preprocess the annotated image set, including: The images in the image set are scaled and unified to a preset pixel size, and data cleaning and enhancement operations are performed on the scaled images.
6. A method for detecting pet traction rope entering a ladder based on semantic analysis according to claim 5, characterized in that: The target network model is obtained by training and testing the deep learning network model through the pet elevator dataset, including: The deep learning network model is trained and tested using the pet entry dataset and loss function to obtain the initial network model. The target network model is obtained by quantifying the weight parameters in the initial network model to obtain the weight values corresponding to each weight parameter, and removing the weight parameters whose weight values are less than the preset values.
