Computer vision-based side-lying pet respiratory rate non-contact detection method and system

By using a computer vision-based non-contact detection method and analyzing pet chest movement with a regular camera, the problem of high cost, complex operation, and poor accuracy of existing pet respiratory rate detection methods is solved, enabling low-cost, easy-to-use, and accurate pet health management.

CN121647642APending Publication Date: 2026-03-13NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511510907.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing methods for detecting pet respiratory rate rely on manual observation and counting, which is labor-intensive and inaccurate. Contact-based detection equipment is expensive and has strict environmental requirements, while non-contact methods are expensive and complex to operate, making them difficult to popularize in home environments.

Method used

A non-contact detection method based on computer vision is adopted, which uses ordinary cameras to collect videos and analyzes the subtle movements of the pet's chest cavity region through computer vision technology. The respiratory frequency is extracted by combining deep learning models and optical flow methods. The process includes video preprocessing, pet region segmentation, ROI localization, and respiratory cycle signal analysis.

Benefits of technology

It enables low-cost, easy-to-use, non-contact pet respiratory rate detection, avoids stress reactions, improves detection accuracy and ease of use, is suitable for home use, and allows for early detection of health abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121647642A_ABST
    Figure CN121647642A_ABST
Patent Text Reader

Abstract

The invention discloses a side-lying pet breathing frequency non-contact detection method and system based on computer vision, and belongs to the technical field of computer vision processing, and the method comprises the following steps: obtaining video stream data containing side-lying breathing of a target pet, and carrying out the preprocessing; utilizing a pre-trained pet image segmentation model to automatically identify and extract a body area of the pet; determining an ROI (Region of Interest) of breathing movement of the side-lying pet; processing and analyzing the light stream information change in the ROI, extracting a periodic signal representing the respiratory movement of the pet, and calculating and outputting the respiratory frequency of the pet; the system comprises an image acquisition module, a pet subject segmentation module, an ROI positioning module, a motion analysis module and a respiration calculation module. According to the method, tiny movement of the pet chest area is analyzed through the computer vision technology, so that the respiratory rate is calculated, the method has the advantages of being non-contact, low in cost, easy to operate and the like, and pet health detection is more convenient and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision processing technology, specifically a non-contact detection method and system for the respiratory rate of a pet lying on its side based on computer vision. Background Technology

[0002] Routine monitoring of pet health is receiving increasing attention, and resting respiratory rate (RRR) is one of the important indicators of pet health. Convenient home monitoring of this indicator helps pet owners detect potential diseases early and intervene in a timely manner. Currently, the measurement of pet respiratory rate mainly relies on manual observation and counting. This method is not only labor-intensive and subjective, but also prone to inaccurate counting due to the pet's lack of cooperation.

[0003] To address the aforementioned issues, existing technologies include both contact and non-contact respiratory detection methods. Contact methods typically require pets to wear a harness or collar with built-in sensors, which can easily cause discomfort and stress in pets. Non-contact methods utilize technologies such as sound, Wi-Fi, radar, and infrared thermal imaging; however, these methods generally suffer from high equipment costs and stringent environmental requirements, making them difficult to integrate into everyday home monitoring scenarios. Therefore, there is an urgent need for a low-cost, easy-to-operate, and readily available non-contact method for detecting pet respiratory rate. Summary of the Invention

[0004] Technical problem solved: To address the shortcomings of existing technologies, this invention provides a non-contact detection method and system for the respiratory rate of pets lying on their side based on computer vision. This method uses a common camera (such as a smartphone camera) to collect video, and analyzes the minute movements of the pet's chest cavity area through computer vision technology to calculate the respiratory rate. It has the advantages of being non-contact, low-cost, and easy to operate, making pet health detection more convenient and efficient, and improving the level of pet health management.

[0005] Technical solution: The present invention provides a non-contact detection method for the respiratory rate of a pet lying on its side based on computer vision, comprising the following steps: Step 1: Acquire video stream data containing the target pet lying on its side breathing, and preprocess the video stream data, including noise reduction and image enhancement; Step 2: Using a pre-trained pet image segmentation model, automatically identify and extract the pet's body regions; Step 3: Determine the Region of Interest (ROI) for the breathing movements of a pet lying on its side from the acquired video stream data; Step 4: Process and analyze the changes in optical flow information within the region of interest (ROI) to extract periodic signals characterizing the pet's respiratory movements; Step 5: Calculate and output the pet's breathing rate based on the acquired periodic signal.

[0006] Preferably, the specific steps for determining the Region of Interest (ROI) in step 3 include: Step 31: Using the pet image segmentation model, distinguish the lying pet from the background to obtain the moving target region; Step 32: Process the moving target region using a target detection model to obtain the bounding box of the pet's chest cavity undulation region, and determine the bounding box region as the ROI (Region of Interest).

[0007] Preferably, the pet image segmentation model is trained based on a first dedicated dataset; the first dedicated dataset contains a large number of original images and mask images of the pet in a side-lying posture, and each mask image has a pixel-level labeled segmentation mask to identify the pet subject and the background area.

[0008] Preferably, the target detection model is trained on a second dedicated dataset; the second dedicated dataset contains a large number of images of the pet's body in a side-lying posture, and the bounding box of the undulating area of ​​its chest cavity is marked in each image; the target detection model is a single-stage target detection model; preferably a YOLO series model.

[0009] Preferably, the pet image segmentation model is a convolutional neural network model based on an encoder-decoder structure with skip connections; more preferably, it is a U-Net model.

[0010] Preferably, the specific steps for extracting the periodic signal characterizing respiratory motion in step 4 include: Step 41: Calculate the optical flow field data between consecutive video frames within the region of interest (ROI); Step 42: Perform temporal superposition of the components of the optical flow vector in the vertical direction to generate a one-dimensional displacement change signal; Step 43: Filter and denoise the displacement change signal.

[0011] Preferably, step 42 involves: performing an arithmetic mean operation on the vertical component values ​​of all pixels within the ROI region of interest to obtain the average vertical motion velocity V representing the entire ROI region of interest in the current frame. y (t); ; V is calculated for each frame in chronological order. y Arrange the (t) to generate a one-dimensional displacement change signal S(t) that varies with time.

[0012] Preferably, step 5 includes the following steps: performing time-domain or frequency-domain analysis on the periodic signal, and determining the breathing frequency by calculating the number of peaks or troughs per unit time, or by observing the frequency corresponding to obvious peaks in the spectrum.

[0013] This invention also discloses a computer vision-based non-contact detection system for the respiratory rate of a pet lying on its side. The system executes the aforementioned non-contact detection method via a mobile terminal. The system includes: Image acquisition module, the image acquisition module is used to acquire video stream data containing the target pet; A pet body segmentation module is used to automatically identify and extract the body regions of the pet using a pre-trained pet image segmentation model; ROI positioning module, the ROI positioning module is used to determine the region of interest for the respiratory movements of a side-lying pet; The motion analysis module is used to process and analyze the changes in optical flow information in the region of interest, and extract the periodic signal characterizing the pet's respiratory movement. A breathing calculation module is used to calculate and output the pet's breathing frequency based on the acquired periodic signal.

[0014] Preferably, the respiratory calculation module is also used to verify the rationality of the calculated respiratory rate. If the result exceeds the normal range of the pet's respiratory rate, a re-detection or error message is issued.

[0015] Compared with the prior art, the present invention achieves the following technical effects: 1. The method of the present invention adopts a non-contact detection technology solution, which uses an ordinary camera (such as a smartphone camera) to collect video, without requiring the pet to wear any device, avoiding stress reactions and improving the comfort of detection; 2. This method can collect data using the camera of ordinary mobile devices (such as mobile phones), resulting in low hardware costs; 3. This method is simple to operate. Users only need to shoot a video of their pet lying on its side. By analyzing the subtle movements of the pet's chest area using computer vision technology, the respiratory rate can be calculated and automatically obtained through an application, making it easy to popularize. 4. This method is highly accurate. Combining deep learning models and optical flow methods, it can effectively extract weak respiratory motion signals, and the calculation results are reliable, making pet health detection more convenient and efficient, and improving the level of pet health management. 5. This method is very suitable for pet owners to use daily in the home environment, which helps to detect health abnormalities early, thereby providing timely intervention and treatment, which is beneficial to the development of pet medical care. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a schematic diagram of the system structure of the present invention; Figure 3 This is a schematic diagram of the method's execution flow. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will be described in conjunction with the accompanying drawings. Figures 1-3 The technical solutions of the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art.

[0018] Example 1: As Figure 1 and Figure 3 As shown, this invention discloses a non-contact detection method for the respiratory rate of a pet lying on its side based on computer vision. This embodiment details the execution flow of the detection method.

[0019] (I) Video Acquisition and Preprocessing: Acquire video stream data containing the target pet's breathing while lying on its side, and preprocess the video stream data, including noise reduction and image enhancement. The specific steps are as follows: Following the prompts on the application interface, the user uses the camera of a mobile smart terminal (such as a mobile phone or tablet) to capture a video stream containing the pet in a side-lying position. To ensure video data quality, it is recommended to maintain a moderate shooting distance and a stable device. After acquiring the video, preprocessing is necessary to improve the accuracy of subsequent analysis.

[0020] Denoising: Gaussian filtering or median filtering algorithms are used to reduce image noise.

[0021] Image enhancement processing: Histogram equalization or contrast-limited adaptive histogram equalization algorithm is used to enhance image contrast and make the pet's outline clearer.

[0022] (II) Pet Body Area Segmentation: Using a pre-trained pet image segmentation model, the body regions of the pet are automatically identified and extracted; the pet image segmentation model is trained based on a first dedicated dataset; the first dedicated dataset contains a large number of original images and mask images of the pet in a side-lying posture, and each mask image has a pixel-level labeled segmentation mask to identify the pet's main body and background regions.

[0023] The specific processing steps are as follows: input the pre-processed video frames into a pre-trained pet image segmentation model, which can automatically identify and accurately segment the pet's body area and separate it from the background.

[0024] In this embodiment, the U-Net model is preferred as the segmentation model. The pet image segmentation model is a convolutional neural network model based on an encoder-decoder structure with skip connections. This model downsamples through the encoder path to extract multi-scale features, then upsamples through the decoder path, and makes skip connections with the feature maps of the corresponding scales of the encoder to recover a high-resolution pet subject segmentation mask.

[0025] (III) Location of regions of interest during respiratory movements: From the acquired video stream data, determine the region of interest (ROI) for the breathing movements of a pet lying on its side (i.e., the thoracic region).

[0026] The specific steps include: using the pet image segmentation model to distinguish the pet lying on its side from the background, obtaining the moving target region. The moving target region is then processed using an object detection model to obtain the bounding box of the pet's chest cavity undulation region, and this bounding box region is determined as the ROI (Region of Interest). The object detection model is trained on a second dedicated dataset; this dataset contains a large number of images of the pet's body in a lying position, and each image includes bounding boxes labeling the undulation region of its chest cavity; the object detection model is a single-stage object detection model, preferably the YOLO series model in this embodiment. The YOLO algorithm divides the image into an S×S grid, with each grid responsible for predicting a certain number of bounding boxes and the confidence and category of objects within these boxes. By completing detection and classification in one step, YOLO far surpasses previous object detection methods in speed, especially in real-time applications.

[0027] (iv) Extraction of respiratory cycle signals: The changes in optical flow information within the region of interest (ROI) are processed and analyzed to extract periodic signals characterizing the pet's respiratory movements. Specific steps include: First, optical flow data between consecutive video frames within the region of interest (ROI) is calculated; the optical flow reflects the direction and velocity of motion of each pixel in the image. Optical flow calculation is based on the assumption of constant brightness, meaning that the grayscale value of the same spatial point remains unchanged across consecutive image frames. The optical flow constraint equation is: ; Among them, I x I y I zLet u be the image grayscale gradient, and v be the optical flow velocity components to be determined. This invention can use algorithms such as Lucas-Kanade to solve for the optical flow velocity components (u,v).

[0028] Secondly, the components of the optical flow vector in the vertical direction are superimposed in time to generate a one-dimensional displacement change signal.

[0029] The processor performs an arithmetic mean operation on the vertical component values ​​of all pixels within the region of interest (ROI) to obtain the average vertical motion velocity V representing the entire ROI in the current frame. y (t); ; Next, V, calculated for each frame, is processed in chronological order. y Arrange the values ​​(t) to generate a one-dimensional displacement change signal S(t) that varies with time. Since the breathing movements of a pet are nearly periodic, the displacement change signal S(t) will exhibit obvious sinusoidal periodic fluctuation characteristics, and one complete cycle of this fluctuation represents one complete breathing process.

[0030] Finally, the displacement change signal S(t) is filtered and denoised to eliminate interference from high-frequency jitter and low-frequency drift.

[0031] (V) Calculation and output of respiratory rate: Based on the acquired periodic signal S(t), the pet's respiratory rate is calculated and output. Specific steps include: The system performs time-domain or frequency-domain analysis on the periodic signal, determining the respiratory rate by calculating the number of peaks or troughs per unit time, or by observing the frequencies corresponding to obvious peaks in the spectrum. Specifically, the time-domain analysis method detects peaks or troughs in S(t), counts the number of cycles per unit time, and calculates the respiratory rate (breaths / minute). The frequency-domain analysis method performs a Fast Fourier Transform on S(t), finds the main peak frequency corresponding to breathing in the spectrum, and converts it into the respiratory rate. The system can use these methods simultaneously or selectively, and can perform cross-validation to improve the accuracy of the results. Finally, the calculated respiratory rate is displayed to the user.

[0032] This invention employs a non-contact detection technology, utilizing ordinary cameras (such as smartphone cameras) to capture video, eliminating the need for pets to wear any devices, thus avoiding stress and improving detection comfort. Data acquisition can be completed using the cameras of ordinary mobile devices (such as mobile phones), resulting in low hardware costs. The method is simple to operate; users only need to record a video of the pet lying on its side, and then use computer vision technology to analyze the subtle movements in the pet's chest area to calculate the respiratory rate. The respiratory rate can then be automatically obtained through an application, making it easy to popularize. The method is highly accurate; combining deep learning models and optical flow methods, it can effectively extract weak respiratory movement signals, providing reliable calculation results and making pet health detection more convenient and efficient, thus improving pet health management. This method is very suitable for pet owners to use daily in the home environment, helping to detect health abnormalities early and provide timely intervention and treatment, which is beneficial to the development of pet medical care.

[0033] Example 2: As Figure 2 As shown, this invention also discloses a non-contact detection system for the respiratory frequency of a side-lying pet based on computer vision. The system executes the aforementioned non-contact detection method via a mobile terminal. The system includes an image acquisition module, a pet body segmentation module, a Region of Interest (ROI) localization module, a motion analysis module, and a respiratory calculation module. The image acquisition module acquires video stream data containing the target pet by calling the camera of a device (such as a mobile phone or tablet). The pet body segmentation module loads and runs a pre-trained pet image segmentation model (such as U-Net) to automatically identify and extract the pet's body regions. The ROI localization module loads and runs a pre-trained target detection model (such as YOLO) to accurately locate the chest cavity fluctuation region within the pet's body region and sets it as the ROI (Region of Interest). The motion analysis module processes and analyzes the changes in optical flow information within the ROI, extracting periodic signals characterizing the pet's respiratory motion and generating and filtering a one-dimensional respiratory displacement signal S(t). The respiratory calculation module performs time-domain or frequency-domain analysis based on the acquired periodic signals to calculate and output the pet's respiratory frequency. The respiratory calculation module also verifies the reasonableness of the calculated respiratory rate. If the result exceeds the normal range of the pet's respiratory rate, it issues a retest or outputs an error message. The system pre-stores the normal respiratory rate range for pets (such as dogs). If the calculated result significantly exceeds this range, it prompts the user with "Detection result is abnormal, remeasurement is recommended" or similar information to improve system reliability and user experience.

[0034] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A non-contact detection method for the respiratory rate of a side-lying pet based on computer vision, characterized in that, Includes the following steps: Step 1: Acquire video stream data containing the target pet lying on its side breathing, and preprocess the video stream data, including noise reduction and image enhancement; Step 2: Using a pre-trained pet image segmentation model, automatically identify and extract the pet's body regions; Step 3: Determine the Region of Interest (ROI) for the breathing movements of a pet lying on its side from the acquired video stream data; Step 4: Process and analyze the changes in optical flow information within the region of interest (ROI) to extract periodic signals characterizing the pet's respiratory movements; Step 5: Calculate and output the pet's breathing rate based on the acquired periodic signal.

2. The non-contact detection method for the respiratory rate of a side-lying pet based on computer vision according to claim 1, characterized in that, Step 3, which involves determining the Region of Interest (ROI), includes the following steps: Step 31: Using the pet image segmentation model, distinguish the lying pet from the background to obtain the moving target region; Step 32: Process the moving target region using a target detection model to obtain the bounding box of the pet's chest cavity undulation region, and determine the bounding box region as the ROI (Region of Interest).

3. The non-contact detection method for the respiratory rate of a side-lying pet based on computer vision according to claim 2, characterized in that, The pet image segmentation model is trained based on a first dedicated dataset; the first dedicated dataset contains a large number of original images and mask images of the pet in a side-lying posture, and each mask image has a pixel-level labeled segmentation mask to identify the pet subject and the background region.

4. The non-contact detection method for respiratory rate of a side-lying pet based on computer vision according to claim 2, characterized in that, The target detection model is trained on a second dedicated dataset; the second dedicated dataset contains a large number of images of the pet's body in a side-lying posture, and the bounding box of the undulating area of ​​its chest cavity is marked in each image; the target detection model is a single-stage target detection model; preferably a YOLO series model.

5. The non-contact detection method for the respiratory rate of a side-lying pet based on computer vision according to claim 3, characterized in that, The pet image segmentation model is a convolutional neural network model based on an encoder-decoder structure with skip connections; preferably, it is the U-Net model.

6. The non-contact detection method for respiratory rate of a side-lying pet based on computer vision according to claim 1, characterized in that, Step 4 involves extracting periodic signals characterizing respiratory movements. Step 41: Calculate the optical flow field data between consecutive video frames within the region of interest (ROI); Step 42: Perform temporal superposition of the components of the optical flow vector in the vertical direction to generate a one-dimensional displacement change signal; Step 43: Filter and denoise the displacement change signal.

7. The non-contact detection method for the respiratory rate of a side-lying pet based on computer vision according to claim 6, characterized in that, The specific process of step 42 is as follows: The vertical component values ​​of all pixels within the ROI region of interest are arithmetically averaged to obtain the average vertical motion velocity V representing the entire ROI region of interest in the current frame. y (t); ; V is calculated for each frame in chronological order. y Arrange the (t) to generate a one-dimensional displacement change signal S(t) that varies with time.

8. The non-contact detection method for the respiratory rate of a side-lying pet based on computer vision according to claim 1, characterized in that, Step 5 includes the following steps: performing time-domain or frequency-domain analysis on the periodic signal, and determining the breathing frequency by calculating the number of peaks or troughs per unit time, or by observing the frequency corresponding to obvious peaks in the spectrum.

9. A non-contact detection system for the respiratory rate of a pet lying on its side based on computer vision, characterized in that, The system is used to perform the non-contact detection method according to any one of claims 1-8, the system comprising: Image acquisition module, the image acquisition module is used to acquire video stream data containing the target pet; A pet body segmentation module is used to automatically identify and extract the body regions of the pet using a pre-trained pet image segmentation model; ROI positioning module, the ROI positioning module is used to determine the region of interest for the respiratory movements of a side-lying pet; The motion analysis module is used to process and analyze the changes in optical flow information in the region of interest, and extract the periodic signal characterizing the pet's respiratory movement. A breathing calculation module is used to calculate and output the pet's breathing frequency based on the acquired periodic signal.

10. The computer vision-based non-contact detection system for the respiratory rate of a side-lying pet according to claim 1, characterized in that, The breathing calculation module is also used to verify the rationality of the calculated breathing frequency. If the result exceeds the normal range of the pet's breathing frequency, a re-detection or error message will be issued.