Rail type inspection robot with high-definition visual acquisition device and pig number counting method based on the robot

CN122899982APending Publication Date: 2026-10-13BEIJING FOCUSED LOONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611334896.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

第一,视觉相机镜头抗污染能力不足:猪舍内部属于典型高粉尘环境,饲料碎屑、粪便扬尘形成悬浮粉尘,粉尘附着在镜头玻璃表面,造成图像模糊

Benefits of technology

1、镜头自动清洁,保障成像清晰度:通过设置气缸驱动周向阵列上清洁气嘴,采用高压气流吹扫镜头,无物理接触,不会划伤光学镜片;可以自动清除镜头表面粉尘,减少人工擦拭镜头的维护工作,持续保障可见光相机成像质量;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122899982A_ABST
    Figure CN122899982A_ABST
Patent Text Reader

Abstract

The application discloses a track type inspection robot with a high-definition visual collection device and a pig number statistical method based on the robot, and belongs to the technical field of intelligent breeding equipment, track inspection robots and machine vision, wherein the visual collection device is provided with a circumferentially arranged cleaning air nozzle driven by a cylinder to realize lens air blowing and dust removal; a balance supporting arm and a counterweight disc are arranged to eliminate the eccentric load of the cantilever; the main shell of the inspection robot is provided with a foldable cover for facilitating maintenance; a spring-air cushion composite damping assembly is arranged on the chassis; lower cleaning air nozzles are arranged at four corners of the chassis to blow and clean the surface of the track; an IMU attitude sensor is fixedly connected to a positioning seat and rigidly connected to a camera with a common reference; the statistical method converts a pixel detection frame to a pig house world coordinate system, relies on a spatial intersection ratio to complete cross-frame target deduplication, combines an improved YOLOv8n model and multi-patrol weighted fusion to output a result of a pig inventory, and further sets a fault degradation and local review inspection mode, can mark a stacked suspicious target and push the artificial review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of intelligent breeding equipment, track inspection robots and machine vision technology, specifically involving a track-type inspection robot with a high-definition visual acquisition device and a method for counting the number of pigs based on the robot. Background Technology

[0002] In large-scale pig farming, counting the number of pigs is a core foundation for pig farm production management, cost accounting, and disease prevention and control. Traditional pig inventory methods are mainly divided into three categories: manual inventory, fixed camera monitoring inventory, and visual inventory using ordinary track inspection robots. Each solution has significant shortcomings. Manual inventory relies on farm workers entering the pigsty to visually count and record the pigs. This method is labor-intensive and inefficient; the entry of personnel into the pigsty can cause a strong stress response in the pigs, disrupting their normal feeding and resting behaviors, which is detrimental to their growth. At the same time, manual counting is affected by human fatigue and obstructed vision, resulting in an accuracy rate of only 85%-95%, and large-scale pigsty inventory can take more than half an hour. Fixed camera monitoring inventory involves installing monitoring cameras above the pig pens, relying on manual review of video recordings or machine vision algorithms to identify and count the pigs. The fixed camera positions of this solution limit the field of view, and a large number of cameras are needed to cover the entire pigsty, resulting in high hardware costs. When pigs are clustered together and block each other, the image quality deteriorates, and the probability of missed or false detections increases significantly. The camera lenses are exposed to the harsh environment of the pigsty for a long time, and dust and moisture adhere to the lens surface. There is a lack of automatic cleaning methods, and frequent manual wiping and maintenance are required.

[0003] Existing track-based inspection robot vision inventory solutions allow the robot to move back and forth along a track on the top of the pigsty, with cameras following the robot to achieve full coverage. Compared to fixed cameras, this offers an advantage in inspection range. However, existing equipment still has the following problems at the hardware structure and software algorithm levels: First, the visual camera lens lacks sufficient resistance to contamination: the inside of a pigsty is a typical high-dust environment. Feed scraps and manure dust form suspended dust, which adheres to the lens glass surface, causing image blurring. Regular manual wiping of the lens is necessary, but repeated wiping can scratch the lens's optical elements, reducing image quality. Second, the cantilever structure of the vision acquisition module is unbalanced: some inspection robot cameras are arranged with extended cantilever arms. The weight of the camera and infrared unit is concentrated at the front end of the cantilever, and there is no counterweight at the rear end to balance it. During operation, the cantilever will generate eccentric bending moment, which will aggravate the vibration of the whole machine and cause lens shaking and blurring. Long-term eccentric load will also cause the connecting bolts to loosen, the cantilever to deform, and the equipment reliability to decrease. Third, the vibration reduction solutions for robot walking are limited: most existing track inspection robots only use a single spring or a single rubber pad for vibration reduction. Track joints and track installation seams will bring impact vibration. Single spring vibration reduction is prone to continuous resonance, and single rubber vibration reduction has limited high-frequency attenuation capability. Vibration is directly transmitted to the vision camera, causing motion blur in the acquired image, which seriously affects the accuracy of subsequent machine vision detection and recognition. Fourth, dust and debris on the track surface will amplify the vibration: dust from the pigsty will settle and accumulate on the track surface, and the track wheels will further amplify the vibration by crushing the dust and debris. Existing robots lack a track self-cleaning mechanism, and the problem of track dust accumulation can only be solved by manual cleaning. Fifth, existing pig counting algorithms have poor adaptability: Traditional track inspection robots mostly use multi-target tracking algorithms (DeepSORT, ByteTrack), relying on inter-frame feature matching to assign target IDs; the track robot camera moves forward continuously, and the pig target moves quickly out of the imaging frame, which easily leads to ID jumps and tracking loss, causing the same pig to be counted repeatedly or the pig to be missed; at the same time, the existing detection model has poor adaptability to pig stacking and dust interference samples, and the detection accuracy decreases in occluded scenarios; there is a lack of means to transform the pixel coordinate system to the pig house ground world coordinate system, and it is impossible to use the absolute position information of the robot track to achieve cross-frame target deduplication; there is a lack of a multi-pass inspection result fusion and verification mechanism, and occasional missed detections and false detections in a single inspection cannot be corrected, resulting in large errors in the final statistical results. Summary of the Invention

[0004] The purpose of this invention is to provide a track-mounted inspection robot with a high-definition visual acquisition device and a method for counting pigs based on the robot. On one hand, it achieves automatic air cleaning of the camera lens and the walking track by setting up a cylinder-driven air nozzle cleaning mechanism; it uses a counterweight plate to balance the cantilever load and reduce eccentric vibration; it employs a spring-air cushion composite vibration damping component to attenuate the impact vibration from the track and ensure image clarity; and it uses a foldable flip-top shell to improve the convenience of internal component maintenance. On the other hand, it is equipped with a dedicated pig counting algorithm that converts the image pixel detection box to the pigsty's geodetic coordinate system, performs cross-frame target deduplication based on spatial location, and combines an improved lightweight YOLOv8n detection model and multi-pass inspection weighted fusion verification to effectively reduce missed and false detections of pigs and improve the accuracy of pig inventory counting in large-scale pigsties.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A high-definition visual acquisition device includes a mounting platform with a positioning seat above it. A visible light high-definition camera and an infrared thermal imaging camera are sequentially mounted on the positioning seat. A cylinder is also mounted on the positioning seat. A cleaning disc is coaxially fixed to the lens of the visible light high-definition camera. Multiple upper cleaning nozzles arranged in a circumferential array and facing the lens of the visible light high-definition camera are mounted on the cleaning disc. The cylinder supplies air to all the upper cleaning nozzles through a flexible air tube. High-pressure gas is output from the cylinder and delivered to the circumferentially arrayed upper cleaning nozzles on the cleaning disc via the flexible air tube. The high-pressure airflow sweeps the surface of the visible light camera lens from multiple circumferential directions, removing dust adhering to the lens surface without the need for manual wiping. The circumferential array of nozzles can achieve full-circumference cleaning of the lens without blind spots, avoiding localized image blurring caused by residual dust. The air-blowing cleaning method eliminates the risk of scratches from brushes contacting the lens, ensuring the continuous image clarity of the visible light camera and guaranteeing the image input quality for subsequent machine vision inspection.

[0006] To optimize the balancing effect, a balancing arm extending forward and backward is added between the mounting platform and the positioning seat. The positioning seat is installed at the front end of the balancing arm, and a counterweight plate, with a weight equal to the total weight of the positioning seat, the visible light high-definition camera, and the infrared thermal imaging camera, is fixed at the rear end of the balancing arm. The camera and positioning seat are located at the front end of the balancing arm, and the counterweight plate is located at the rear end. The weight of the counterweight plate is equal to the total weight of all the loads at the front end, achieving mechanical balance of the loads at the front and rear of the arm and eliminating the eccentric bending moment caused by the cantilever extension. This significantly reduces the deflection and vibration of the cantilever when the robot starts and stops on the track or passes through track joints, reduces the additional vibration of the camera, and further improves the clarity of the acquired images.

[0007] A track-mounted inspection robot includes a main body shell. A high-definition visual acquisition device is mounted on the top surface of the main body shell. A control and communication module is also mounted on the positioning seat of the high-definition visual acquisition device. An encoder for acquiring absolute position is mounted at the bottom of the balance arm of the high-definition visual acquisition device. A vibration-damping chassis that moves along the track is mounted on the bottom surface of the main body shell. A battery that supplies power to all electrical components is installed inside the main body shell. The balanced high-definition visual acquisition device is integrated on the top surface of the main body shell, and the encoder is located at the bottom of the balance arm, directly acquiring the robot's walking position information. Its proximity to the physical position of the visual acquisition module results in minimal error in matching position with image timestamps. The vibration-damping chassis isolates vibrations transmitted through the track, and the battery provides unified power to all electrical components. The entire robot integrates visual acquisition, position perception, vibration-damped movement, and power supply into one unit, allowing it to be directly mounted on a track above a pigsty for reciprocating inspections, making it suitable for high-altitude inspection operations in pigsties.

[0008] To achieve control and communication, the control and communication module includes an edge computing controller, a depth sensor, an IMU attitude sensor, and a communication interface, with connection methods referencing existing technologies. The edge computing controller performs image preprocessing and target detection inference, completing most of the computation locally without uploading all raw images to the cloud, thus reducing network bandwidth pressure. The depth sensor acquires scene depth information, providing depth parameters for subsequent pixel-to-world coordinate transformation. The communication interface enables data interaction between the local device and the pig farm management platform, uploading counting results, images, and robot status. The IMU attitude sensor is rigidly mounted with the camera on a shared reference, directly acquiring the camera lens's true attitude, avoiding measurement errors caused by relative deformation of the vibration-damping chassis, and providing high-precision attitude raw data for the pixel coordinate system to the Earth world coordinate system transformation, improving the accuracy of pig target coordinate calculation.

[0009] For ease of maintenance, an upward-opening hinged cover is installed at the front of the main unit housing, and a downward-opening hinged cover is installed at the rear of the main unit housing. With hinged, foldable covers at both the front and rear of the main unit housing, maintenance of components such as batteries can be performed without disassembling numerous fastening bolts; simply flipping open the corresponding cover allows for easy inspection and component replacement. The upward-opening cover and downward-opening cover operate independently, facilitating on-site maintenance and reducing the difficulty of high-altitude maintenance work in the pigsty.

[0010] To achieve vibration reduction, the vibration-damping chassis includes a chassis frame, with a vibration-damping component mounted on top of the chassis frame. At the bottom of the chassis frame, multiple sets of track wheels for use with the track are rotatably connected via bearing seats. A driven gear is coaxially connected to at least one set of track wheels. A servo motor is also mounted next to the driven gear, and a driving gear meshes with the driven gear at the output end of the servo motor. The servo motor drives the track wheels to rotate through the meshing of the driving and driven gears. The gear transmission ratio is stable, the transmission efficiency is high, and the driving torque is sufficient, making it suitable for heavy-load reciprocating movement of the track robot. The bearing seats ensure smooth rotation of the track wheels. The vibration-damping component, located on top of the chassis frame, isolates the impact vibration generated when the track wheels contact the track, weakens the transmission of vibration to the main housing and the vision acquisition device above, and reduces the risk of camera shake and blur.

[0011] To further optimize the vibration damping structure, the vibration damping assembly includes two sets of left-right symmetrically distributed spring vibration damping structures and two sets of front-back symmetrically distributed air cushion vibration damping structures. The spring vibration damping structure includes a damping seat fixedly connected to the bottom surface of the mounting platform, with springs and rubber damping blocks installed sequentially at the bottom of the damping seat. The air cushion vibration damping structure includes an inflatable air cushion supporting the bottom surface of the mounting platform, with the atmospheric pressure inside the inflatable air cushion being 1.5-1.8 times the external standard atmospheric pressure. The system employs a composite vibration reduction scheme combining spring and air cushion structures. The springs bear the main static loads, while the rubber damping blocks suppress the reciprocating bounce and resonance of the springs. The air cushion maintains an internal pressure of 1.5-1.8 times the external standard atmospheric pressure, and its flexible cushioning capability effectively absorbs high-frequency impacts from the track joints. The system is symmetrically arranged left and right, front and back, ensuring balanced vibration reduction performance in all directions. The combined effect of the springs, rubber damping, and air cushion, compared to a single spring or a single rubber damper, can simultaneously attenuate both low-frequency vibrations and high-frequency impacts, minimizing the transmission of vibrations to the upper visual acquisition device and ensuring image clarity.

[0012] To clean the track, lower cleaning nozzles are installed at the front left, rear left, front right, and rear right of the chassis frame. Air guide pipes facing the track are connected to the outlets of these lower cleaning nozzles. Four sets of intermediate cleaning nozzles are also installed on the mounting platform, working sequentially with the lower cleaning nozzles. A cylinder supplies air to all the lower cleaning nozzles via flexible air pipes through the intermediate cleaning nozzles. High-pressure gas is output from the cylinder, delivered through flexible air pipes and intermediate cleaning nozzles to the lower cleaning nozzles at the four corners of the chassis frame. The airflow directly sweeps the track surface through the air guide pipes. During robot movement, accumulated dust and small debris on the track surface are simultaneously blown away, preventing additional impact and vibration caused by the track wheels crushing debris. The placement of lower cleaning nozzles at the four corners allows for simultaneous cleaning of both sides of the track surface, reducing vibration interference from track dust accumulation at the source and further improving camera imaging quality.

[0013] A method for counting pigs using a track-mounted inspection robot based on a high-definition visual acquisition device, the method comprising the following steps: S1: Inspection initialization and positioning system calibration; S2: The robot inspects the track at a constant speed, and the multimodal hardware synchronously acquires image sequences. Each frame is bound with encoder position, RFID tag ID, timestamp, and IMU attitude data. S3: The edge computing controller performs image preprocessing and image quality assessment, and triggers nozzle cleaning for unqualified images; S4: Input the preprocessed qualified visible light image into the improved lightweight YOLOv8n pig detection model, and output the set of pig detection boxes in the image pixel coordinate system; S5: Combining the gimbal pitch angle, robot trajectory position, and camera intrinsic and extrinsic parameters, the image pixel coordinate system detection box is transformed to the world coordinate system of the pigsty ground plane; S6: Based on world coordinates, complete the deduplication of pig target space across frames in a single inspection and output the preliminary number of pigs in a single inspection. S7: Perform multiple round trip inspections, spatially align and weightedly merge the results of multiple trips, and output the final statistical results of the number of pigs in the entire pigsty. S8: Upload the counting results, image samples, and robot pose metadata to the pig farm management platform.

[0014] This method relies on an inspection robot equipped with automatic lens and track cleaning and composite vibration reduction functions. Initial calibration ensures positioning accuracy. During the acquisition phase, position, time, and attitude metadata are synchronously bound to each frame of image. When the image quality is unqualified, air nozzle cleaning is automatically triggered to ensure the quality of the input image. The pixel detection box is converted to the pigsty's geodetic coordinate system, eliminating the ID jump problem caused by traditional video tracking algorithms that rely on image feature allocation. Cross-frame target deduplication is completed by relying on spatial coordinates. Multiple inspections are weighted and fused for verification to eliminate accidental missed or false detections in a single inspection. Finally, statistical results are output and uploaded to the platform. The entire process is fully automated, requiring no personnel to enter the pigsty, avoiding stress to the pigs, and realizing large-scale automatic inventory of pigsties.

[0015] In step S4, the improved lightweight YOLOv8n pig target detection model includes: introducing a lightweight coordinate attention (CA) module into the backbone C2f module; replacing the loss function with Focal-EIoU Loss, and increasing the weights for pigs occluding each other and stacked samples; the dataset contains pig images from a top-down angle, covering pink and white, black, and spotted pigs, and includes samples with strong light, backlight, fog, and dust interference; Jetson Orin Nano is deployed for inference at the edge, with a single frame inference time of ≤45ms, and outputting the pixel coordinates, confidence, and class label of each detection box. A CA coordinate attention module is introduced into the C2f module of the YOLOv8n backbone to enhance the model's ability to extract features of pig target locations, while the lightweight design does not incur excessive computational overhead. The Focal EIoU Loss function improves the training weights for occluded and stacked pig samples, enhancing the detection performance in dense pig herd scenes. The training dataset fully covers the real and complex working conditions of pig houses, improving the model's robustness in dusty, backlit, and foggy environments. Deployed on a Jetson Orin Nano edge controller, the single-frame inference time is controlled within 45ms, which can meet the real-time inference requirements of the inspection process, outputting detection boxes, confidence scores, and class labels, providing reliable detection results for subsequent coordinate transformation and target deduplication.

[0016] The beneficial effects of this invention are: 1. Automatic lens cleaning ensures image clarity: By setting up a cylinder to drive the cleaning nozzles on the circumferential array, high-pressure airflow is used to clean the lens without physical contact, so as not to scratch the optical lens; it can automatically remove dust from the lens surface, reduce the maintenance work of manually wiping the lens, and continuously ensure the image quality of the visible light camera. 2. Balanced cantilever load and reduced eccentric vibration: A counterweight plate is set at the rear end of the balance arm. The counterweight is equal to the total weight of the front camera module, which eliminates the eccentric bending moment caused by the cantilever extension, reduces the cantilever deflection and shaking during the operation of the whole machine, reduces the additional vibration of the camera, and further improves the image clarity. 3. Synchronous track cleaning to suppress vibration interference at the source: Cleaning nozzles are placed at the four corners of the chassis to blow away the track surface during the movement, remove dust and small debris accumulated on the track, and prevent the track wheels from crushing debris and generating additional impact vibration. This also helps the vibration-damping chassis to further reduce the overall vibration of the machine. 4. Composite vibration reduction scheme, with better vibration reduction effect than single vibration reduction structure: The vibration reduction component adopts a composite vibration reduction of spring-rubber damping block and inflatable air cushion. The spring bears the static load, the rubber damping suppresses the spring resonance, and the inflatable air cushion absorbs the high-frequency impact of the track joint; symmetrical arrangement on the left and right and front and back, the overall vibration reduction performance is balanced, effectively attenuating the transmission of track vibration to the vision camera and reducing the probability of image motion blur. 5. Local computing at the edge reduces transmission pressure: The edge computing controller completes image preprocessing and target detection inference without uploading all raw images to the cloud, reducing network bandwidth pressure; the communication interface completes the uploading of results and samples, balancing local real-time processing and remote platform management. 6. The detection model is optimized for pigsty scenarios and has high robustness to complex working conditions: The improved YOLOv8n model introduces a CA coordinate attention module and replaces the Focal-EIoU Loss loss function to improve the detection effect of stacked occluded pigs; the training dataset covers real interference scenarios in pigsties such as dust, backlight, and fog, and the edge deployment and inference speed is fast to meet the real-time detection needs of inspection. 7. Deduplication in world coordinate space to solve the problem of target ID jump in track inspection: The pixel detection box is converted to the world coordinate system of the pigsty. Cross-frame target deduplication is completed by relying on the intersection and union of spatial coordinates. This gets rid of the defects of repeated counting caused by ID jump and tracking loss in traditional multi-target tracking algorithms, and is suitable for the top-down scenario of track robot continuously moving forward for inspection. 8. Multiple inspections with weighted fusion verification ensure high reliability of statistical results: Through multiple rounds of inspections, the results of multiple inspections are spatially aligned and weighted by voting to correct occasional missed or false detections in a single inspection; when the difference between the counts of multiple inspections is too large, an automatic alarm is triggered to prompt manual review, thereby improving the accuracy of pig inventory statistics. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A three-dimensional structural diagram of a high-definition visual acquisition device from a first angle; Figure 2 This is a three-dimensional structural diagram of the high-definition visual acquisition device from a second angle. Figure 3 A three-dimensional structural diagram of a track-mounted inspection robot with a high-definition visual acquisition device from the first angle. Figure 4 A three-dimensional structural diagram of a track-mounted inspection robot with a high-definition visual acquisition device from a second angle. Figure 5 This is a three-dimensional structural diagram of the main housing and the vibration-damping chassis at a first angle; Figure 6 This is a three-dimensional structural diagram of the main housing and the vibration-damping chassis at a second angle; Figure 7 A three-dimensional structural diagram of the vibration-damping chassis at the first angle; Figure 8 A three-dimensional structural diagram of the vibration-damping chassis at the second angle; Figure 9 for Figure 7 A magnified view of a section at point A in the middle; Figure 10 for Figure 4 A magnified view of a section at point B in the middle; Figure 11 This is a flowchart of the pig count statistics process using a track-mounted inspection robot based on a high-definition visual acquisition device.

[0019] Reference numerals: 1. Mounting platform; 2. Positioning seat; 3. Visible light high-definition camera; 4. Infrared thermal imaging camera; 5. Cylinder; 6. Cleaning disc; 7. Upper cleaning nozzle; 8. Balance arm; 9. Counterweight disc; 10. Main unit housing; 11. Control and communication module; 12. Encoder; 13. Vibration damping chassis; 14. Battery; 15. Upper flip cover; 16. Lower flip cover; 17. Chassis frame; 18. Track wheel; 19. Bearing seat; 20. Driven gear; 21. Servo motor; 22. Drive gear; 23. Vibration damping seat; 24. Spring; 25. Rubber damping block; 26. Inflatable air cushion; 27. Lower cleaning nozzle; 28. Air guide pipe; 29. ​​Middle cleaning nozzle; 30. Track. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Example 1, as Figures 1 to 2 As shown, a high-definition visual acquisition device is provided, including a mounting platform 1, a positioning seat 2 on the mounting platform 1, a visible light high-definition camera 3 and an infrared thermal imaging camera 4 are sequentially mounted on the positioning seat 2; a cylinder 5 is also mounted on the positioning seat 2, a cleaning disc 6 is fixed at the lens of the visible light high-definition camera 3 and coaxially arranged, and four upper cleaning nozzles 7 are mounted on the cleaning disc 6 in a circumferential array and facing the lens of the visible light high-definition camera 3. The cylinder 5 supplies air to all the upper cleaning nozzles 7 through a flexible air tube. High-pressure gas is output from cylinder 5 and delivered via a flexible air tube to the cleaning nozzles 7 arranged in a circumferential array on the cleaning disc 6. The high-pressure airflow blows the surface of the visible light camera lens from multiple circumferential directions, removing dust adhering to the lens surface without the need for manual wiping. The circumferential array of nozzles can achieve full-circumference cleaning of the lens without dead angles, avoiding localized dust residue that could cause localized image blurring. The air-blowing cleaning method eliminates the risk of scratches from brushes contacting the lens, ensuring the continuous clarity of the visible light camera's imaging and guaranteeing the image input quality for subsequent machine vision inspection.

[0022] Continue as Figures 1 to 2 As shown, to optimize the balancing effect, a balancing arm 8 extending in the front-to-back direction is added between the mounting platform 1 and the positioning seat 2. The positioning seat 2 is installed at the front end of the balancing arm 8, and a counterweight plate 9 with a weight equal to the total weight of the positioning seat 2, the visible light high-definition camera 3, and the infrared thermal imaging camera 4 is fixed at the rear end of the balancing arm 8. The camera and positioning seat 2 are arranged at the front end of the balancing arm 8, and the counterweight plate 9 is set at the rear end. The weight of the counterweight plate 9 is equal to the total weight of all the loads at the front end, realizing the mechanical balance of the loads at the front and rear of the arm and eliminating the eccentric bending moment caused by the cantilever extension. This can significantly reduce the bending deformation and shaking of the cantilever when the robot starts and stops on the track 30 and passes through the joint of the track 30, reduce the additional vibration of the camera, and further improve the clarity of the acquired images.

[0023] Example 2, as Figures 3 to 6As shown, a track-type inspection robot is provided, including a main body shell 10. A high-definition visual acquisition device as described in Embodiment 1 is installed on the top surface of the main body shell 10. A control and communication module 11 is also installed on the positioning seat 2 of the high-definition visual acquisition device in Embodiment 1. An encoder 12 for acquiring absolute position is also installed at the bottom of the balance arm 8 of the high-definition visual acquisition device in Embodiment 1. A vibration-damping chassis 13 that moves along the track 30 is installed on the bottom surface of the main body shell 10. A battery 14 that supplies power to all electrical components is installed inside the main body shell 10. The high-definition visual acquisition device with a counterweight is integrated on the top surface of the main body shell 10, and the encoder 12 is arranged at the bottom of the balance arm 8 to directly acquire the robot's walking position information. It is close to the physical position of the visual acquisition module, and the position and image timestamp matching error is small. The vibration-damping chassis 13 isolates the vibration transmitted by the track 30, and the battery 14 provides power to all electrical components of the whole machine. The whole machine integrates visual acquisition, position perception, vibration-damping walking and power supply into one unit, and can be directly mounted on the track 30 on the top of the pig house for reciprocating inspection, which is suitable for high-altitude inspection operation scenarios in pig houses.

[0024] like Figures 3 to 4 As shown, to achieve control and communication, the control and communication module 11 includes an edge computing controller, a depth sensor, an IMU attitude sensor, and a communication interface, with the connection method referring to existing technologies. The edge computing controller performs image preprocessing and target detection inference, completing most of the computation locally without uploading all original images to the cloud, thus reducing network bandwidth pressure. The depth sensor acquires scene depth information, providing depth parameters for subsequent pixel-world coordinate transformation. The communication interface enables data interaction between the local device and the pig farm management platform, completing the uploading of counting results, images, and robot status. The IMU attitude sensor is rigidly mounted with the camera on a common reference, directly acquiring the true attitude of the camera lens, avoiding measurement errors caused by the relative deformation of the vibration-damping chassis 13, providing high-precision attitude raw data for the transformation from pixel coordinate system to Earth-world coordinate system, and improving the accuracy of pig target coordinate calculation.

[0025] like Figures 5 to 6 As shown, for ease of maintenance, an upward-opening cover 15 is hinged to the front of the main housing 10, and a downward-opening cover 16 is hinged to the rear of the main housing 10. With hinged, foldable covers at the front and rear of the main housing 10, maintenance and component replacement can be carried out without disassembling numerous fastening bolts; simply open the corresponding cover. The upward-opening cover 15 and the downward-opening cover 16 open independently, facilitating on-site maintenance and reducing the difficulty of high-altitude maintenance in the pigsty.

[0026] like Figures 7 to 8As shown, to achieve vibration reduction, the vibration-damping chassis 13 includes a chassis frame 17. A vibration-damping component is installed on the top of the chassis frame 17. At the bottom of the chassis frame 17, multiple sets of track wheels 18 that cooperate with the track 30 are rotatably connected via bearing seats 19. A driven gear 20 is coaxially connected to at least one set of track wheels 18. A servo motor 21 is also installed next to the driven gear 20, and a drive gear 22 that meshes with the driven gear 20 is connected to the output end of the servo motor 21. The servo motor 21 drives the track wheels 18 to rotate through the meshing of the drive gear 22 and the driven gear 20. The gear transmission ratio is stable, the transmission efficiency is high, and the driving torque is sufficient, which is suitable for the heavy-load reciprocating movement of the track 30 robot. The bearing seats 19 ensure smooth rotation of the track wheels 18. The vibration-damping component is arranged on the top of the chassis frame 17 to isolate the impact vibration generated when the track wheels 18 contact the track 30, weaken the transmission of vibration to the main housing 10 and the vision acquisition device above, and reduce the risk of camera shake and blur.

[0027] like Figures 7 to 9 As shown, in order to further optimize the vibration damping structure, the vibration damping component includes two sets of left-right symmetrically distributed spring 24 vibration damping structures and two sets of front-back symmetrically distributed air cushion vibration damping structures; the spring 24 vibration damping structure includes a vibration damping seat 23 fixedly connected to the bottom surface of the mounting platform 1, and springs 24 and rubber damping blocks 25 are sequentially installed at the bottom of the vibration damping seat 23; the air cushion vibration damping structure includes an inflatable air cushion 26 supporting the bottom surface of the mounting platform 1, and the atmospheric pressure inside the inflatable air cushion 26 is 1.7 times the external standard atmospheric pressure, and this multiple can be flexibly selected from the range of 1.5-1.8. A composite vibration reduction scheme combining a spring 24 damping structure and an air cushion damping structure is adopted. The spring 24 bears the main static load, and the rubber damping block 25 suppresses the reciprocating bounce resonance of the spring 24. The air cushion 26 maintains the internal air pressure at 1.5 to 1.8 times the external standard atmospheric pressure. The air cushion has flexible buffering capacity and has a good absorption effect on the high-frequency impact from the track 30 joint. The air cushion is symmetrically arranged in the left and right and front and back, and the vibration reduction performance of the whole machine is balanced in all directions. The spring 24, rubber damping, and air cushion 26 work together to simultaneously attenuate low-frequency vibrations and high-frequency impacts compared to a single spring 24 or a single rubber damping structure. This maximizes the suppression of vibration transmission to the upper visual acquisition device and ensures image clarity.

[0028] Example 3, as Figures 1 to 2 , Figure 10As shown, the difference between this embodiment and embodiment two is that, based on embodiment two, in order to clean the track 30, lower cleaning nozzles 27 are installed on the left front, left rear, right front and right rear of the chassis frame 17 respectively. The air outlet of the lower cleaning nozzle 27 is connected to the air guide pipe 28 facing the track 30. Four sets of intermediate cleaning nozzles 29 are also installed on the mounting platform 1 to cooperate with the lower cleaning nozzles 27 in sequence. The cylinder 5 supplies air to all the lower cleaning nozzles 27 through the flexible air pipe and the intermediate cleaning nozzles 29. High-pressure gas is output through cylinder 5 and delivered to the lower cleaning nozzles 27 at the four corners of the chassis frame 17 via flexible air tube and intermediate cleaning nozzle 29. The airflow directly blows the walking surface of track 30 through air guide tube 28. During the robot's movement, dust and small debris accumulated on the surface of track 30 are blown away simultaneously to prevent track wheels 18 from crushing debris and causing additional impact vibration. The lower cleaning nozzles 27 at the four corners can clean the walking surfaces on both sides of track 30 simultaneously, reducing vibration interference caused by dust accumulation on track 30 from the source, and further helping to improve the camera imaging quality.

[0029] Example 4, as Figure 11 As shown, a method for counting pigs based on a track-mounted inspection robot using a high-definition visual acquisition device is provided. This method uses the track-mounted 30 inspection robot from Embodiment 3 and includes the following steps: S1: Inspection initialization and positioning system calibration; Once powered on, the robot moves to the mechanical origin of track 30 and performs a hardware self-check: the status of cylinder 5 (air path), upper cleaning nozzle 7, lower cleaning nozzle 27, visible light high-definition camera 3, infrared thermal imaging camera 4, depth sensor, encoder 12, IMU attitude sensor, servo motor 21, and battery 14 are checked sequentially; the robot reads locally pre-stored configuration parameters: total length of track 30, absolute world coordinates of each RFID tag on track 30, camera intrinsic parameters, and hand-eye calibration extrinsic parameters; the positioning system initialization is completed, encoder 12 collects walking displacement, IMU collects overall robot attitude, and coordinate system calibration is completed to ensure the accuracy of subsequent position mapping.

[0030] S2: The robot inspects along the track at a constant speed of 30. Multimodal hardware synchronously acquires image sequences, and each frame is bound to encoder position, timestamp, and IMU attitude data. The robot moves at a preset inspection speed of 0.25-0.4 m / s along track 30 at a constant speed. The visible light high-definition camera 3, infrared thermal imaging camera 4, and depth sensor hardware are synchronously triggered to acquire images. After each frame of image acquisition is completed, the encoder 12 output position, the read timestamp, the IMU output pitch, and the rotation attitude angle are simultaneously bound to the image frame as metadata and stored in the edge computing controller cache. During the inspection, cylinder 5 can intermittently drive the upper cleaning nozzle 7 to blow on the lens and the lower cleaning nozzle 27 to blow on the surface of track 30.

[0031] S3: The edge computing controller performs image preprocessing and image quality assessment, and triggers nozzle cleaning for unqualified images; The edge computing controller performs preprocessing on visible light images: 3×3 Gaussian denoising, CLAHE illumination equalization, lens distortion correction, and Laplacian sharpening. Image quality assessment is then conducted: Laplacian variance is calculated to evaluate image sharpness, and the mean and standard deviation of image grayscale are calculated to evaluate image exposure levels. If the sharpness index is below a set threshold, the image is deemed unqualified. If multiple consecutive frames fail to meet the sharpness standard, the lens is determined to be contaminated by dust or water mist. The controller outputs a command to control cylinder 5, driving the upper cleaning nozzle 7 to spray high-pressure gas to clean the lens. After cleaning, image acquisition continues. If the image at that location remains unqualified, position 30 on track is recorded as a re-shooting point. During the robot's return journey, the walking speed is reduced, and images are re-acquired at the re-shooting point.

[0032] S4: Input the preprocessed qualified visible light image into the improved lightweight YOLOv8n pig detection model, and output the set of pig detection boxes in the image pixel coordinate system; The preprocessed qualified images were scaled to the model input size of 640×640 and fed into the improved lightweight YOLOv8n model deployed on Jetson OrinNano. The C2f module of the model backbone introduces a CA coordinate attention module, and the loss function adopts Focal-EIoU Loss. The training dataset contains a large number of pig house top-down view samples, covering white pigs, black pigs, and spotted pigs, as well as samples of strong light, backlight, lens fogging, and dust interference scenes. The model inference time per frame is ≤45ms. Low confidence detection results with a confidence level below 0.4 are filtered out, and the pixel coordinates, confidence level, and class label of the detection box for each pig target in the image pixel coordinate system are output to obtain the detection box set.

[0033] S5: Combining the gimbal pitch angle, robot orbit position 30, and camera intrinsic and extrinsic parameters, the image pixel coordinate system detection box is transformed to the pigsty ground plane world coordinate system; Read the bound metadata of this frame: one-dimensional position of robot track 30, gimbal pitch angle, and gimbal rotation angle; read the pre-calibrated intrinsic parameter matrix of the camera and the extrinsic parameter matrix obtained by hand-eye calibration; read the average depth value of the detection box area corresponding to the depth sensor; based on the pinhole camera inverse projection algorithm, transform and solve the four corner points of the detection box in the image pixel coordinate system to obtain the bounding box in the world coordinate system of the pigsty ground plane; each detection box simultaneously records the world bounding box, confidence score, and corresponding track 30 position interval.

[0034] S6: Based on world coordinates, complete the deduplication of pig target space across frames in a single inspection and output the preliminary number of pigs in a single inspection. The world coordinate system detection boxes output from all valid frames of a single inspection are aggregated into a set; all detection boxes in the set are traversed, and the intersection-union ratio (IoU_w) of each pair of detection boxes in the world coordinate system is calculated; when the IoU_w of two detection boxes is greater than 0.35, it is determined that the same pig has been repeatedly detected in different image frames; the detection box record with the highest confidence is retained, and the other duplicate records are removed; combined with the temperature statistics of the 4 ROI areas of the infrared thermal imaging camera, false detection targets whose temperature deviates significantly from the normal body temperature range of pigs are filtered out; the number of remaining valid targets in the set is the initial stocking quantity N1 of a single inspection.

[0035] S7: Perform multiple round trip inspections, spatially align and weightedly merge the results of multiple trips, and output the final statistical results of the number of pigs in the entire pigsty. The robot completes at least two round trip inspections, obtaining multiple sets of single-trip inspection statistics; it outputs all world coordinate detection boxes from multiple inspections for spatial matching; it adopts a voting weighted fusion strategy, requiring that a target in the same spatial location be detected in at least two inspections before being included in the final statistics; it outputs the final inventory statistics N_final for the entire pigsty; if the difference between the count results of multiple inspections exceeds a set threshold, the platform outputs an alarm, prompting staff to manually review the corresponding area image.

[0036] S8: Upload the counting results, image samples, and robot pose metadata to the pig farm management platform.

[0037] The edge computing controller uploads the final inventory statistics, keyframe image samples, and pose metadata corresponding to each frame of the robot to the pig farm management platform through the communication interface; managers can view the inventory results and review the inspection images on the platform to complete the archiving and management of pig farm inventory data.

[0038] This method relies on an inspection robot equipped with automatic cleaning of the lens and track, and composite vibration reduction functions. Initial calibration ensures positioning accuracy. During the acquisition phase, position, time, and attitude metadata are synchronously bound to each frame of image. When the image quality is unqualified, the air nozzle is automatically cleaned to ensure the quality of the input image. The pixel detection box is converted to the pigsty's geodetic coordinate system, eliminating the ID jump problem caused by traditional video tracking algorithms that rely on image feature allocation. Cross-frame target deduplication is completed by relying on spatial coordinates. Multiple inspections are weighted and fused for verification to eliminate accidental missed or false detections in a single inspection. Finally, statistical results are output and uploaded to the platform. The entire process is fully automated, requiring no personnel to enter the pigsty, avoiding stress to the pigs, and realizing large-scale automatic inventory of pigsties.

[0039] Example 5, such as Figure 11As shown, the difference between this embodiment and Embodiment 4 lies only in step S3, where preprocessing is performed on the visible light image: 3×3 Gaussian denoising, CLAHE illumination equalization, lens distortion correction, and Laplacian sharpening; image quality assessment simultaneously calculates: Laplacian sharpness variance, average image grayscale, and reflectivity ratio; and sets the following two-level thresholds: Level 1 threshold (slight contamination): 200≤Laplacian variance<260, the image is judged to be slightly blurred, the current frame is not discarded, the position is recorded, and the purging time is increased during the next periodic jet; Level 2 threshold (severe contamination): Laplacian variance < 200, image is deemed unqualified; if 3 consecutive frames are deemed unqualified, control cylinder 5 to continuously spray air for 1.0s, driving the upper cleaning nozzle 7 to forcefully blow clean the lens; after blowing clean, a verification frame is acquired; if the quality of the verification frame is still unqualified, the coordinate 30 of the track is marked as a **forced reshoot point** and stored in the reshoot point list; After the robot finishes its inspection and returns, it sequentially traverses the list of locations for re-capturing images. Upon reaching a location, it automatically slows down to 0.15 m / s and re-captures images of that area.

[0040] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A high-definition visual acquisition device, comprising a mounting platform, a positioning seat above the mounting platform, and a visible light high-definition camera and an infrared thermal imaging camera sequentially mounted on the positioning seat; characterized in that, A cylinder is also installed on the positioning base, and a cleaning disc is fixed coaxially at the lens of the visible light high-definition camera. Multiple upper cleaning nozzles are installed on the cleaning disc in a circumferential array and facing the lens of the visible light high-definition camera. The cylinder supplies air to all the upper cleaning nozzles through a flexible air tube.

2. The high-definition visual acquisition device according to claim 1, characterized in that: A balance arm extending in the front-to-back direction is added between the mounting platform and the positioning seat. The positioning seat is installed at the front end of the balance arm, and a counterweight plate with a weight equal to the total weight of the positioning seat, the visible light high-definition camera, and the infrared thermal imaging camera is fixed at the rear end of the balance arm.

3. A track-mounted inspection robot, comprising a main body housing, characterized in that: A high-definition visual acquisition device according to claim 2 is installed on the top surface of the main unit housing. A control and communication module is also installed on the positioning seat of the high-definition visual acquisition device. An encoder for acquiring absolute position is also installed at the bottom of the balance arm of the high-definition visual acquisition device. A vibration-damping chassis that moves along the track is installed on the bottom surface of the main unit housing. A battery that supplies power to all electrical components is installed inside the main unit housing.

4. The track-mounted inspection robot according to claim 3, characterized in that: The control and communication module includes an edge computing controller, a depth sensor, an IMU attitude sensor, and a communication interface.

5. The track-mounted inspection robot according to claim 3, characterized in that: A hinged top cover that can be opened upwards is mounted on the front of the main unit housing, and a hinged bottom cover that can be opened downwards is mounted on the rear of the main unit housing.

6. The track-mounted inspection robot according to claim 3, characterized in that: The vibration-damping chassis includes a chassis frame, a vibration-damping component is installed on the top of the chassis frame, and multiple sets of track wheels that cooperate with the track are rotatably connected to the bottom of the chassis frame through bearing seats. A driven gear is coaxially connected to at least one set of track wheels. At the same time, a servo motor is installed next to the driven gear, and a driving gear that meshes with the driven gear is connected to the output end of the servo motor.

7. The track-mounted inspection robot according to claim 6, characterized in that: The vibration damping assembly includes two sets of left-right symmetrically distributed spring vibration damping structures and two sets of front-back symmetrically distributed air cushion vibration damping structures. The spring damping structure includes a damping seat fixedly connected to the bottom surface of the mounting platform, and a spring and a rubber damping block are installed sequentially at the bottom of the damping seat. The air cushion vibration damping structure includes an inflatable air cushion supporting the bottom surface of the mounting platform. The atmospheric pressure inside the inflatable air cushion is 1.5-1.8 times the external standard atmospheric pressure.

8. The track-mounted inspection robot according to claim 7, characterized in that: Lower cleaning nozzles are installed on the front left, rear left, front right, and rear right sides of the chassis frame. Air guide pipes facing the track are connected to the air outlets of the lower cleaning nozzles. Four sets of intermediate cleaning nozzles are also installed on the mounting platform to work in sequence with the lower cleaning nozzles. The cylinder supplies air to all the lower cleaning nozzles through flexible air pipes via the intermediate cleaning nozzles.

9. A method for counting pigs using a track-mounted inspection robot based on a high-definition visual acquisition device, characterized in that: This method employs the track-mounted inspection robot according to claim 8, and includes the following steps: S1: Inspection initialization and positioning system calibration; S2: The robot inspects the track at a constant speed, and the multimodal hardware synchronously acquires image sequences. Each frame is bound with encoder position, RFID tag ID, timestamp, and IMU attitude data. S3: The edge computing controller performs image preprocessing and image quality assessment, and triggers nozzle cleaning for unqualified images; S4: Input the preprocessed qualified visible light image into the improved lightweight YOLOv8n pig detection model, and output the set of pig detection boxes in the image pixel coordinate system; S5: Combining the gimbal pitch angle, robot trajectory position, and camera intrinsic and extrinsic parameters, the image pixel coordinate system detection box is transformed to the world coordinate system of the pigsty ground plane; S6: Based on world coordinates, complete the deduplication of pig target space across frames in a single inspection and output the preliminary number of pigs in a single inspection. S7: Perform multiple round trip inspections, spatially align and weightedly merge the results of multiple trips, and output the final statistical results of the number of pigs in the entire pigsty. S8: Upload the counting results, image samples, and robot pose metadata to the pig farm management platform.

10. The method for counting pig numbers using a track-type inspection robot based on a high-definition visual acquisition device according to claim 9, characterized in that: The improved lightweight YOLOv8n pig target detection model includes: introducing a lightweight coordinate attention (CA) module into the backbone C2f module; replacing the loss function with Focal-EIoU Loss, and increasing the weights for pigs occluding each other and stacked samples; the dataset contains pig images from a top-down perspective, covering pink and white, black, and spotted pigs, and includes samples with strong light, backlight, fog, and dust interference; the edge is deployed with Jetson Orin Nano for inference, with a single frame inference time of ≤45ms, and outputting the pixel coordinates, confidence, and class label of each detection box.