Piglet behavior small target feature enhancement model construction method based on internal multi-scale

CN122657516APending Publication Date: 2026-08-28JILIN AGRICULTURAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610948444.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

但在实际规模化养殖场景中,猪群高密度聚集、个体相互遮挡、养殖环境光照不均、栏舍背景杂乱等问题普遍存在,同时监测画面中存在大量远距离、局部躯体、幼猪个体等猪行为小目标,这类小目标像素占比低、有效特征信息少、轮廓细节模糊,是猪只行为精准识别的核心难点

Benefits of technology

通过通道分割多尺度池化、拉普拉斯边缘增强与轻量级注意力加权的三级特征增强机制,精准捕获猪行为小目标的多尺度上下文与高频轮廓特征,有效缓解小目标特征模糊、丢失问题,大幅降低漏检与误检率;消除浅层与深层特征的尺度断层,构建完整的小目标特征表征体系,可适应猪只姿态变化、尺度差异、环境干扰等复杂场景,使检测鲁棒性大幅提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122657516A_ABST
    Figure CN122657516A_ABST
Patent Text Reader

Abstract

The application discloses a method for constructing a pig behavior small target feature enhancement model based on internal multi-scale, and belongs to the technical field of image processing.The method is used for solving the technical problems of small target feature weakening, detail loss and poor anti-interference capability in the prior art.The method specifically comprises the following steps: S1, image acquisition and preprocessing, which is used for completing standardization preprocessing, noise suppression and small target region positioning of a pig house scene image; S2, feature backbone extraction, which is used for completing layered extraction of basic visual features of the image based on a light C2F structure and outputting multi-scale basic feature maps; and S3, internal multi-scale feature enhancement, which is used for completing adaptive enhancement of small target features through channel segmentation multi-scale pooling, Laplace edge detection and light attention weighting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to a method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale. Background Technology

[0002] With the rapid transformation and upgrading of the pig farming industry towards large-scale, intensive, and intelligent operations, the automated and precise monitoring of pig behavior using computer vision and deep learning technologies has become one of the core research directions in smart livestock farming. The various behavioral states of pigs, such as eating, drinking, walking, lying down, and fighting, can directly reflect their health status, growth status, and welfare level. Timely and accurate identification of abnormal pig behavior can help predict disease risks, optimize farming management strategies, and reduce farming losses. This is of great practical significance for improving the standardization and intelligence of pig farming and ensuring economic benefits.

[0003] Currently, most existing pig behavior recognition technologies are based on general object detection and feature extraction models. These models extract, analyze, and classify individual pigs and their behavioral features by collecting video images of farming scenes. However, in actual large-scale farming scenarios, problems such as high-density pig herds, mutual occlusion, uneven lighting in the farming environment, and cluttered pen backgrounds are common. Simultaneously, the monitoring footage contains numerous small targets related to pig behavior, such as distant objects, partial bodies, and piglets. These small targets have low pixel counts, limited effective feature information, and blurred contour details, posing a core challenge to accurate pig behavior recognition. Existing conventional feature extraction methods often use a single, fixed-scale convolutional kernel for feature sampling, extracting only surface features within a fixed receptive field, which cannot adapt to the multi-dimensional feature distribution characteristics of small pig behavioral targets.

[0004] Specifically, firstly, existing technologies generally rely on fixed-scale pooling and convolution operations, which cannot mine multi-scale contextual information for the characteristics of small targets. They struggle to balance local details and global correlation features of small targets, and the single-scale feature extraction mode easily leads to the omission of subtle behavioral features and feature confusion, making them unsuitable for detecting small targets of different sizes and distances in pig behavior. Secondly, traditional feature construction methods lack specialized high-frequency edge enhancement techniques, resulting in insufficient ability to extract key high-frequency contour features such as limb deformation and subtle movements in pigs. The overall features of small targets are blurred, and the contour boundaries are unclear, making it difficult for the model to accurately capture subtle behavioral changes, significantly reducing the accuracy of identifying abnormal and refined behaviors. Thirdly, existing general-purpose models lack the ability to differentiate between massive feature pixels, failing to enhance effective small target behavioral features and suppress invalid background noise features. This results in high feature redundancy and a low proportion of effective features, affecting not only recognition accuracy but also causing computational redundancy and low operating efficiency, making it difficult to meet the application requirements of lightweight, real-time monitoring in embedded devices at the farming end.

[0005] In summary, current pig behavior recognition technologies generally suffer from bottlenecks such as weak small target feature extraction capabilities, poor multi-scale adaptability, low accuracy in recognizing subtle behaviors, and insufficient anti-interference capabilities. These bottlenecks severely restrict the accurate recognition of subtle pig behaviors and small, distant target behaviors in complex farming scenarios, failing to meet the high-precision, real-time, and robust monitoring requirements of modern smart farming. Therefore, there is an urgent need for a feature map construction and enhancement method that can target small pig behaviors and optimize them based on multiple scales within the feature map, addressing the industry's technical pain points of weakened small target features, loss of detail, and poor anti-interference capabilities in existing technologies. Summary of the Invention

[0006] To address the aforementioned technical problems, this invention provides a method for constructing a small-target feature enhancement model for pig behavior based on internal multi-scale methods. The method specifically comprises: S1. Construct an image acquisition and preprocessing unit: used to complete standardized preprocessing, noise suppression, and pre-positioning of small target areas for images of pigsty scenes; S2. Constructing the Feature Backbone Extraction Unit: Based on the lightweight C3k2 structure, perform hierarchical extraction of basic visual features of the image and output multi-scale basic feature maps; S3. Construct an internal multi-scale feature enhancement unit: Adaptive enhancement of small target features is achieved through channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight attention weighting.

[0007] Furthermore, the operation of the image acquisition and preprocessing unit includes image standardization, noise suppression, and small target region pre-location; the image standardization is used to unify image size, color gamut, and contrast; the noise suppression uses a combined filtering method to remove random environmental noise; the small target region pre-location is based on connected component analysis to identify potential small target regions.

[0008] Furthermore, the lightweight C3k2 structure is the C3k2 structure in the YOLOv11 model, and the C3k2 structure also includes a downsampling unit and a basic feature output unit.

[0009] Furthermore, in the feature backbone extraction unit, the downsampling unit uses a convolutional layer with a 2*2 kernel; the basic feature output unit outputs the basic feature maps extracted layer by layer according to scale, providing standardized input for internal multi-scale feature enhancement.

[0010] Furthermore, the operations of the internal multi-scale feature enhancement unit include channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight feature attention weighting.

[0011] Furthermore, the channel segmentation multi-scale pooling specifically involves dividing the input features into three branches along the channel dimension, performing adaptive average pooling, adaptive max pooling, and adaptive hybrid pooling respectively, and fusing the output features of the three branches to obtain a multi-scale feature map. Channel segmentation multi-scale pooling feature fusion formula: ; in, This is a feature of multi-scale pooling fusion; , , These are the three sets of feature branches after channel segmentation; For adaptive average pooling operation; For adaptive max pooling operation; For adaptive hybrid pooling operation; This is a feature concatenation operation.

[0012] Furthermore, the Laplacian edge detection extracts high-frequency edge information from multi-scale feature maps using Laplacian convolution kernels; Laplacian high-frequency edge feature extraction formula: ; in, Enhance the edge features of the output; For multi-scale feature maps in coordinates Pixel value at; It is a 3×3 Laplace convolution kernel. and This represents the coordinate offset during the convolution kernel's traversal. This represents the output edge enhancement feature map. The pixel coordinates on the screen.

[0013] Furthermore, the edge enhancement feature map After sequential convolution and batch normalization, the data is concatenated with multi-scale feature maps. The concatenated feature maps are then subjected to lightweight feature attention weighting to obtain small target enhanced feature maps.

[0014] Furthermore, the lightweight feature attention weighting is specifically performed as follows: the concatenated feature map is sequentially subjected to adaptive average pooling, convolutional feature extraction, ReLU activation function processing, convolutional feature extraction and Sigmoid activation function processing, the obtained feature map is multiplied with the original concatenated feature map, and the obtained feature map is input into the CBS module to obtain the small target enhancement feature map.

[0015] Furthermore, the CBS module sequentially comprises a convolutional layer, a batch normalization layer, and a SiLU activation function layer.

[0016] The beneficial effects of the model described in this invention are as follows: By employing a three-tiered feature enhancement mechanism—channel segmentation multi-scale pooling, Laplacian edge enhancement, and lightweight attention weighting—this system accurately captures multi-scale contextual and high-frequency contour features of small targets in pig behavior. This effectively alleviates the problems of blurred and lost small target features, significantly reducing false negative and false positive rates. It also eliminates scale discontinuities between shallow and deep features, constructing a complete small target feature representation system that can adapt to complex scenarios such as changes in pig posture, scale differences, and environmental interference, thereby greatly improving detection robustness. Attached Figure Description

[0017] Figure 1 This is a flowchart of the method described in an embodiment of the present invention; Figure 2 This is a flowchart of the data processing of the image acquisition and preprocessing unit in an embodiment of the present invention; Figure 3 This is a flowchart of the data processing of the feature backbone extraction unit in an embodiment of the present invention; Figure 4 This is a flowchart of the data processing of the internal multi-scale feature enhancement unit in an embodiment of the present invention. Detailed Implementation

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

[0019] Example 1 This embodiment provides a method for constructing a small-target feature enhancement model for pig behavior based on internal multi-scale features, such as... Figure 1 As shown, specifically: S1. Construct an image acquisition and preprocessing unit: acquire images of the pigsty scene, and perform standardized preprocessing, noise suppression, and pre-positioning of small target areas for the pigsty scene images; S2. Constructing the Feature Backbone Extraction Unit: Based on the lightweight C3k2 structure, perform hierarchical extraction of basic visual features of the image and output multi-scale basic feature maps; S3. Construct an internal multi-scale feature enhancement unit: Adaptive enhancement of small target features is achieved through channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight attention weighting.

[0020] Each of the above steps will be explained in detail.

[0021] S1. Constructing the Image Acquisition and Preprocessing Unit: The image acquisition and preprocessing module includes image standardization, noise suppression, and pre-location of small target regions. Image Standardization: The input pigsty scene image is normalized in size, converted in color gamut, and enhanced in contrast to unify the image data format and eliminate image differences caused by different acquisition angles and lighting environments. Noise Suppression: A combination of Gaussian filtering and median filtering is used to remove random noise generated by dust, light spots, and camera shake in the breeding environment, while preserving the original texture features of small targets. Pre-location of Small Target Regions: Based on image grayscale values ​​and connected component analysis, potential regions of small targets in the image are initially identified, and region boundaries are marked to reduce the invalid calculation range for subsequent feature extraction. The data processing flowchart of the image acquisition and preprocessing unit is as follows: Figure 2 As shown.

[0022] S2. Constructing the Feature Backbone Extraction Unit: Based on a lightweight C3k2 structure, hierarchical extraction of basic visual features of the image is completed, outputting multi-scale basic feature maps. The lightweight C3k2 structure is the C3k2 structure in the YOLOv11 model, which also includes a downsampling unit and a basic feature output unit. In the feature backbone extraction operation, the downsampling unit uses a 2*2 convolutional layer. The basic feature output unit outputs the hierarchically extracted basic feature maps according to scale, providing standardized input for internal multi-scale feature enhancement. The data processing flowchart of the feature backbone extraction unit is as follows: Figure 3 As shown.

[0023] S3. Constructing an internal multi-scale feature enhancement unit: The operations of the internal multi-scale feature enhancement unit include channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight feature attention weighting. This addresses the problems of insufficient feature extraction and blurred contours for small targets. Channel segmentation multi-scale pooling: The input features are equally divided into three independent feature branches along the channel dimension, and adaptive average pooling, adaptive max pooling and adaptive hybrid pooling are performed respectively. The output features of the three branches are then fused to obtain a multi-scale feature map. Channel segmentation multi-scale pooling feature fusion formula: ; in, This is a feature of multi-scale pooling fusion; , , These are the three sets of feature branches after channel segmentation; For adaptive average pooling operation; For adaptive max pooling operation; For adaptive hybrid pooling operation; This is a feature concatenation operation.

[0024] Laplacian edge detection: An independent edge detection branch is built, and the high-frequency edge information of multi-scale feature maps is extracted using Laplacian convolution kernels to enhance the contour feature representation of small targets in pig behavior and alleviate the feature blurring problem caused by the small size of small targets; Laplacian high-frequency edge feature extraction formula: ; in, Enhance the edge features of the output; Multi-scale pooling fusion features in coordinates Pixel value at; It is a 3×3 Laplace convolution kernel; , This represents the coordinate offset during the convolution kernel's traversal. This represents the output edge enhancement feature map. The pixel coordinates on the map also correspond to the input multi-scale pooling feature map. The position of the center pixel in the image.

[0025] Edge enhancement feature map After sequential convolution and batch normalization, the data is concatenated with multi-scale feature maps. The concatenated feature maps are then subjected to lightweight feature attention weighting to obtain small target enhanced feature maps.

[0026] The lightweight feature attention weighting is specifically performed as follows: the concatenated feature map is sequentially subjected to adaptive average pooling, convolutional feature extraction, ReLU activation function processing, convolutional feature extraction and Sigmoid activation function processing, the obtained feature map is multiplied with the original concatenated feature map, and the obtained feature map is input into the CBS module to obtain the small target enhancement feature map.

[0027] The CBS module sequentially comprises a convolutional layer, a batch normalization layer, and a SiLU activation function layer.

[0028] The data flow diagram of the internal multi-scale feature enhancement processing unit is as follows: Figure 4 As shown.

[0029] In summary, channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight feature attention weighting are complementary and synergistic in terms of their technical functions, rather than simply being superimposed on each other.

[0030] Channel segmentation multi-scale pooling can acquire contextual information within different receptive fields with low computational overhead, enhancing the network's adaptability to pig behavior targets at different scales. However, its ability to characterize the local contours and boundary details of small targets is relatively limited. Laplacian edge detection can highlight high-frequency edge information in images, strengthen the contour feature representation of small targets, and compensate for the lack of fine-grained edge information in the multi-scale pooling process. However, relying solely on edge information is easily affected by background texture and noise. Lightweight feature attention weighting can adaptively allocate weights to the fused multi-scale contextual features and edge detail features, suppressing redundant or interfering feature responses and highlighting more discriminative feature information for target detection.

[0031] Therefore, the three technologies enhance the feature representation of small targets from three levels: scale adaptation, edge enhancement, and feature selection, forming a technical whole that is interdependent, mutually restrictive, and synergistically optimized. This enables the network to improve the detection performance of pig behavioral targets with small scale, large scale variation, and unclear outlines while maintaining low computational complexity.

Claims

1. A method for constructing a small-target feature enhancement model of pig behavior based on internal multi-scale features, characterized in that, The method is specifically as follows: S1. Construct an image acquisition and preprocessing unit: acquire images of the pigsty scene, and perform standardized preprocessing, noise suppression, and pre-positioning of small target areas for the pigsty scene images; S2. Constructing the Feature Backbone Extraction Unit: Based on the lightweight C3k2 structure, perform hierarchical extraction of basic visual features of the image and output multi-scale basic feature maps; S3. Construct an internal multi-scale feature enhancement unit: Adaptive enhancement of small target features is achieved through channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight attention weighting.

2. The method for constructing a small-target feature enhancement model of pig behavior based on internal multi-scale as described in claim 1, characterized in that, The operation of the image acquisition and preprocessing unit includes image standardization, noise suppression, and small target region pre-location; the image standardization is used to unify image size, color gamut, and contrast; the noise suppression uses a combined filtering method to remove random environmental noise; the small target region pre-location is based on connected component analysis to identify potential small target regions.

3. The method for constructing a small-target feature enhancement model of pig behavior based on internal multi-scale as described in claim 2, characterized in that, The lightweight C3k2 structure is the C3k2 structure in the YOLOv11 model. The C3k2 structure also includes a downsampling unit and a basic feature output unit.

4. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale as described in claim 3, characterized in that, In the feature backbone extraction unit, the downsampling unit uses a convolutional layer with a 2*2 kernel; The basic feature output unit outputs the basic feature maps extracted hierarchically according to scale, providing standardized input for internal multi-scale feature enhancement.

5. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale according to claim 4, characterized in that, The operations of the internal multi-scale feature enhancement unit include channel segmentation multi-scale pooling, Laplacian edge detection, and lightweight feature attention weighting.

6. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale as described in claim 5, characterized in that, The channel segmentation multi-scale pooling is specifically as follows: the channel segmentation multi-scale pooling divides the input features into three branches along the channel dimension, performs adaptive average pooling, adaptive max pooling and adaptive hybrid pooling respectively, and fuses the output features of the three branches to obtain a multi-scale feature map; Channel segmentation multi-scale pooling feature fusion formula: ; in, This is a feature of multi-scale pooling fusion; , , These are the three feature branches after channel segmentation; For adaptive average pooling operation; For adaptive max pooling operation; For adaptive hybrid pooling operations; This is a feature concatenation operation.

7. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale according to claim 6, characterized in that, The Laplacian edge detection extracts high-frequency edge information from multi-scale feature maps using Laplacian convolution kernels; Laplacian high-frequency edge feature extraction formula: ; in, Enhance the edge features of the output; For multi-scale feature maps in coordinates Pixel value at; It is a 3×3 Laplace convolution kernel. and This represents the coordinate offset during the convolution kernel's traversal. This represents the output edge enhancement feature map. The pixel coordinates on the screen.

8. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale according to claim 7, characterized in that, Edge enhancement feature map After sequential convolution and batch normalization, the data is concatenated with multi-scale feature maps. The concatenated feature maps are then subjected to lightweight feature attention weighting to obtain small target enhanced feature maps.

9. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale as described in claim 8, characterized in that, The lightweight feature attention weighting is specifically performed as follows: the concatenated feature map is sequentially subjected to adaptive average pooling, convolutional feature extraction, ReLU activation function processing, convolutional feature extraction and Sigmoid activation function processing, the obtained feature map is multiplied with the original concatenated feature map, and the obtained feature map is input into the CBS module to obtain the small target enhancement feature map.

10. The method for constructing a small target feature enhancement model for pig behavior based on internal multi-scale according to claim 9, characterized in that, The CBS module sequentially comprises a convolutional layer, a batch normalization layer, and a SiLU activation function layer.