A pet feeding behavior real-time monitoring and abnormal state early warning method
Patent Information
- Application Number
- CN202611259357.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-09-29
AI Technical Summary
[0004]本申请提供了一种宠物进食行为实时监测与异常状态预警方法,旨在解决现有智能喂食器大多仅聚焦于基于宠物身份的投喂量控制,未对宠物进食过程进行实时监测,更未针对宠物异常进食状态生成预警,而进食行为异常是宠物发生健康问题的核心外在表现,现有技术无法帮助养宠用户及时发现宠物健康异常,未能满足现代养宠的健康管理需求的问题
[0015]本申请通过在多宠物共用同一喂食器的场景下,将进食行为参数准确对应到具体宠物个体,解决了现有仅依靠重量传感器监测无法区分个体的问题,异常进食判断的准确率大幅提升;采用轻量级卷积神经网络实现宠物身份识别,模型参数量小、计算效率高,能够在宠物喂食器的资源受限嵌入式硬件平台上实时运行,满足进食行为实时监测的要求;基于当前宠物自身的历史进食行为模型对比判断异常,能够适配不同宠物的个体进食习惯,异常判断的准确性远高于通用阈值判断的方案,且能够根据异常严重程度生成分级预警并推送用户,帮助用户及时发现宠物健康问题,满足了现代精细化养宠的健康管理需求;整体方案适配现有宠物喂食器的通用硬件架构,不需要额外增加高成本硬件组件,改造成本低,易于工业化生产和推广应用。
Smart Images

Figure CN122842948A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent pet feeding technology, and in particular to a method for real-time monitoring of pet eating behavior and early warning of abnormal conditions. Background Technology
[0002] With the development of the pet economy, the pet ownership rate in modern families is constantly increasing, and people's demand for refined and intelligent pet care is growing. Traditional pet feeders can only achieve timed and quantitative feeding, but they cannot identify the pet's identity or adapt to the different pets' eating needs. They have problems such as indiscriminate feeding and overfeeding, and cannot meet the feeding needs of families with multiple pets.
[0003] With the development of AI vision technology, some smart pet feeders have begun to incorporate convolutional neural network technology to identify pets and then match personalized feeding rules, which has solved the problem of misfeeding multiple pets to some extent. However, most existing smart feeders only focus on controlling the amount of food given based on the pet's identity, without real-time monitoring of the pet's eating process or generating warnings for abnormal eating behavior. Abnormal eating behavior is a core external manifestation of health problems in pets, and current technology cannot help pet owners detect health abnormalities in a timely manner, thus failing to meet the health management needs of modern pet owners. Summary of the Invention
[0004] This application provides a method for real-time monitoring of pet eating behavior and early warning of abnormal conditions, aiming to solve the problem that most existing smart feeders only focus on controlling the amount of food given based on the pet's identity, without real-time monitoring of the pet's eating process, let alone generating early warnings for abnormal eating conditions. However, abnormal eating behavior is a core external manifestation of pet health problems, and existing technologies cannot help pet owners detect pet health abnormalities in a timely manner, thus failing to meet the health management needs of modern pet owners.
[0005] In a first aspect, embodiments of this application provide a method for real-time monitoring of pet eating behavior and early warning of abnormal states, applied to a pet feeder; including: The feeder captures images of the pet through its camera and collects the weight data of the remaining food in the feeder in real time through its weight sensor. The system uses a pre-trained lightweight convolutional neural network model to process the collected pet images, extract the pet's appearance features, and identify the individual pet currently eating. Based on real-time weight data collected by a weight sensor, the system calculates the pet's current eating speed, eating frequency, and remaining food amount. The calculated current eating behavior parameters are compared with the pet's historical eating behavior model to determine if there is any abnormal eating behavior. When abnormal eating behavior is determined, corresponding graded warning information is generated based on the type and severity of the abnormal behavior, and the warning information is sent to the user's mobile terminal application.
[0006] In some embodiments, the step of capturing pet images through the feeder's camera includes: after the feeder's main control unit detects an object entering the feeding area, triggering the camera mounted above the feeder to start capturing images, obtaining a frontal image of the current pet, and outputting the captured image to the image processing module of the main control unit.
[0007] In some embodiments, the real-time acquisition of the weight data of the remaining food in the feeder by the weight sensor includes: controlling the weight sensor to be installed below the feeder's food bowl, acquiring the weight value of the remaining food in the food bowl at fixed intervals, and transmitting the acquired weight value to the calculation module of the main control unit in real time.
[0008] In some embodiments, the process of using a pre-trained lightweight convolutional neural network model to process the acquired pet images, extract pet appearance features, and identify the individual identity of the currently eating pet includes: resizing, normalizing pixel values, correcting illumination, and removing background from the acquired original pet images; inputting the processed images into the pre-trained lightweight convolutional neural network model, which extracts the pet's coat color and body shape features and outputs a high-dimensional feature vector corresponding to the pet; comparing the output feature vector with the feature vectors of registered pets stored in the database one by one, and determining the individual identity of the currently eating pet based on the comparison results.
[0009] In some embodiments, training a lightweight convolutional neural network model includes: loading weights of a pre-trained lightweight convolutional neural network model onto a preset dataset; freezing the bottom convolutional layers of the lightweight convolutional neural network model; replacing the original fully connected classification layer of the lightweight convolutional neural network model with a fully connected layer adapted to the number of registered pets; fine-tuning the model using images of multiple pets in different poses and under different lighting conditions; and performing INT8 quantization compression on the lightweight convolutional neural network model after training to obtain a lightweight convolutional neural network model that can be deployed on an embedded device.
[0010] In some embodiments, the step of calculating the current pet's eating speed, eating frequency, and remaining food amount based on the real-time weight data collected by the weight sensor includes: calculating the total amount of food that the pet has already eaten based on the initial weight data collected when the pet started eating and the real-time weight data collected at the current moment; dividing the total amount of food eaten by the eating time to obtain the current pet's eating speed; counting the number of times the pet starts eating per unit time to obtain the eating frequency; and directly using the currently collected real-time weight data as the current remaining food amount.
[0011] In some embodiments, comparing the calculated current feeding behavior parameters with the historical feeding behavior model of the pet corresponding to the current pet identity to determine whether there is abnormal feeding behavior includes: reading the threshold range of the historical feeding behavior parameters corresponding to the current pet identity, inputting the currently calculated feeding speed and feeding frequency into the corresponding threshold range for matching, and if any parameter exceeds the corresponding threshold range, it is determined that there is abnormal feeding behavior; if all parameters are within the corresponding threshold range, it is determined that the current feeding behavior is normal.
[0012] In some embodiments, when abnormal eating behavior is determined to exist, generating corresponding graded warning information based on the type and severity of the abnormal behavior and sending the warning information to the user's mobile terminal application includes: determining the type of abnormal behavior based on the type of parameter exceeding a threshold, determining the severity level of the abnormality based on the magnitude of the parameter exceeding the threshold, generating warning information of the corresponding level according to a preset correspondence, and pushing the warning information to the mobile terminal application bound to the user's account for display via a wireless network.
[0013] In some embodiments, the method further includes: after identifying the individual identity of the currently feeding pet, reading the age and weight data of the current pet stored in advance, adjusting the feeding amount for the next feeding of the current pet in combination with the actual amount of food consumed in this feeding, updating the feeding plan stored for the corresponding pet, and controlling the feeding execution mechanism to complete the subsequent feeding action according to the updated feeding plan.
[0014] In some embodiments, the method further includes: comparing the identified current pet individual identity with the historical single-time food intake range of the corresponding pet; if the current single-time food intake exceeds the corresponding range, then re-extracting features and identifying the pet image and updating the identification result.
[0015] This application solves the problem of existing methods that rely solely on weight sensors and cannot distinguish individual pets when multiple pets share the same feeder. This significantly improves the accuracy of abnormal feeding detection. A lightweight convolutional neural network is used for pet identification, resulting in a small model parameter set and high computational efficiency. It can run in real-time on resource-constrained embedded hardware platforms of pet feeders, meeting the requirements for real-time monitoring of feeding behavior. Anomaly detection is based on comparison with the pet's historical feeding behavior model, adapting to the individual feeding habits of different pets. The accuracy of anomaly detection is far higher than that of general threshold-based solutions. Furthermore, it can generate tiered alerts based on the severity of the anomaly and push them to users, helping them promptly identify pet health problems and meeting the needs of modern, sophisticated pet health management. The overall solution is compatible with the general hardware architecture of existing pet feeders, requiring no additional high-cost hardware components, resulting in low modification costs and ease of industrial production and widespread application.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart illustrating the steps of a method for real-time monitoring and abnormal status early warning of pet eating behavior provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a feeder provided in one embodiment of this application; Figure 3 This is a schematic block diagram of a real-time monitoring and abnormal state early warning system for pet eating behavior provided in one embodiment of this application; Figure 4 This is a schematic block diagram of the structure of a feeder provided in one embodiment of this application.
[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0022] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0023] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0024] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0025] With the development of the pet economy, the pet ownership rate in modern families is constantly increasing, and people's demand for refined and intelligent pet care is growing. Traditional pet feeders can only achieve timed and quantitative feeding, but they cannot identify the pet's identity or adapt to the different pets' eating needs. They have problems such as indiscriminate feeding and overfeeding, and cannot meet the feeding needs of families with multiple pets.
[0026] With the development of AI vision technology, some smart pet feeders have begun to incorporate convolutional neural network technology to identify pets and then match personalized feeding rules, which has solved the problem of misfeeding multiple pets to some extent. However, most existing smart feeders only focus on controlling the amount of food given based on the pet's identity, without real-time monitoring of the pet's eating process or generating warnings for abnormal eating behavior. Abnormal eating behavior is a core external manifestation of health problems in pets, and current technology cannot help pet owners detect health abnormalities in a timely manner, thus failing to meet the health management needs of modern pet owners.
[0027] A few technical solutions involving feeding monitoring rely solely on weight sensors to collect overall feeding data. This makes it impossible to establish a correlation between feeding data and specific individual pets. In scenarios where multiple pets share the same feeder, it is impossible to accurately obtain the feeding parameters of each pet, resulting in extremely poor accuracy of monitoring results and making them impractical for real-world applications. Most existing pet recognition solutions use traditional convolutional neural network models with large parameters and high computational complexity. These models cannot run in real time on resource-constrained embedded hardware platforms of pet feeders, resulting in high inference latency and failing to support the real-time monitoring needs of feeding behavior.
[0028] To solve the above problem, please refer to Figure 1 This application provides a method for real-time monitoring of pet eating behavior and early warning of abnormal states, applicable to, for example... Figure 2 The feeder shown is an example. It should also be noted that all information involved in the method provided in this application was extracted with the authorization of the relevant user and in accordance with relevant regulations, and will not infringe on user privacy.
[0029] The provided method for real-time monitoring of pet eating behavior and early warning of abnormal conditions includes steps S101 to S103. Details are as follows: Step S101. Collect images of the pet through the camera of the feeder, and collect the weight data of the remaining food in the feeder in real time through the weight sensor.
[0030] Specifically, in this step, image acquisition involves mounting a camera on the inner top plate above the food bowl area of the smart feeder. The camera lens is aimed at the area where the pet is standing above the food bowl, allowing for stable acquisition of frontal images of the pet's head and torso. The feeder's main control unit controls the camera to maintain a low-power preview mode, outputting one low-resolution preview image per second. The main control unit uses frame difference detection to check if any moving objects enter the preset feeding area in the preview image. When three consecutive preview images detect valid moving objects, it is determined that a pet has entered the feeding area, triggering the camera to output a full-resolution original pet image. The acquired original image is cached in the main control unit's memory space for subsequent identification processing.
[0031] In this step, weight data acquisition utilizes a strain gauge resistance weight sensor, which is fixedly installed between the food bowl support bracket and the feeder base. The weight of the food bowl and all the food within it is applied to the weight sensor. The feeder has undergone tare calibration at the factory, and the weight of the empty food bowl collected by the sensor is pre-calculated as the tare weight. The output value corresponds only to the weight of the remaining food in the bowl. During data acquisition, the main control unit controls the weight sensor to complete a weight acquisition every 100 milliseconds. Each acquisition continuously obtains three weight readings, and the average of the three readings is output to eliminate acquisition errors caused by factors such as pet touching the food bowl or feeder vibration. The processed real-time weight data is stored in the main control unit's runtime cache for subsequent feeding parameter calculations. After each automatic feeding action, the main control unit automatically updates the current weight data to the initial remaining weight, preparing for the weight calculation of the next feeding process.
[0032] Step S102. Use a pre-trained lightweight convolutional neural network model to process the collected pet images, extract the pet's appearance features, and identify the individual identity of the pet currently eating; calculate the current pet's eating speed, eating frequency, and remaining food amount based on the real-time weight data collected by the weight sensor.
[0033] Specifically, the pet identification system based on a lightweight convolutional neural network retrieves the original pet image acquired in step S101 from the cache through the main control unit. The original image is then preprocessed as follows: First, based on the coordinates of the feeding area obtained from motion detection, the original image is cropped to remove irrelevant areas such as the feeder border and background desktop, retaining only the effective area containing the pet. Second, the cropped effective image is scaled and adjusted to the fixed input size required by the lightweight convolutional neural network. Third, the image pixel values are normalized, mapping the range of pixel values for each channel of the original RGB image from 0 to 255 to 0 to 1, adapting to the model's input requirements. Fourth, histogram equalization is used to correct the image's illumination, eliminating the impact of excessively dark or bright image brightness on feature extraction under different lighting conditions.
[0034] After preprocessing, the image is input into a pre-trained lightweight convolutional neural network model. In this embodiment, the lightweight convolutional neural network adopts the MobileNetV1 architecture based on a depthwise separable convolution structure. This architecture replaces the standard convolution of traditional convolutional neural networks with depthwise convolution and pointwise convolution. Compared with traditional convolutional neural networks of the same precision, the number of parameters is reduced by about 75%, and the computational load is reduced by about 80%, enabling fast inference on the resource-constrained embedded main control unit of the feeder. The training process of the model is as follows: After the user completes the pet registration stage, at least 100 images of each pet to be identified in the user's home under different poses and lighting conditions are collected to construct a personalized training dataset; the backbone network weights pre-trained on the ImageNet public dataset are loaded, the bottom general feature extraction layer of the model is frozen, and only the top fully connected classification layer corresponding to the number of registered pets is replaced and trained to complete the model fine-tuning; after fine-tuning, the entire model is compressed using INT8 quantization, compressing the model size to about one-quarter of that of a floating-point model, further reducing storage usage and inference latency. After training, the model inference time for a single image does not exceed 100 milliseconds, which can meet the requirements of real-time recognition.
[0035] The model outputs the classification confidence score for each registered pet. The classification result with the highest confidence score and a confidence score value greater than 90% of the preset threshold is selected as the individual identification result of the currently feeding pet. If the confidence scores of all classification results are lower than 90%, a new pet registration prompt is generated and pushed to the user's mobile terminal application to guide the user to complete the new pet registration.
[0036] Feeding behavior parameters calculated based on real-time weight data are determined by recording the current time as the start time of the feeding process and the current weight as the initial remaining weight for the feeding process after pet identification is completed. The parameter calculation process for real-time weight data collected at any given time is as follows: Calculate the total amount of food consumed so far: The total amount of food consumed is equal to the initial remaining weight minus the current real-time remaining weight. If the weight change is less than the preset error threshold of 5 grams, the change is determined to be an error caused by the pet touching the pet, and the total amount of food consumed is not updated. Calculate the eating speed: The eating speed is equal to the total amount of food consumed so far divided by the duration of the current eating process from the start to the current moment; Calculate feeding frequency: Feeding frequency is the average number of times the pet eats per day within the current statistical period. The statistical period is set to the past 7 days. After each complete feeding process, the number of feedings within the statistical period is updated, and the average number of feedings per day is recalculated to obtain the current feeding frequency. Determine the remaining food quantity: The real-time weight data collected and processed by the weight sensor at the current moment is directly used as the current remaining food quantity.
[0037] Step S103. Compare the calculated current eating behavior parameters with the pet's historical eating behavior model to determine if there is any abnormal eating behavior; when abnormal eating behavior is determined to exist, generate corresponding graded warning information based on the type and severity of the abnormal behavior, and send the warning information to the user's mobile terminal application.
[0038] Specifically, firstly, a historical feeding behavior model is constructed for each pet: After a user completes the registration of a new pet, data on the feeding speed, feeding frequency, and single feeding amount of the pet during all normal feeding processes are collected continuously for 7 days. The 95% confidence interval of each parameter is obtained as the normal range of that parameter. The normal range of all parameters is stored as the historical feeding behavior model of the pet. The model is stored in the local storage module of the feeder and simultaneously synchronized to the cloud storage space bound by the user. Each time new normal feeding data is generated, the parameter range of the model is updated weekly to ensure that the model adapts to the normal changes in the pet's feeding habits.
[0039] Secondly, the abnormal eating behavior is judged by inputting the three parameters of eating speed and eating frequency of the current eating process calculated in step S102 into the current pet's historical eating behavior model one by one, and judging whether each parameter exceeds the corresponding normal range. If any parameter exceeds the corresponding normal range, it is determined that there is abnormal eating behavior in this feeding. If all parameters fall within the corresponding normal range, it is determined that the feeding behavior is normal and no warning needs to be triggered.
[0040] Furthermore, the abnormality classification and early warning information generation determines the type of abnormal behavior based on parameters exceeding the normal range. For example, eating speed below the lower limit of the normal range corresponds to decreased appetite, eating speed above the upper limit of the normal range corresponds to overeating, eating frequency below the lower limit of the normal range corresponds to reduced eating frequency, and eating frequency above the upper limit of the normal range corresponds to increased eating frequency. The severity level of the abnormality is determined based on the extent to which the parameters exceed the normal range. The specific classification rules are as follows: parameters exceeding the normal range by less than 20% are considered mild abnormalities, between 20% and 50% are considered moderate abnormalities, and greater than 50% are considered severe abnormalities. Based on the type and level of abnormal behavior, a graded early warning information containing abnormality prompts, abnormality type, and handling suggestions is generated according to a preset correspondence. The handling suggestion for mild abnormalities is to continuously observe the pet's condition, the handling suggestion for moderate abnormalities is to closely monitor changes in the pet's eating and behavior in the near future, and the handling suggestion for severe abnormalities is to take the pet to a veterinary hospital for examination in a timely manner.
[0041] Finally, the early warning information is pushed through the feeder's main control unit via a wireless communication module connected to the home wireless network. The generated tiered early warning information is then pushed to the mobile application linked to the user's account. Upon receiving the warning information, the mobile application immediately displays a system notification to alert the user and simultaneously stores the warning information in the pet's health record within the application for easy access. Users can view any pet's historical feeding data and historical abnormal warning records through the mobile application to understand changes in their pet's eating habits.
[0042] In some embodiments, the step of capturing pet images through the feeder's camera includes: after the feeder's main control unit detects an object entering the feeding area, triggering the camera mounted above the feeder to start capturing images, obtaining a frontal image of the current pet, and outputting the captured image to the image processing module of the main control unit.
[0043] This embodiment further optimizes and limits the step of capturing pet images through the feeder's camera in the main process. At the hardware level, the high-definition camera is fixedly installed on the inner wall of the top cover directly above the feeding area of the feeder's food bowl using an adjustable universal bracket. The camera lens focal length is preset to 25cm, which is just aimed at the pet's head standing area when eating, ensuring that a clear and complete frontal image of the pet is captured. The camera communicates with the feeder's main control unit through the MIPI bus. In normal standby mode, it maintains a low-power sleep mode and only outputs a low-resolution preview stream of 1fps for motion detection.
[0044] At the trigger acquisition process level, the detection module of the feeder's main control unit processes the preview stream in real time based on the ViBe background modeling algorithm to detect whether a new object has entered the feeding area: when five consecutive preview frames detect a foreground outline area greater than a preset threshold (the preset threshold is set to 5000 pixels, corresponding to objects larger than 10cm×10cm, which can exclude minor interferences such as falling insects and shaking debris), it is determined that an object has entered the feeding area. A trigger signal is then output to wake up the camera, which switches to full-resolution working mode and captures a 224×224 resolution color image of the current pet's front. After acquisition, the original image is directly transferred via DMA to the image processing module's cache in the main control unit's DDR memory for subsequent identity recognition processes. After acquisition, the camera automatically switches back to low-power preview mode, reducing the feeder's overall standby power consumption. This trigger acquisition mechanism ensures timely image acquisition while effectively reducing device power consumption and extending the feeder's battery life.
[0045] In some embodiments, the real-time acquisition of the weight data of the remaining food in the feeder by the weight sensor includes: controlling the weight sensor to be installed below the feeder's food bowl, acquiring the weight value of the remaining food in the food bowl at fixed intervals, and transmitting the acquired weight value to the calculation module of the main control unit in real time.
[0046] This embodiment further optimizes and limits the step of real-time collection of the weight data of the remaining food in the feeder through weight sensors in the main process. In terms of hardware installation, this embodiment uses three cylindrical strain gauge weight sensors with a range of 0-5kg and an accuracy of 1g, respectively installed between the three supporting feet of the feeding bowl and the main base of the feeder. The total weight of the feeding bowl and the food inside is entirely applied to the three weight sensors. The output signals of the three sensors are collectively input into a 12-bit AD sampling module to output the total weight. After installation, a standardized tare calibration is performed at the factory: after the empty feeding bowl is placed stably, 10 weight readings are continuously collected and the average value is taken. This average value is stored as the tare weight in the main control unit. In subsequent actual data collection, the total weight is automatically reduced by the tare weight, and the output value corresponds only to the weight of the remaining food in the feeding bowl, completely eliminating the influence of the feeding bowl's own weight on the measurement results.
[0047] At the data acquisition stage, the main control unit's calculation module outputs AD sampling trigger signals at fixed intervals, preferably 100ms. Every 100ms, the three weight sensors are controlled to synchronously complete one weight acquisition. The AD module converts the acquired analog signal into a digital weight value. After eliminating random errors caused by the pet touching the food bowl or equipment vibration through a moving average filter, the processed remaining food weight value is written to the shared buffer of the main control unit's calculation module in real time for subsequent feeding parameter calculation processes, thus achieving stable and real-time updates of weight data.
[0048] In some embodiments, the process of using a pre-trained lightweight convolutional neural network model to process the acquired pet images, extract pet appearance features, and identify the individual identity of the currently eating pet includes: resizing, normalizing pixel values, correcting illumination, and removing background from the acquired original pet images; inputting the processed images into the pre-trained lightweight convolutional neural network model, which extracts the pet's coat color and body shape features and outputs a high-dimensional feature vector corresponding to the pet; comparing the output feature vector with the feature vectors of registered pets stored in the database one by one, and determining the individual identity of the currently eating pet based on the comparison results.
[0049] This embodiment further optimizes and limits the steps in the main process of using a pre-trained lightweight convolutional neural network model to process the acquired pet images, extract pet appearance features, and identify the individual identity of the currently feeding pet. After the image processing module of the main control unit acquires the acquired original pet image, it performs standardized preprocessing operations in sequence: The first step is to remove the background. Based on the GrabCut image segmentation algorithm, the pet foreground in the original image is separated from the background such as the feeder and the table, retaining only the foreground area where the pet is located, and removing the interference of redundant background information on feature extraction; The second step is to adjust the size. The segmented pet foreground area is uniformly scaled and filled to a fixed input size of 224×224 required by the lightweight convolutional neural network; The third step is to normalize the pixel value. The pixel value of each channel of the original RGB image is mapped from the [0,255] interval to the [0,1] interval, which accelerates the convergence speed of model inference and improves computational stability; The fourth step is to perform illumination correction. Based on the Limiting Contrast Adaptive Histogram Equalization (CLAHE) algorithm, the image contrast is adjusted to eliminate the influence of different lighting environments such as backlight, dark light, and strong light on the brightness of the pet's appearance, and improve the stability of feature extraction.
[0050] After preprocessing, the image is input into a pre-trained lightweight convolutional neural network model. The model sequentially extracts the pet's low-level edge features, mid-level texture features, and high-level semantic features through multiple convolutional structures, ultimately outputting a 128-dimensional high-dimensional feature vector corresponding to the input image. This feature vector fully encompasses the core appearance features that distinguish different individuals, such as the pet's coat color, body shape, and facial contours. Subsequently, the output 128-dimensional feature vector is compared with the average feature vector of all registered pets stored in the feeder's storage module database using cosine similarity calculation. The registered pet with the highest cosine similarity (greater than 0.85) is selected as the individual identification result for the currently feeding pet. If the highest similarity is lower than 0.85, the pet is determined to be an unknown pet, and a new pet registration prompt is automatically pushed to the user's mobile terminal, guiding the user to complete the new pet registration.
[0051] In some embodiments, training a lightweight convolutional neural network model includes: loading weights of a pre-trained lightweight convolutional neural network model onto a preset dataset; freezing the bottom convolutional layers of the lightweight convolutional neural network model; replacing the original fully connected classification layer of the lightweight convolutional neural network model with a fully connected layer adapted to the number of registered pets; fine-tuning the model using images of multiple pets in different poses and under different lighting conditions; and performing INT8 quantization compression on the lightweight convolutional neural network model after training to obtain a lightweight convolutional neural network model that can be deployed on an embedded device.
[0052] This embodiment further optimizes and limits the steps of training the lightweight convolutional neural network model in this invention. In the pre-training weight loading stage, the MobileNetV2 lightweight convolutional neural network skeleton, which has been pre-trained on the ImageNet1000 class of public general datasets, is selected, and the pre-trained backbone network weights are loaded. These pre-trained weights have learned the ability to extract basic features such as general image edges and textures, which can significantly reduce the computational amount of subsequent fine-tuning training, shorten the model training time, and adapt to the needs of completing lightweight training on the user end.
[0053] During the network structure adjustment phase, all parameters of the bottom convolutional layers from the input layer to the penultimate convolutional layer are frozen. The weights of the bottom convolutional layers are not updated during training, thus preserving the general feature extraction capability obtained from pre-training. The original fully connected classification layer for the ImageNet dataset is removed and replaced with a fully connected layer with a 128-dimensional output. This 128-dimensional output corresponds to the feature vector of each individual pet, which can adapt to the recognition needs of any number of registered pets. It does not require adjusting the output dimension according to the number of pets registered by the user, thus adapting to the expansion needs of multi-pet families.
[0054] During the fine-tuning training phase, sample images of each pet in different poses (front, side, head up, head down) and under different lighting conditions (sunny daytime natural light, nighttime artificial light, backlight) were collected during user registration. At least 50 sample images were collected for each pet, and the training set and validation set were constructed by splitting them in an 8:2 ratio. The triplet loss function was used to train the model, so that the feature vector distance between different images of the same pet is as small as possible, and the feature vector distance between images of different pets is as large as possible, thereby improving feature discrimination. During the training process, only the parameters of the newly added fully connected layers were updated. After 50 epochs of fine-tuning training, the training was stopped when the accuracy of the validation set reached the requirement, and the final model with floating-point precision was obtained.
[0055] During the quantization and compression deployment phase, the TensorRT inference framework is used to perform INT8 quantization calibration on the trained floating-point model. 100 calibration images collected by the user are used to calibrate the model activation values, and the 32-bit floating-point weights are converted into 8-bit integer weights. Finally, the model size is compressed to 1 / 4 of the original floating-point model, and the inference speed is improved by 2-3 times. A lightweight convolutional neural network model that can be directly deployed and run on the ARM architecture embedded main control unit of the feeder is obtained. The inference time for a single image is less than 100ms, which fully meets the requirements of real-time recognition.
[0056] In some embodiments, the step of calculating the current pet's eating speed, eating frequency, and remaining food amount based on the real-time weight data collected by the weight sensor includes: calculating the total amount of food that the pet has already eaten based on the initial weight data collected when the pet started eating and the real-time weight data collected at the current moment; dividing the total amount of food eaten by the eating time to obtain the current pet's eating speed; counting the number of times the pet starts eating per unit time to obtain the eating frequency; and directly using the currently collected real-time weight data as the current remaining food amount.
[0057] This embodiment further optimizes and limits the steps in the main process of calculating the pet's current eating speed, eating frequency, and remaining food amount based on real-time weight data collected by the weight sensor. After the pet's individual identity is identified, the current timestamp is recorded as the start time t0 of this eating process, and the remaining weight collected by the weight sensor at the current time is recorded as the initial weight W0 of this eating process, thus completing the initial parameter recording. For any real-time weight Wt collected at the current time t, each eating behavior parameter is calculated sequentially: Calculate the total amount of food consumed ΔW: The calculation formula is ΔW=W0-Wt. Since the weight sensor has an inherent acquisition error of less than 1g, this embodiment sets an error threshold of 5g. If ΔW is less than 5g, it is determined that the weight change is a random error caused by the pet shaking the food bowl, and the current ΔW value is not updated; if ΔW is greater than or equal to 5g, the calculated ΔW is retained as the current total amount of food consumed. Calculate feeding speed v: Feeding speed is the amount of food a pet eats per unit time. The formula is v=ΔW / (t-t0), and the unit is g / min. Feeding speed v is recalculated every time ΔW is updated to achieve real-time updates of feeding speed. Calculate the feeding frequency f: The feeding frequency is the number of times the pet eats per unit time within the statistical period. In this embodiment, the statistical period is set to the most recent 7 days. The number of complete feedings completed by the current pet in the most recent 7 days is divided by the number of days in the statistical period, 7, to obtain the feeding frequency f in units of times / day. Each time the current pet completes a complete feeding, the number of feedings in the statistical period is updated, and the feeding frequency f is recalculated to ensure that the feeding frequency can reflect the recent changes in the pet's eating habits. Determine the remaining food amount W The current remaining food quantity W is directly taken from the real-time weight Wt obtained by the weight sensor at the current time t after error processing. The output is provided for users to view and for subsequent anomaly detection.
[0058] The parameter calculation logic in this embodiment is simple and clear, with a small amount of computation, and is compatible with the computing power of the embedded main control unit. At the same time, it can accurately reflect the pet's current eating status in real time, providing a reliable data foundation for subsequent anomaly judgment.
[0059] In some embodiments, said comparing the calculated current eating behavior parameters with the historical eating behavior model of the pet with the corresponding identity to determine whether there is abnormal eating behavior comprises: reading the threshold range of historical eating behavior parameters corresponding to the current pet identity, inputting the currently calculated eating speed and eating frequency into the corresponding threshold ranges for matching respectively. If any parameter exceeds the corresponding threshold range, it is determined that there is currently abnormal eating behavior; if all parameters are within the corresponding threshold ranges, it is determined that the current eating behavior is normal.
[0060] This embodiment further optimizes and defines the step of comparing the calculated current eating behavior parameters with the historical eating behavior model of the pet with the corresponding identity and determining whether there is abnormal eating behavior in the main process. Each registered pet is correspondingly stored with an independent historical eating behavior model, and the model stores the normal threshold ranges corresponding to the two parameters of eating speed and eating frequency during the pet's historical normal eating process. The threshold range is an interval of average value ± 2 times standard deviation obtained by counting all normal eating data of the pet in the past 30 days, which can cover more than 95% of normal eating fluctuations, and takes into account both the sensitivity of abnormal identification and the ability to resist interference from normal fluctuations.
[0061] After the abnormality judgment process completes the parameter calculation of the current eating process, the main control unit first reads the historical eating behavior model corresponding to the currently identified individual pet identity from the storage module, and extracts the normal threshold range of eating speed [v_min,v_max] and the normal threshold range of eating frequency [f_min,f_max] stored in the model. Then, the currently calculated eating speed v and eating frequency f are matched with the corresponding threshold ranges respectively: if v<v_min or v>v_max, it is determined that the eating speed parameter exceeds the threshold range; if f<f_min or f>f_max, it is determined that the eating frequency parameter exceeds the threshold range. The final judgment rule is: as long as any parameter exceeds the corresponding threshold range, it is determined that the current pet has abnormal eating behavior; only when both the eating speed and the eating frequency fall within the corresponding threshold ranges, it is determined that the current eating behavior is normal, and no early warning is required.
[0062] This embodiment generates a personalized threshold range based on each individual pet's own historical eating habits. Compared with the industry general fixed threshold solution, it can adapt to the differences in individual eating habits of different pets, greatly improve the accuracy of abnormality judgment, and effectively reduce the probability of false alarms and missed alarms.
[0063] In some embodiments, when abnormal eating behavior is determined to exist, generating corresponding graded warning information based on the type and severity of the abnormal behavior and sending the warning information to the user's mobile terminal application includes: determining the type of abnormal behavior based on the type of parameter exceeding a threshold, determining the severity level of the abnormality based on the magnitude of the parameter exceeding the threshold, generating warning information of the corresponding level according to a preset correspondence, and pushing the warning information to the mobile terminal application bound to the user's account for display via a wireless network.
[0064] This embodiment further optimizes and limits the step in the main process of generating corresponding graded warning information based on the type and severity of abnormal eating behavior and sending the warning information to the user's mobile terminal application when abnormal eating behavior is detected. The abnormal behavior type is determined by pre-establishing a correspondence between abnormal types and parameters exceeding thresholds. The corresponding rules are: eating speed below the lower limit → abnormal decrease in appetite; eating speed above the upper limit → abnormal binge eating; eating frequency below the lower limit → abnormal decrease in the number of meals; eating frequency above the upper limit → abnormal increase in the number of meals. The corresponding abnormal behavior type is directly matched based on the parameter type that exceeds the current threshold. When multiple parameters exceed the threshold in the same eating process, all abnormal types are included in the warning information. The severity level of an anomaly is determined by calculating the magnitude by which a parameter exceeds a threshold. The formula for calculating the magnitude is as follows: If the parameter is below the lower limit, the magnitude = (lower limit of parameter threshold - current parameter value) / lower limit of parameter threshold × 100%; if the parameter is above the upper limit, the magnitude = (current parameter value - upper limit of parameter threshold) / upper limit of parameter threshold × 100%. When multiple anomalies exist in the same process, the level corresponding to the largest magnitude is taken as the final anomaly level. The grading rules are preset as follows: magnitude less than 20% → mild anomaly, 20% ≤ magnitude < 50% → moderate anomaly, magnitude ≥ 50% → severe anomaly. The system generates tiered early warning messages based on preset templates. For mild anomalies, the message includes the anomaly type and states, "Your pet's eating behavior is slightly abnormal; we recommend continued observation of its mental and activity levels." For moderate anomalies, the message includes the anomaly type and states, "Your pet's eating behavior is significantly abnormal; please closely monitor its eating and bowel movements in the coming days." For severe anomalies, the message includes the anomaly type and states, "Your pet's eating behavior is severely abnormal; we recommend taking it to a reputable veterinary hospital for a health check as soon as possible." The feeder's main control unit connects to the home wireless network via its built-in Wi-Fi module and transmits the generated warning information to the cloud server via the MQTT protocol. The cloud server then pushes the warning information to the user's mobile application logged into that account, based on the user account linked to the feeder. Upon receiving the warning information, the mobile application immediately triggers a system-level notification pop-up to remind the user and simultaneously stores the warning information in the corresponding pet's health record module within the application, allowing the user to view historical warning records at any time.
[0065] The tiered early warning mechanism in this embodiment can promptly remind users to pay attention to abnormal pet health, without excessively disturbing users due to minor abnormalities, thus effectively improving the user experience.
[0066] In some embodiments, the method further includes: after identifying the individual identity of the currently feeding pet, reading the age and weight data of the current pet stored in advance, adjusting the feeding amount for the next feeding of the current pet in combination with the actual amount of food consumed in this feeding, updating the feeding plan stored for the corresponding pet, and controlling the feeding execution mechanism to complete the subsequent feeding action according to the updated feeding plan.
[0067] This embodiment adds a personalized dynamic adjustment step for feeding amount to the main process. After the individual identity of the current pet is identified and the actual amount of food consumed in this feeding process is obtained, the feeding amount adjustment process is executed: The main control unit first reads the basic information of the current pet from the storage module, including the pet's age, breed, basic weight, daily activity level, etc.; based on the preset pet feeding amount calculation model, the recommended daily feeding amount for the pet is calculated in combination with the above basic information; then, based on the actual amount of food consumed in this feeding, the feeding amount for the next feeding is adjusted. The adjustment rules are as follows: if the actual amount of food consumed in this feeding is more than 10% less than the recommended feeding amount, it means that the pet's current appetite is poor, and the feeding amount for the next feeding is reduced by 10%; if the actual amount of food consumed in this feeding is more than 10% more than the recommended feeding amount, it means that the pet's current appetite is increased, and the feeding amount for the next feeding is increased by 5%; if the deviation is within 10%, the original recommended feeding amount remains unchanged.
[0068] After adjustment, the new feeding amount is updated and stored in the corresponding pet's feeding plan. The feeder's main control unit, according to the updated feeding plan, controls the screw-type feeding actuator to output the adjusted feeding amount at the preset feeding time, completing the feeding action. This embodiment can dynamically adjust the feeding amount based on the pet's actual eating habits each time, achieving truly personalized and precise feeding, avoiding pet health problems caused by underfeeding or overfeeding, and further improving the automated management level of the smart feeder.
[0069] In some embodiments, the method further includes: comparing the identified current pet individual identity with the historical single-time food intake range of the corresponding pet; if the current single-time food intake exceeds the corresponding range, then re-extracting features and identifying the pet image and updating the identification result.
[0070] This embodiment adds a cross-validation step for the identity recognition result to the existing identity recognition step. This step is used to correct recognition errors and further improve the system accuracy. After completing the individual pet identity recognition and obtaining the initial recognition result, and after the current feeding process is completed and the current single feeding amount is obtained, the identity verification process is executed: First, the normal range of the pet's historical single feeding amount is read from the historical feeding behavior model corresponding to the current initial identification identity. This range is the 95% confidence interval obtained by statistically analyzing all complete single feeding amounts of the pet in the past 30 days, covering the fluctuation range of most normal single feeding amounts. Then, the current single feeding amount is compared with this range: If the current single feeding amount falls within the range, it means that the initial identity recognition result is correct, and the initial recognition result is retained; If the current single feeding amount exceeds the range, it means that the initial recognition result is likely to be incorrect, and the re-identification process is triggered: The original pet image obtained in step S101 is reread, and the entire process of image preprocessing, feature extraction, and feature comparison is re-executed to obtain a new identity recognition result, which replaces the original initial recognition result. Then, the subsequent feeding parameter calculation and anomaly judgment process are re-executed.
[0071] This embodiment cross-validates the visual identity recognition results using actual food intake data, which can effectively correct identity recognition errors caused by multiple pets having similar appearances, further improve the accuracy of the overall system, and solve the problems of parameter statistical errors and anomaly judgment failures caused by identification errors of pets with similar appearances in multi-pet scenarios.
[0072] For example, this embodiment optimizes the post-verification step of pet individual identification in step S103 above. It mainly solves the technical problem that in the existing pure visual identification scheme, when multiple pets have similar fur color and body shape, identification errors are prone to occur, which leads to errors in subsequent feeding parameter statistics and anomaly judgment. The specific technical content and feasible implementation method are as follows: After each pet completes registration and generates a complete feeding record, this embodiment uses a sliding window mechanism to dynamically update the normal range of the pet's historical single feeding amount. The specific process is as follows: Initial Interval Generation: After a registered pet has accumulated at least 10 complete independent meals, the system extracts the single-meal food intake data from all complete meals within the last 30 days (single-meal food intake refers to the total weight of food consumed by the pet from the start to the end of the meal, i.e., the initial weight at the start of the meal minus the remaining weight after the meal). The mean μ and sample standard deviation σ of this data set are calculated. Using a 95% confidence level, the normal interval is calculated as [μ-1.96σ, μ+1.96σ]. This interval covers over 95% of normal single-meal food intake fluctuations, eliminating false positives caused by occasional fluctuations in food intake. If a pet has accumulated fewer than 10 complete meals, a personalized interval cannot be generated. Instead, a pre-stored general food intake interval for the same breed and weight group is used as the initial temporary interval. This interval is automatically replaced with a personalized interval once 10 valid data points are accumulated.
[0073] Dynamic update mechanism: Each time the current pet completes a full meal and the accurate amount of food consumed in a single meal is obtained, the sliding window automatically removes historical data older than 30 days, adds the new amount of food consumed in the current meal, and recalculates the mean, standard deviation, and confidence interval. This ensures that the interval can be dynamically updated to reflect changes in food consumption due to the pet's age, weight, and activity level, and always adapts to the pet's current eating habits.
[0074] By supporting two triggering mechanisms—early triggering verification during feeding and verification after feeding—this covers different scenario requirements and avoids long-term recognition errors: Early triggering during feeding: If the pet's cumulative food intake has reached the upper limit of the interval corresponding to the initial identified identity, and the pet is still eating, it indicates that the cumulative food intake has exceeded the normal fluctuation range. Cross-validation is triggered immediately, without waiting for feeding to end, correcting recognition errors in advance and preventing continued errors in subsequent parameter statistics. Verification after feeding: If the cumulative food intake after feeding does not exceed the upper limit of the interval, a complete verification is still performed after feeding to exclude recognition errors where the food intake is below the lower limit of the interval (e.g., identifying a large pet as a small pet, where the food intake appears low but is actually a recognition error). The verification comparison rules are: If the actual single-time food intake falls within the confidence interval of the current initial identified identity, the initial identity recognition result is determined to be correct, and the original recognition result is retained for subsequent processes; if the actual single-time food intake exceeds the confidence interval, the initial recognition result is determined to be highly likely to be incorrect, triggering a re-identification process.
[0075] After triggering re-identification, this embodiment adopts a global feature + facial feature fusion recognition scheme to improve recognition accuracy and make up for the defects of single-dimensional feature recognition. By re-retrieving the original pet frontal image collected in step S101, the lightweight pet face detection model based on MTCNN is called to detect the pet's face region in the original image, and cropping a local sub-image containing only the pet's face, removing redundant interference information such as body hair and background. Standardization preprocessing (size adjustment, pixel normalization, illumination correction, the process is the same as in embodiment 3) is performed on the original global pet image and the cropped face sub-image respectively. The global feature vector and facial feature vector are extracted by the lightweight convolutional neural network respectively, and weighted and fused according to a weight of 0.4:0.6 to obtain the final fused feature vector (facial features have a much higher distinguishability for individuals than global coat color and body shape features, so they are given higher weight). The process involves comparing the fused feature vector with the average feature vector of all registered pets in the database using cosine similarity. The pet with the highest similarity score (greater than 0.85) is selected as the new pet identification result. A fallback mechanism is in place: if the new identification result matches the initial result, it indicates that the pet's food intake is indeed abnormal and not an identification error; the pet's identity is retained, and subsequent anomaly warning procedures are triggered. If the new identification result differs from the initial result, the original identification result is replaced, and parameters such as feeding speed and food intake are recalculated using the new identity. The corresponding pet's historical data is updated before proceeding to the next step. If the highest similarity score among all registered pets is still below the 0.85 threshold, this feeding is marked as "suspected unregistered pet," and a notification is pushed to the user's mobile device, guiding the user to complete new pet registration or manually confirm the pet's identity for this feeding, serving as a fallback error correction mechanism.
[0076] In some embodiments, this embodiment addresses the additional weight error caused by the pet's front paws resting on the food bowl and its head leaning against it during the feeding process, specifically the weight acquisition step S102. Existing static calibration methods can only eliminate the food bowl's own weight error, but cannot eliminate the measurement error caused by dynamic additional loads, resulting in inaccurate calculations of remaining weight and food intake. In this embodiment, in addition to the original three main strain gauge weight sensors installed at the bottom of the food bowl, four FSR402 thin-film pressure sensors are added and evenly distributed under the base plate of the pet's feeding standing area. These sensors are connected to the main control unit via an I2C bus to detect the magnitude and location of the pressure exerted by the pet's front paws on the standing base plate in real time.
[0077] During the offline calibration phase before shipment, the compensation model is trained by simulating pets with different weights of front paws (from 50g to 500g, in 50g intervals) placed around the food bowl at different positions (X-direction from -10cm to +10cm, in 2cm intervals, and the same applies to the Y-direction). The original readings of the main weight sensor are recorded for each scenario with an empty food bowl (zero food state). The deviation between the original readings and the actual zero weight is calculated, and a training dataset containing the total pressure F, the distance D from the pressure center to the center of the food bowl, and the deviation value ΔW is obtained. A lightweight linear regression compensation model is trained: ΔW=a*F+b*D+c, where a, b, and c are the model coefficients obtained from the training. After training, the model coefficients are stored in the non-volatile storage of the main control unit for real-time compensation.
[0078] In actual use, each time the remaining food weight is collected from the main weight sensor in step S102, the following compensation steps are executed simultaneously: The real-time outputs of the four thin-film pressure sensors are read, and the total pressure F exerted by the pet's front paws on the standing base is obtained. The coordinates of the pressure center are calculated, and the Euclidean distance D from the pressure center to the center of the food bowl is obtained. F and D are input into the pre-trained compensation model to obtain the current deviation compensation value ΔW. A distance correction coefficient is introduced to adapt to different paw positions: If D < 5cm, it means the pet's paws are already on the food bowl body, resulting in a larger additional load; the correction coefficient k is set to 1.2, and the compensation deviation is adjusted to k*ΔW. If 5cm ≤ D ≤ 10cm, it means the paws are at the edge of the food bowl; the correction coefficient k is set to 1.0. If D > 10cm, it means the pet's paws are completely in the standing area and not in contact with the food bowl; the correction coefficient k is set to 0, and no compensation is needed. The final corrected remaining food weight is: Wcorrected = Woriginal - k*ΔW. The corrected weight replaces the original reading for subsequent feeding parameter calculations and anomaly detection.
[0079] Actual testing showed that without the compensation method described in this embodiment, the average weight error caused by a pet's paw resting on the food bowl was 12g, with a maximum error of 30g, which could significantly affect the statistical results of a single feeding. After using the compensation method described in this embodiment, the average error was reduced to 1.8g, with a maximum error of no more than 5g. The weight measurement accuracy was improved by more than 6 times, providing an accurate data basis for subsequent feeding parameter calculations and anomaly detection.
[0080] In some embodiments, this embodiment addresses the training and update stage of the lightweight convolutional neural network model in step S103, resolving the dual shortcomings of existing local training schemes, such as insufficient computing power of embedded devices and slow model convergence, and cloud-based centralized training schemes, which require uploading user pet images and infringe on user privacy. This embodiment complies with current regulatory requirements for personal information protection. It adopts a horizontal federated learning framework, with cloud parameter servers and multiple user-end feeder embedded devices participating. All users can freely choose whether to join federated learning. The original pet images of users who choose to join are always stored on the local feeder and are not uploaded to the cloud. Only the encrypted model gradients are uploaded, fully protecting user privacy. Users can exit federated learning at any time.
[0081] The initial model deployment was carried out by all feeders. The model was the INT8 quantized lightweight convolutional neural network model obtained in Example 4. The backbone network was MobileNetV2 pre-trained on ImageNet, and the fully connected layer was a 128-dimensional output layer adapted for local recognition.
[0082] Local incremental fine-tuning works by collecting at least 50 sample images of a pet in different poses and lighting conditions locally when a user registers a new pet. Only the fully connected layers of the model are fine-tuned locally, while the backbone network parameters are frozen and not updated. This reduces local computational consumption while preserving the general feature extraction capabilities obtained from pre-training. After training, the gradient for updating the fully connected layer parameters is calculated, encrypted using the Paillier homomorphic encryption algorithm, and then uploaded to the cloud parameter server. Throughout the entire process, the original pet images are always stored locally and do not go out of domain, fully protecting user privacy.
[0083] Cloud-based gradient aggregation collects encrypted gradients uploaded by all federated learners every 7 days through a cloud parameter server. The FedAvg averaging algorithm is used to perform a weighted average aggregation of all gradients to obtain the updated global fully connected layer parameters. The parameter changes compared to the previous global model are then extracted and compressed using gzip to obtain an incremental update package. The update package size is usually only 100KB-500KB, which will not consume too much of the user's home bandwidth.
[0084] Local incremental updates automatically request model updates from the cloud daily via the user-side feeder. If a new update package is available, the parameters of the local model are updated incrementally after downloading. This upgrades the model without retraining or requantizing, thus continuously improving recognition accuracy.
[0085] The privacy opt-out mechanism allows users to choose to exit federated learning at any time through the mobile application. Once exited, gradient uploads will stop immediately, and no more cloud model updates will be received. All subsequent model training will be completed locally, fully respecting the user's right to privacy.
[0086] Please see Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of the pet eating behavior real-time monitoring and abnormal state early warning system 200 provided in this application embodiment. The pet eating behavior real-time monitoring and abnormal state early warning system 200 is used to execute the steps of the pet eating behavior real-time monitoring and abnormal state early warning method shown in the above embodiments. The pet eating behavior real-time monitoring and abnormal state early warning system 200 can be a single server or a server cluster, or it can be a terminal, such as a handheld terminal, laptop computer, wearable device, or robot.
[0087] like Figure 3 As shown, the pet eating behavior real-time monitoring and abnormal status early warning system 200 includes: The image acquisition unit 201 is used to acquire images of the pet through the camera of the feeder and to acquire the weight data of the remaining food in the feeder in real time through the weight sensor. The data computing unit 202 is used to process the collected pet images using a pre-trained lightweight convolutional neural network model, extract the pet's appearance features, and identify the individual identity of the pet currently eating; and to calculate the current pet's eating speed, eating frequency, and remaining food amount based on the real-time weight data collected by the weight sensor. The early warning sending unit 203 is used to compare the calculated current eating behavior parameters with the pet's historical eating behavior model to determine whether there is abnormal eating behavior; when abnormal eating behavior is determined to exist, it generates corresponding graded early warning information according to the type and severity of the abnormal behavior, and sends the early warning information to the user's mobile terminal application.
[0088] In some embodiments, the step of capturing pet images through the feeder's camera includes: after the feeder's main control unit detects an object entering the feeding area, triggering the camera mounted above the feeder to start capturing images, obtaining a frontal image of the current pet, and outputting the captured image to the image processing module of the main control unit.
[0089] In some embodiments, the real-time acquisition of the weight data of the remaining food in the feeder by the weight sensor includes: controlling the weight sensor to be installed below the feeder's food bowl, acquiring the weight value of the remaining food in the food bowl at fixed intervals, and transmitting the acquired weight value to the calculation module of the main control unit in real time.
[0090] In some embodiments, the process of using a pre-trained lightweight convolutional neural network model to process the acquired pet images, extract pet appearance features, and identify the individual identity of the currently eating pet includes: resizing, normalizing pixel values, correcting illumination, and removing background from the acquired original pet images; inputting the processed images into the pre-trained lightweight convolutional neural network model, which extracts the pet's coat color and body shape features and outputs a high-dimensional feature vector corresponding to the pet; comparing the output feature vector with the feature vectors of registered pets stored in the database one by one, and determining the individual identity of the currently eating pet based on the comparison results.
[0091] In some embodiments, training a lightweight convolutional neural network model includes: loading weights of a pre-trained lightweight convolutional neural network model onto a preset dataset; freezing the bottom convolutional layers of the lightweight convolutional neural network model; replacing the original fully connected classification layer of the lightweight convolutional neural network model with a fully connected layer adapted to the number of registered pets; fine-tuning the model using images of multiple pets in different poses and under different lighting conditions; and performing INT8 quantization compression on the lightweight convolutional neural network model after training to obtain a lightweight convolutional neural network model that can be deployed on an embedded device.
[0092] In some embodiments, the step of calculating the current pet's eating speed, eating frequency, and remaining food amount based on the real-time weight data collected by the weight sensor includes: calculating the total amount of food that the pet has already eaten based on the initial weight data collected when the pet started eating and the real-time weight data collected at the current moment; dividing the total amount of food eaten by the eating time to obtain the current pet's eating speed; counting the number of times the pet starts eating per unit time to obtain the eating frequency; and directly using the currently collected real-time weight data as the current remaining food amount.
[0093] In some embodiments, comparing the calculated current feeding behavior parameters with the historical feeding behavior model of the pet corresponding to the current pet identity to determine whether there is abnormal feeding behavior includes: reading the threshold range of the historical feeding behavior parameters corresponding to the current pet identity, inputting the currently calculated feeding speed and feeding frequency into the corresponding threshold range for matching, and if any parameter exceeds the corresponding threshold range, it is determined that there is abnormal feeding behavior; if all parameters are within the corresponding threshold range, it is determined that the current feeding behavior is normal.
[0094] In some embodiments, when abnormal eating behavior is determined to exist, generating corresponding graded warning information based on the type and severity of the abnormal behavior and sending the warning information to the user's mobile terminal application includes: determining the type of abnormal behavior based on the type of parameter exceeding a threshold, determining the severity level of the abnormality based on the magnitude of the parameter exceeding the threshold, generating warning information of the corresponding level according to a preset correspondence, and pushing the warning information to the mobile terminal application bound to the user's account for display via a wireless network.
[0095] In some embodiments, the method further includes: after identifying the individual identity of the currently feeding pet, reading the age and weight data of the current pet stored in advance, adjusting the feeding amount for the next feeding of the current pet in combination with the actual amount of food consumed in this feeding, updating the feeding plan stored for the corresponding pet, and controlling the feeding execution mechanism to complete the subsequent feeding action according to the updated feeding plan.
[0096] In some embodiments, the method further includes: comparing the identified current pet individual identity with the historical single-time food intake range of the corresponding pet; if the current single-time food intake exceeds the corresponding range, then re-extracting features and identifying the pet image and updating the identification result.
[0097] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the pet eating behavior real-time monitoring and abnormal state early warning system and its modules described above can be referred to the corresponding content in the various embodiments of the pet eating behavior real-time monitoring and abnormal state early warning method, and will not be repeated here.
[0098] The aforementioned method for real-time monitoring of pet eating behavior and early warning of abnormal conditions can be implemented as a computer program, which can, for example... Figure 3 It runs on the device shown.
[0099] Please see Figure 4 , Figure 4 This is a schematic block diagram of the structure of a feeder provided in an embodiment of this application. The feeder includes a processor, a memory, and a network interface connected via a device bus, wherein the memory may include a storage medium and internal memory.
[0100] The storage medium can store operating devices and computer programs. The computer program includes program instructions that, when executed, cause the processor to perform any method for real-time monitoring of pet eating behavior and issuing early warnings for abnormal conditions.
[0101] The processor provides computing and control capabilities to support the operation of the entire feeder.
[0102] The internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to perform any method for real-time monitoring of pet eating behavior and early warning of abnormal states.
[0103] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal to which the present application is applied. A specific feeder may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0104] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0105] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: The feeder captures images of the pet through its camera and collects the weight data of the remaining food in the feeder in real time through its weight sensor. The system uses a pre-trained lightweight convolutional neural network model to process the collected pet images, extract the pet's appearance features, and identify the individual pet currently eating. Based on real-time weight data collected by a weight sensor, the system calculates the pet's current eating speed, eating frequency, and remaining food amount. The calculated current eating behavior parameters are compared with the pet's historical eating behavior model to determine if there is any abnormal eating behavior. When abnormal eating behavior is determined, corresponding graded warning information is generated based on the type and severity of the abnormal behavior, and the warning information is sent to the user's mobile terminal application.
[0106] In some embodiments, the step of capturing pet images through the feeder's camera includes: after the feeder's main control unit detects an object entering the feeding area, triggering the camera mounted above the feeder to start capturing images, obtaining a frontal image of the current pet, and outputting the captured image to the image processing module of the main control unit.
[0107] In some embodiments, the real-time acquisition of the weight data of the remaining food in the feeder by the weight sensor includes: controlling the weight sensor to be installed below the feeder's food bowl, acquiring the weight value of the remaining food in the food bowl at fixed intervals, and transmitting the acquired weight value to the calculation module of the main control unit in real time.
[0108] In some embodiments, the process of using a pre-trained lightweight convolutional neural network model to process the acquired pet images, extract pet appearance features, and identify the individual identity of the currently eating pet includes: resizing, normalizing pixel values, correcting illumination, and removing background from the acquired original pet images; inputting the processed images into the pre-trained lightweight convolutional neural network model, which extracts the pet's coat color and body shape features and outputs a high-dimensional feature vector corresponding to the pet; comparing the output feature vector with the feature vectors of registered pets stored in the database one by one, and determining the individual identity of the currently eating pet based on the comparison results.
[0109] In some embodiments, training a lightweight convolutional neural network model includes: loading weights of a pre-trained lightweight convolutional neural network model onto a preset dataset; freezing the bottom convolutional layers of the lightweight convolutional neural network model; replacing the original fully connected classification layer of the lightweight convolutional neural network model with a fully connected layer adapted to the number of registered pets; fine-tuning the model using images of multiple pets in different poses and under different lighting conditions; and performing INT8 quantization compression on the lightweight convolutional neural network model after training to obtain a lightweight convolutional neural network model that can be deployed on an embedded device.
[0110] In some embodiments, the step of calculating the current pet's eating speed, eating frequency, and remaining food amount based on the real-time weight data collected by the weight sensor includes: calculating the total amount of food that the pet has already eaten based on the initial weight data collected when the pet started eating and the real-time weight data collected at the current moment; dividing the total amount of food eaten by the eating time to obtain the current pet's eating speed; counting the number of times the pet starts eating per unit time to obtain the eating frequency; and directly using the currently collected real-time weight data as the current remaining food amount.
[0111] In some embodiments, comparing the calculated current feeding behavior parameters with the historical feeding behavior model of the pet corresponding to the current pet identity to determine whether there is abnormal feeding behavior includes: reading the threshold range of the historical feeding behavior parameters corresponding to the current pet identity, inputting the currently calculated feeding speed and feeding frequency into the corresponding threshold range for matching, and if any parameter exceeds the corresponding threshold range, it is determined that there is abnormal feeding behavior; if all parameters are within the corresponding threshold range, it is determined that the current feeding behavior is normal.
[0112] In some embodiments, when abnormal eating behavior is determined to exist, generating corresponding graded warning information based on the type and severity of the abnormal behavior and sending the warning information to the user's mobile terminal application includes: determining the type of abnormal behavior based on the type of parameter exceeding a threshold, determining the severity level of the abnormality based on the magnitude of the parameter exceeding the threshold, generating warning information of the corresponding level according to a preset correspondence, and pushing the warning information to the mobile terminal application bound to the user's account for display via a wireless network.
[0113] In some embodiments, the method further includes: after identifying the individual identity of the currently feeding pet, reading the age and weight data of the current pet stored in advance, adjusting the feeding amount for the next feeding of the current pet in combination with the actual amount of food consumed in this feeding, updating the feeding plan stored for the corresponding pet, and controlling the feeding execution mechanism to complete the subsequent feeding action according to the updated feeding plan.
[0114] In some embodiments, the method further includes: comparing the identified current pet individual identity with the historical single-time food intake range of the corresponding pet; if the current single-time food intake exceeds the corresponding range, then re-extracting features and identifying the pet image and updating the identification result.
[0115] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the steps of the method for real-time monitoring and abnormal status warning of pet eating behavior as provided in any embodiment of this application.
[0116] The computer-readable storage medium can be the internal storage unit of the feeder described in the foregoing embodiments, such as the hard drive or memory of the feeder. Alternatively, the computer-readable storage medium can be an external storage device of the feeder, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the feeder.
[0117] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for real-time monitoring of pet eating behavior and early warning of abnormal conditions, characterized in that, Applications in feeders; including: The feeder captures images of the pet through its camera and collects the weight data of the remaining food in the feeder in real time through its weight sensor. The system uses a pre-trained lightweight convolutional neural network model to process the collected pet images, extract the pet's appearance features, and identify the individual pet currently eating. Based on real-time weight data collected by a weight sensor, the system calculates the pet's current eating speed, eating frequency, and remaining food amount. The calculated current eating behavior parameters are compared with the pet's historical eating behavior model to determine if there is any abnormal eating behavior. When abnormal eating behavior is determined, corresponding graded warning information is generated based on the type and severity of the abnormal behavior, and the warning information is sent to the user's mobile terminal application.
2. The method according to claim 1, characterized in that, The process of capturing pet images via the camera on the feeder includes: After the main control unit of the feeder detects an object entering the feeding area, it triggers the camera installed above the feeder to start capturing images of the pet's front view and outputs the captured images to the image processing module of the main control unit.
3. The method according to claim 1, characterized in that, The method of collecting weight data of the remaining food in the feeder in real time via a weight sensor includes: The control weight sensor is installed below the feeder's food bowl. It collects the weight of the remaining food in the bowl at fixed intervals and transmits the collected weight value to the main control unit's calculation module in real time.
4. The method according to claim 1, characterized in that, The process of using a pre-trained lightweight convolutional neural network model to process the acquired pet images, extract pet appearance features, and identify the individual identity of the pet currently eating includes: The original pet images are resized, pixel values are normalized, illumination is corrected, and background is removed. The processed images are then input into a pre-trained lightweight convolutional neural network model, which extracts the pet's coat color and body shape features and outputs the corresponding high-dimensional feature vector of the pet. The output feature vector is compared one by one with the feature vectors of registered pets stored in the database, and the individual identity of the pet currently eating is determined based on the comparison results.
5. The method according to claim 1, characterized in that, Training a lightweight convolutional neural network model includes: The weights of a lightweight convolutional neural network model pre-trained on a preset dataset are loaded, the bottom convolutional layers of the lightweight convolutional neural network model are frozen, the original fully connected classification layer of the lightweight convolutional neural network model is replaced with a fully connected layer adapted to the number of registered pets, and the model is fine-tuned using images of multiple pets in different poses and under different lighting conditions. After training, the lightweight convolutional neural network model is compressed using INT8 quantization to obtain a lightweight convolutional neural network model that can be deployed on embedded devices.
6. The method according to claim 1, characterized in that, The calculation of the pet's current eating speed, eating frequency, and remaining food amount based on real-time weight data collected by the weight sensor includes: Based on the initial weight data collected when the pet started eating and the real-time weight data collected at the current moment, the total amount of food that the pet has eaten is calculated. The total amount of food eaten is divided by the eating time to obtain the current eating speed of the pet. The number of times the pet starts eating per unit time is counted to obtain the eating frequency. The real-time weight data collected at the current moment is directly used as the current amount of food remaining.
7. The method according to claim 1, characterized in that, The step of comparing the calculated current feeding behavior parameters with the historical feeding behavior model of the corresponding pet to determine whether there is abnormal feeding behavior includes: The system reads the threshold range of historical eating behavior parameters corresponding to the current pet's identity, and inputs the currently calculated eating speed and eating frequency into the corresponding threshold range for matching. If any parameter exceeds the corresponding threshold range, it is determined that there is abnormal eating behavior. If all parameters are within the corresponding threshold range, it is determined that the current eating behavior is normal.
8. The method according to claim 1, characterized in that, When abnormal eating behavior is detected, a corresponding graded early warning message is generated based on the type and severity of the abnormal behavior, and the early warning message is sent to the user's mobile terminal application, including: The abnormal behavior type is determined based on the parameter type that exceeds the threshold, the severity level of the abnormality is determined based on the magnitude of the parameter exceeding the threshold, and a corresponding level of early warning information is generated according to the preset correspondence. The early warning information is then pushed to the mobile terminal application bound to the user's account via wireless network for display.
9. The method according to claim 1, characterized in that, The method further includes: After identifying the individual identity of the pet currently eating, the system reads the pet's pre-stored age and weight data, combines this with the actual amount of food consumed this time, adjusts the amount to be fed next time, updates the corresponding pet's feeding plan, and the main control unit controls the feeding execution mechanism to complete the subsequent feeding actions according to the updated feeding plan.
10. The method according to claim 1, characterized in that, The method further includes: The current pet's individual identity is compared with the historical single-time food intake range of the corresponding pet. If the current single-time food intake exceeds the corresponding range, the feature extraction and identity recognition of the collected pet images are re-performed to update the identity recognition results.