A livestock veterinarian waste classification method based on image processing

By setting up multi-level collection points and an image analysis system at the livestock and veterinary waste disposal channel, and combining light intensity distribution and color channel feature analysis, accurate classification and risk level determination of livestock and veterinary waste have been achieved. This solves the problems of misjudgment and omission in existing technologies, improves the robustness and reliability of detection, and ensures the safety and controllability of waste treatment.

CN121616898BActive Publication Date: 2026-04-21GUIZHOU HONGYU ANIMAL HUSBANDRY TECH DEV CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUIZHOU HONGYU ANIMAL HUSBANDRY TECH DEV CO LTD
Filing Date
2026-01-28
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing methods for managing livestock and veterinary waste rely on manual observation and experience, which cannot effectively identify residual signs such as drug liquids or bloodstains. This leads to drug residues being misjudged as low-risk waste and entering regular collection channels, posing a potential risk of secondary pollution and cross-infection.

Method used

By setting up multiple collection points at the waste disposal channel and combining industrial-grade cameras with an image analysis system, full-process, multi-angle image acquisition is carried out. By analyzing light intensity distribution characteristics and color channel features, a local light intensity non-uniformity index Lnu and a color coupling ratio index Ccr are constructed to achieve accurate classification and risk level determination of waste and implement corresponding disposal strategies.

Benefits of technology

It has improved the completeness and accuracy of waste classification and testing, reduced misjudgments and omissions, established a long-term risk prevention and management system, and enhanced the safety and controllability of livestock and veterinary waste treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121616898B_ABST
    Figure CN121616898B_ABST
Patent Text Reader

Abstract

The application discloses a kind of classification methods of waste of livestock veterinarian based on image processing, it is related to image processing technical field, the method is by setting multistage acquisition point in waste disposal channel, and is combined with industrial grade camera and image analysis system, realizes waste in input, stationary and local key area Whole process, multi-angle image acquisition, can obtain global appearance image data, complete static image data and local detail image data.Through this setting, effectively avoid the problem of incomplete image information caused by single-point collection, so that the detection algorithm can analyze the overall structure and local residual signs at the same time, greatly improve the integrity and accuracy of classification detection.At the same time, the introduction of interest region division and preprocessing technology can significantly reduce background interference and noise, optimize the stability of image feature extraction, so as to ensure that the results of subsequent light intensity distribution analysis and color anomaly detection are more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, specifically to a method for classifying livestock and veterinary waste based on image processing. Background Technology

[0002] Animal husbandry and veterinary activities generate a large amount of medical waste, such as syringes, medicine bottles, infusion bags, gauze, and cotton swabs, which may contain drug or biological residues. If this waste is not scientifically classified and effectively treated, it may pose serious threats to environmental safety and public health. Therefore, how to accurately identify and classify animal husbandry and veterinary waste through advanced image processing and intelligent analysis methods has become an important technical challenge in this field.

[0003] Currently, the management of livestock and veterinary waste mainly relies on manual observation and experience. Although image acquisition equipment has been introduced in some applications, it mostly only focuses on morphological feature detection and cannot effectively identify residues such as drug liquids or bloodstains. Especially in scenarios lacking fluorescence detection equipment, existing image detection algorithms have low accuracy in identifying drug residues, easily leading to missed detections and false positives. This results in some waste containing drug residues being misclassified as low-risk waste and entering regular collection channels, posing a potential risk of secondary contamination and cross-contamination.

[0004] The main reason for this situation is that traditional image detection methods rely excessively on lighting conditions and surface morphology features, while lacking effective simulation and amplification of the optical characteristics of the residue itself. When the amount of waste residue is small or unevenly distributed, it is difficult to form obvious color differences and brightness anomalies under conventional imaging conditions, causing the detection algorithm to fail to reliably identify residue signs. As a result, residues are not accurately detected, leading to the entry of hazardous waste into ordinary recycling systems. This not only increases the risk burden in the waste disposal process but may also have adverse effects on livestock farming environments and public health safety, making it difficult to trace and control potential hazards in a timely manner. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a classification method for livestock and veterinary waste based on image processing, which solves the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for classifying livestock and veterinary waste based on image processing, comprising the following steps:

[0007] S1. By setting up collection points in the waste disposal channel, waste image data is obtained, and then the waste image data is preprocessed to obtain a preprocessed image. Based on the preprocessed image, feature extraction is performed to obtain the first image feature set.

[0008] S2. Analyze the light intensity distribution characteristics of the local area of ​​the waste based on the first image feature set, and make a preliminary judgment based on the results of the light intensity distribution characteristic analysis;

[0009] S3. When it is initially determined that there are residual suspicious features, perform color channel feature analysis on the preprocessed image to obtain a second image feature set, and perform color anomaly depth detection analysis based on the second image feature set. Based on the color anomaly depth detection analysis results, classify the residual risk level and execute the corresponding disposal strategy.

[0010] Preferably, S1 includes S11;

[0011] S11. Set up collection points in the waste disposal channel and install industrial-grade cameras in the collection points to collect waste image data in real time; establish a network connection between the industrial-grade cameras and the waste image analysis system through the local area network, and transmit the collected waste image data to the waste image analysis system.

[0012] The waste image analysis system is set up on the server side;

[0013] The acquisition points include global acquisition points, local focused acquisition points, and static area acquisition points;

[0014] The waste image data includes global appearance image data, complete static image data, and detailed image data.

[0015] Preferably, S1 further includes S12;

[0016] S12. In the waste image analysis system, image processing technology is used to divide the waste image data into points of interest to obtain several regions of interest images; and the images of several regions of interest are preprocessed to obtain preprocessed images.

[0017] The image processing techniques include geometrically regular region segmentation techniques, edge detection contour extraction techniques, color and brightness distribution pixel segmentation techniques, and image morphology operation region optimization techniques.

[0018] The region of interest image includes an image of the container opening area, an image of the container subject area, an image of the sharp object tip area, an image of the fiber adsorption area, and an image of the background contrast area.

[0019] The preprocessing includes noise suppression, grayscale normalization, edge optimization, and background removal.

[0020] Preferably, S1 further includes S13;

[0021] S13. Based on the acquired preprocessed image, perform feature extraction to obtain the first image feature set;

[0022] The first image feature set includes the gray value I of the i-th pixel within the region of interest. i And the mean gray level of the region of interest, Iavg;

[0023] The region of interest in the preprocessed image is scanned pixel by pixel, and the gray value I of each pixel is obtained using image matrix reading technology, forming a pixel gray-level distribution feature vector. The components of the pixel gray-level distribution feature vector represent the gray value I of the i-th pixel within the region of interest. i ;

[0024] Then, the grayscale values ​​I of all pixels are averaged to obtain the average grayscale value Iavg of the region of interest.

[0025] Preferably, S2 includes S21;

[0026] S21. Perform light intensity distribution characteristic analysis based on the first image feature set. The light intensity distribution characteristic analysis is performed by comparing the gray value I of the i-th pixel. i The difference between the grayscale mean Iavg of the region of interest and the mean grayscale value is normalized to obtain the local light intensity non-uniformity index Lnu, which characterizes the uniformity of light intensity distribution in the region of interest. This local light intensity non-uniformity index Lnu serves as the basis for detecting residual signs. The specific calculation formula for the local light intensity non-uniformity index Lnu is as follows: In the formula: N represents the total number of pixels in the region of interest.

[0027] Preferably, S2 further includes S22;

[0028] S22. After acquiring the local light intensity non-uniformity index Lnu, a preliminary judgment is made on the waste in all regions of interest. The preliminary judgment is made by using a preset light intensity non-uniformity judgment threshold TL and the real-time acquired local light intensity non-uniformity index Lnu. The specific judgment content is as follows:

[0029] When the local light intensity non-uniformity index Lnu is less than the light intensity non-uniformity judgment threshold TL, the corresponding waste is judged to have uniform light intensity and enters the regular collection channel.

[0030] When the local light intensity non-uniformity index Lnu is greater than or equal to the light intensity non-uniformity judgment threshold TL, the corresponding waste is judged to have non-uniform light intensity and has residual suspicious features. At this time, the preprocessed images of all suspicious regions of interest are summarized into a suspicious image set and then entered into color channel feature analysis.

[0031] Preferably, S3 includes S31;

[0032] S31. After initially determining that there are residual suspicious features, the color channel feature analysis is performed. The color channel feature analysis separates all preprocessed images in the suspicious image set according to the red channel, green channel and blue channel to obtain the color channel set.

[0033] The color channel set includes the red channel value R of the j-th pixel. j The green channel value G of the j-th pixel j And the blue channel value B of the j-th pixel j ;

[0034] The brightness values ​​of pixels in each color channel are then averaged to obtain the second image feature set.

[0035] The second image feature set includes the red channel mean Rmean, the green channel mean Gmean, and the blue channel mean Bmean.

[0036] Preferably, S3 includes S32;

[0037] S32. Based on the second image feature set, perform color anomaly depth detection and analysis on all preprocessed images in the suspicious image set to obtain the color coupling ratio index Ccr. The color coupling ratio index Ccr is calculated by the ratio relationship between the red channel mean Rmean, the green channel mean Gmean, and the blue channel mean Bmean, quantifying the degree of color distribution anomaly in the waste image. The specific calculation formula for the color coupling ratio index Ccr is: Ccr = Rmean / Gmean + Bmean.

[0038] Preferably, S3 includes S33;

[0039] S33. Based on the color anomaly depth detection and analysis results, residue risk level classification is performed. This classification compares the residue risk level with a preset first color judgment threshold T1 and a second color judgment threshold T2, using the real-time acquired color coupling ratio index Ccr. Based on the comparison results, residue risk level classification is performed on all preprocessed images in the suspicious image set. The specific details are as follows:

[0040] When the color coupling ratio index Ccr < the first color judgment threshold T1, all preprocessed images in the current suspicious image set will be classified as L1 level.

[0041] When the first color determination threshold T1 ≤ color coupling ratio index Ccr < the second color determination threshold T2, all preprocessed images in the current suspicious image set will be classified as L2 level.

[0042] When the color coupling ratio index Ccr is greater than or equal to the second color determination threshold T2, all preprocessed images in the current suspicious image set are classified as L3 level.

[0043] Preferably, S3 further includes S31;

[0044] S31. Based on the risk level classification results of residues, corresponding disposal strategies and traceability recording mechanisms; among which, the specific disposal strategies are as follows:

[0045] When classified as L1, the corresponding waste will be sent to the regular collection channel;

[0046] When classified as Level L2, the corresponding waste will undergo secondary disinfection, and a manual verification will be requested.

[0047] When classified as L3, the corresponding waste will be placed in a dedicated hazardous waste isolation channel;

[0048] The traceability and recording mechanism synchronously stores the corresponding residual risk level, all pre-processed images in the suspicious image set, detection time, and disposal process information in the waste management database for waste classified as L2 and L3.

[0049] This invention provides a method for classifying livestock and veterinary waste based on image processing. It has the following beneficial effects:

[0050] (1) This method, by setting up multi-level collection points in the waste disposal channel and combining industrial-grade cameras with an image analysis system, achieves full-process, multi-angle image acquisition of waste at the disposal, static, and key local areas. It can acquire global appearance image data, complete static image data, and local detail image data. This setup effectively avoids the problem of incomplete image information caused by single-point acquisition, allowing the detection algorithm to analyze the overall structure and local residual signs simultaneously, greatly improving the completeness and accuracy of classification detection. At the same time, the introduction of region of interest division and preprocessing techniques can significantly reduce background interference and noise, optimize the stability of image feature extraction, and thus ensure that the results of subsequent light intensity distribution analysis and color anomaly detection are more reliable.

[0051] (2) This method constructs a local light intensity non-uniformity index Lnu based on grayscale distribution and compares it with a preset light intensity non-uniformity judgment threshold TL, thereby achieving quantitative judgment of potential residual characteristics of waste. Compared with existing methods that rely on manual observation or single color judgment, this method can maintain high detection sensitivity and discrimination accuracy even under complex lighting conditions or uneven residual distribution, effectively reducing false judgments and false negatives. At the same time, the subsequent introduction of color channel feature analysis and the calculation of the color coupling ratio index Ccr allows the residual risk to be initially screened not only through light intensity differences but also further verified through color distribution depth, thus achieving two-level judgment that complements each other and improves the robustness and reliability of the overall detection.

[0052] (3) This method introduces a residual risk level classification mechanism and a traceability recording mechanism on the basis of residual detection, classifying the detection results into three levels: low-risk (L1), medium-risk (L2), and high-risk (L3), and adopting different disposal strategies accordingly. For example, low-risk waste directly enters the regular collection channel, medium-risk waste undergoes secondary disinfection and prompts for manual verification, and high-risk waste enters the dedicated isolation channel for hazardous waste. At the same time, for medium- and high-risk waste, the system synchronously stores its risk level, detection images, time, and disposal process in the waste management database, realizing traceable management of the entire life cycle of waste. This mechanism not only improves the scientificity and precision of waste classification and treatment, but also enhances the operability of subsequent supervision and statistical analysis, which helps to establish a long-term risk prevention and management system and significantly improves the safety and controllability of livestock and veterinary waste treatment. Attached Figure Description

[0053] Figure 1 This is a schematic diagram illustrating the steps of a method for classifying livestock and veterinary waste based on image processing according to the present invention.

[0054] Figure 2 A schematic diagram showing the setup of the data collection points. Detailed Implementation

[0055] 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.

[0056] Example 1: This invention provides a method for classifying livestock and veterinary waste based on image processing. Please refer to [link to relevant documentation]. Figure 1 and Figure 2 This includes the following steps:

[0057] S1. By setting up collection points in the waste disposal channel, waste image data is obtained, and then the waste image data is preprocessed to obtain a preprocessed image. Based on the preprocessed image, feature extraction is performed to obtain the first image feature set.

[0058] S2. Analyze the light intensity distribution characteristics of the local area of ​​the waste based on the first image feature set, and make a preliminary judgment based on the results of the light intensity distribution characteristic analysis;

[0059] S3. When it is initially determined that there are residual suspicious features, perform color channel feature analysis on the preprocessed image to obtain a second image feature set, and perform color anomaly depth detection analysis based on the second image feature set. Based on the results of the color anomaly depth detection analysis, classify the residual risk level and implement the corresponding disposal strategy.

[0060] In this embodiment, global, static, and local focused acquisition points are first set up in the waste disposal channel. This allows for the acquisition of image data in three states: waste in motion, static, and key residue areas. This arrangement avoids information loss caused by single-point acquisition. For example, if acquisition is only performed at the disposal port, motion blur can prevent the identification of liquid residue at the bottle opening. Acquisition in the static area compensates for motion blur. At the same time, the local focused acquisition points can capture detailed images of high-risk areas such as the bottle opening and syringe tail, ensuring data integrity and accuracy. Subsequently, by preprocessing the acquired images, including noise suppression, grayscale normalization, and edge enhancement, the influence of changes in ambient lighting and equipment noise interference can be effectively eliminated. This preprocessing process makes the subsequently extracted grayscale features more stable and comparable. For example, when the lighting at the acquisition point is dim, without grayscale normalization, the calculated grayscale differences will be masked by the overall brightness, resulting in insensitive residue detection. However, through preprocessing, the true light intensity distribution is restored. In the light intensity distribution characteristic analysis stage, the local light intensity non-uniformity index Lnu is used to quantify the pixel grayscale deviation. When Lnu exceeds the judgment threshold TL, it can identify the light spots or shadows formed locally by residual liquid. The physical significance of this design is that drug or blood residues usually change the uniformity of regional light intensity distribution, and non-uniformity detection is the means to capture this change. Without this analysis, many residues are difficult to detect with the naked eye and can easily enter the regular channels, causing risks. Furthermore, color channel feature analysis is performed on suspicious areas, and abnormal depth detection is performed through the color coupling ratio Ccr, which can distinguish between normal color fluctuations and specific changes in drug residues. For example, blood in the red channel will cause Rmean to be significantly higher than Gmean and Bmean, and Ccr will increase significantly. This ratio analysis can avoid misjudgment caused by relying solely on single-channel thresholds, making residue detection more sensitive and discriminative. Finally, the results are divided into three risk levels: low, medium, and high, and different disposal strategies and traceability mechanisms are set, so that the entire system can not only identify residues, but also track and isolate medium- and high-risk waste. This not only improves the accuracy and sensitivity of detection, but also ensures the safety and controllability of waste disposal in practical operation, avoiding secondary pollution and cross-infection caused by unidentified residues.

[0061] Example 2: Please refer to Figure 1 and Figure 2 Specifically: S1 includes S11;

[0062] S11. Set up collection points in the waste disposal channel and install industrial-grade cameras in the collection points to collect waste image data in real time; establish a network connection between the industrial-grade cameras and the waste image analysis system through the local area network, and transmit the collected waste image data to the waste image analysis system.

[0063] The waste image analysis system is set up on the server side;

[0064] The acquisition points include global acquisition points, local focused acquisition points, and static area acquisition points;

[0065] Waste image data includes global appearance image data, complete static image data, and detailed image data;

[0066] The global collection point is set above the entrance of the waste disposal channel. The collection point at the disposal port is equipped with a fixed industrial-grade camera to monitor the entire waste in real time at the moment of waste disposal, so as to collect global appearance image data of the waste in motion.

[0067] The static area collection point is set above the static area at the end of the waste disposal channel. The static area collection point is equipped with a stably installed industrial-grade camera to collect data when the waste is stationary, so as to reduce image blurring caused by movement and obtain complete static image data of the waste.

[0068] Localized focusing collection points are set up on both sides of the waste disposal channel, corresponding to key areas such as the bottle opening, syringe tail, and infusion bag interface. The localized focusing collection points are equipped with industrial-grade cameras with zoom function to collect local close-up image data of the above-mentioned key areas in order to obtain detailed image data that may contain signs of drug residues or biological residues.

[0069] S1 also includes S12;

[0070] S12. In the waste image analysis system, image processing technology is used to divide the waste image data into points of interest to obtain several regions of interest images; and the images of several regions of interest are preprocessed to obtain preprocessed images.

[0071] Image processing techniques include geometrically regular region segmentation techniques, contour extraction techniques for edge detection, pixel segmentation techniques for color and brightness distribution, and region optimization techniques for image morphology operations.

[0072] The region of interest images include images of the container opening area, the container subject area, the sharp object tip area, the fiber adsorption area, and the background contrast area.

[0073] Preprocessing includes noise suppression, grayscale normalization, edge optimization, and background removal.

[0074] Noise suppression processing uses image denoising techniques such as Gaussian filtering, mean filtering, or median filtering to smooth the pixels in each region of interest in order to eliminate sensor noise and background interference.

[0075] Gray-level normalization processing adjusts the pixel value distribution to a uniform range by linearly normalizing or histogram equalizing the pixel gray-level values ​​of the preprocessed image, thereby improving the contrast and consistency of the image under different acquisition environments.

[0076] Edge enhancement processing sharpens the boundaries of bottle openings, syringe tails, infusion bag interfaces, and other key areas in waste images by employing the Laplacian operator, Sobel operator, or other edge enhancement techniques to highlight the location of potential residue signs.

[0077] Background removal processing uses image morphological operations, including erosion, dilation, opening or closing operations, to remove the background area of ​​waste images in order to reduce the impact of background information on the residue detection results.

[0078] Based on geometric rules, the overall outer contour of waste is divided into regions, such as dividing the image into upper, middle, lower or edge parts, which is suitable for regular structures such as syringes or bottles, thereby quickly generating regions of interest and meeting the needs of real-time detection.

[0079] At the same time, edge detection technology can be combined, such as using the Sobel operator or Canny operator to extract the contour features of waste, and identify key parts such as bottle mouth, needle tip or interface according to the boundary shape, so as to ensure accurate division of high-risk areas.

[0080] In addition, pixel segmentation technology based on color and brightness distribution can be used to separately divide parts of the image with color abrupt changes or abnormal brightness. This is especially suitable for waste materials such as gauze, cotton swabs or filter materials that easily absorb liquids, in order to highlight potential drug or blood residue.

[0081] For situations with complex backgrounds or unclear boundaries of waste, image morphology operations can be used to optimize regions. Irrelevant backgrounds can be removed and the main structure enhanced through processing methods such as erosion, dilation, opening, or closing operations, thereby improving the stability and reliability of region of interest segmentation.

[0082] S1 also includes S13;

[0083] S13. Based on the acquired preprocessed image, perform feature extraction to obtain the first image feature set;

[0084] The first image feature set includes the gray value I of the i-th pixel within the region of interest. i And the mean gray level of the region of interest, Iavg;

[0085] The region of interest in the preprocessed image is scanned pixel by pixel. An image matrix readout technique is used to obtain the grayscale value I of each pixel, forming a pixel grayscale distribution feature vector. The components of this feature vector represent the grayscale value I of the i-th pixel within the region of interest.i ;

[0086] Then, the grayscale values ​​I of all pixels are averaged to obtain the average grayscale value Iavg of the region of interest.

[0087] In this embodiment, in S11, the method sets up global acquisition points, static area acquisition points, and local focused acquisition points in the waste disposal channel, and configures industrial-grade cameras to ensure complete image data is acquired under different conditions. For example, if only acquisition is performed at the disposal port, the waste is easily blurred when in motion, making it impossible to identify residual droplets at the bottle opening; while the static area acquisition point can capture a clear image of the waste after it has come to a standstill, thus compensating for this problem. The local focused acquisition point magnifies details in high-risk areas such as the bottle opening and the tail of the syringe, ensuring that residue detection is not masked by the low resolution in the global image. The physical significance of this distributed acquisition is that by acquiring images from multiple angles and in multiple states, information loss is avoided and the overall recognition accuracy is improved. In S12, through region of interest segmentation and image preprocessing, the complex background and main body of the waste image can be separated, highlighting the characteristics of high-risk areas. For example, for fibrous waste such as gauze and cotton swabs, due to their complex surface texture, if noise suppression and background removal are not performed, the grayscale distribution will be interfered with by background clutter, leading to distortion in subsequent analysis. By employing Gaussian filtering and morphological operations, sensor noise and non-target areas can be effectively removed, making the preprocessed image more consistent with the true optical meaning: that is, only pixel features related to potential residues are retained. This not only improves the accuracy of feature extraction but also reduces algorithmic misjudgments and invalid calculations, thereby increasing efficiency. In S13, grayscale values ​​are extracted pixel by pixel and the grayscale mean of the region of interest is calculated to establish the first image feature set, in order to quantify the local light intensity distribution. The grayscale mean Iavg provides a benchmark for the brightness of a region, while the grayscale value I of each pixel... i The difference from the mean reveals the uneven light intensity that residual traces may cause. For example, if there is a small amount of residual medication inside the syringe, the grayscale distribution in that area will be significantly higher than the mean, thus forming an abnormal feature vector in the feature set. The physical significance of this process is that it transforms subtle differences in residual substances that are difficult to detect visually into measurable numerical features, ensuring the objectivity and stability of the detection results.

[0088] Example 3: Please refer to Figure 1 Specifically: S2 includes S21;

[0089] S21. Analyze the light intensity distribution characteristics based on the first image feature set. The light intensity distribution characteristics analysis is performed by comparing the gray value I of the i-th pixel. iThe difference between the grayscale mean Iavg of the region of interest and the mean grayscale value is normalized to obtain the local light intensity non-uniformity index Lnu, which characterizes the uniformity of light intensity distribution in the region of interest. The local light intensity non-uniformity index Lnu serves as the basis for detecting residual signs. The specific calculation formula for the local light intensity non-uniformity index Lnu is as follows: In the formula: N represents the total number of pixels in the region of interest;

[0090] The formula originates from the normalized deviation calculation method in the field of image processing and pattern recognition. Its original form is consistent with the classic mean absolute deviation, that is, the light intensity fluctuation in the region is measured by the deviation between the pixel gray value and the average gray value. Based on the original mean absolute deviation, this application introduces the region average gray value μR as a normalization factor to standardize the deviation relative to the average value, thereby avoiding the problem of incomparability of calculation results under different brightness conditions and ensuring robustness and universality across scenes.

[0091] The derivation of this formula involves the grayscale value I of each pixel. i The absolute value of the difference between the grayscale mean Iavg of the region of interest is taken to obtain the local deviation. Then, the local deviations of all pixels are accumulated, and the average grayscale value is normalized to eliminate the influence of different brightness conditions. The deviation results of all pixels are averaged, that is, divided by the total number of pixels NNN, to obtain the normalized light intensity non-uniformity index Lnu.

[0092] S2 also includes S22;

[0093] S22. After acquiring the local light intensity non-uniformity index Lnu, a preliminary judgment is made on the waste in all regions of interest. The preliminary judgment is made by comparing the preset light intensity non-uniformity judgment threshold TL with the real-time acquired local light intensity non-uniformity index Lnu; the specific judgment content is as follows:

[0094] When the local light intensity non-uniformity index Lnu is less than the light intensity non-uniformity judgment threshold TL, the corresponding waste is judged to have uniform light intensity and enters the regular collection channel.

[0095] When the local light intensity non-uniformity index Lnu is greater than or equal to the light intensity non-uniformity judgment threshold TL, the corresponding waste is judged to have non-uniform light intensity and has residual suspicious features. At this time, the preprocessed images of all suspicious regions of interest are summarized into a suspicious image set and then entered into color channel feature analysis.

[0096] The threshold TL for determining light intensity non-uniformity is set by collecting a large number of waste samples, calculating the local light intensity non-uniformity index Lnu value for each sample, constructing a numerical distribution range, and calibrating the critical point of the local light intensity non-uniformity index Lnu value under the known conditions of "with residue" and "without residue". The threshold TL for determining light intensity non-uniformity is then corrected and adaptively adjusted in combination with the light intensity at the collection site, the sensitivity of the camera equipment, and the type of waste (such as bottles, syringes, gauze).

[0097] In this embodiment, in S21, the difference between the grayscale value Ii of each pixel within the region of interest and the average grayscale value Iavg of the region is normalized to obtain the local light intensity non-uniformity index Lnu. The purpose of Lnu is to quantify the light intensity fluctuations caused by residue. Relying solely on visual observation or direct comparison of grayscale values ​​is highly susceptible to changes in light intensity and device sensitivity, easily leading to incomparable results under different scenarios. Introducing the mean μR as a normalization factor ensures the comparability of calculation results under different acquisition conditions. The physical meaning is that "residual traces alter the light intensity uniformity of the region." For example, if there is a trace amount of residual medication inside a syringe, it will form uneven spots in the grayscale distribution. This can be stably captured by the Lnu index, thereby improving the robustness of the detection. In S22, by setting a light intensity non-uniformity judgment threshold TL, the numerical result of Lnu is transformed into a clear preliminary conclusion of "whether there is suspicious residue." Without setting a threshold, the system will be unable to distinguish between normal texture differences and residue anomalies, leading to misjudgments. The determination of TL (Last Nu) is achieved through extensive sample calibration, making it the critical point distinguishing between "residue" and "no residue." For example, when ambient light is too strong, shadows in a normal background can also increase Lnu (Last Nu). In this case, by combining device sensitivity and waste type to adjust the threshold, false alarms due to background interference are avoided. The physical significance of this implementation is to ensure that the judgment standard is both scientific and adaptive, achieving a unified judgment logic under different acquisition environments. Overall, the combination of S21 and S22 transforms the detection process from "image features" to "quantitative indicators," and then to "risk judgment," that is, converting potential residues from invisible pixel fluctuations into a quantifiable numerical threshold. This not only improves the stability and accuracy of detection but also makes the system universal and scalable under complex lighting conditions and different waste types.

[0098] Example 4: Please refer to Figure 1 Specifically: S3 includes S31;

[0099] S31. After initially determining that the image is a residual suspicious feature, the color channel feature analysis is performed. The color channel feature analysis separates all preprocessed images in the suspicious image set according to the red channel, green channel and blue channel to obtain the color channel set.

[0100] The color channel set includes the red channel value R of the j-th pixel. j The green channel value G of the j-th pixel j And the blue channel value B of the j-th pixel j ;

[0101] The brightness values ​​of pixels in each color channel are then averaged to obtain the second image feature set.

[0102] The second image feature set includes the red channel mean Rmean, the green channel mean Gmean, and the blue channel mean Bmean.

[0103] S3 includes S32;

[0104] S32. Based on the second image feature set, perform color anomaly depth detection and analysis on all preprocessed images in the suspicious image set to obtain the color coupling ratio index Ccr. The color coupling ratio index Ccr is calculated by the ratio between the red channel mean Rmean, the green channel mean Gmean, and the blue channel mean Bmean, quantifying the degree of color distribution anomaly in the waste image. The specific calculation formula for the color coupling ratio index Ccr is: Ccr = Rmean / Gmean + Bmean.

[0105] This formula is based on the color ratio analysis method commonly used in image processing, which is often used in medical imaging and pollution detection to detect red or dark residual areas. In this application, the mean value of the red channel is selected as the numerator, and the sum of the mean values ​​of the green and blue channels is selected as the denominator, emphasizing the proportional relationship between the red component and the background color component. Compared with single-channel threshold detection, this coupled ratio method can more sensitively reflect the color anomalies of residual liquids (such as blood and medicine) on waste.

[0106] S3 includes S33;

[0107] S33. Based on the color anomaly depth detection and analysis results, residue risk level classification is performed. The residue risk level classification is achieved by comparing the preset first color judgment threshold T1 and second color judgment threshold T2 with the real-time acquired color coupling ratio index Ccr, and the residue risk level is classified for all preprocessed images in the suspicious image set based on the comparison results; the specific content is as follows:

[0108] When the color coupling ratio index Ccr < the first color judgment threshold T1, all preprocessed images in the current suspicious image set are classified as L1 level, indicating low risk.

[0109] When the first color judgment threshold T1 ≤ color coupling ratio index Ccr < the second color judgment threshold T2, all preprocessed images in the current suspicious image set will be classified as L2 level, indicating medium risk.

[0110] When the color coupling ratio index Ccr is greater than or equal to the second color judgment threshold T2, all preprocessed images in the current suspicious image set will be classified as L3 level, indicating high risk.

[0111] The first color determination threshold T1 and the second color determination threshold T2 are obtained as follows: image samples of waste with known residues and without known residues are collected, the corresponding color coupling ratio index Ccr values ​​are calculated, and the critical intervals for different risk levels are determined; statistical modeling of the color coupling ratio index Ccr distribution of a large number of samples is performed, distribution characteristics are extracted, and a reasonable range of threshold intervals is determined; the first color determination threshold T1 and the second color determination threshold T2 are adaptively adjusted in combination with the ambient lighting conditions, the sensitivity of the image acquisition equipment, and the material characteristics of the waste, so as to ensure the scientificity and stability of the classification results.

[0112] S3 also includes S31;

[0113] S31. Based on the risk level classification results of residues, corresponding disposal strategies and traceability recording mechanisms; among which, the specific disposal strategies are as follows:

[0114] When classified as L1, the corresponding waste will be sent to the regular collection channel;

[0115] When classified as Level L2, the corresponding waste will undergo secondary disinfection, and a manual verification will be requested.

[0116] When classified as L3, the corresponding waste will be placed in a dedicated hazardous waste isolation channel;

[0117] The traceability and recording mechanism synchronously stores the corresponding residual risk level, all pre-processed images in the suspicious image set, detection time, and disposal process information in the waste management database for waste classified as L2 and L3. This supports subsequent waste tracking, risk statistics, and regulatory audits, thereby achieving full life-cycle traceability management of medium- and high-risk waste.

[0118] In this embodiment, in S31, the suspicious image is separated into three channels: red, green, and blue, and the mean value of each channel is calculated. The purpose is to transform complex color information into quantifiable numerical features. If the original color image is used directly, it is easily affected by the intensity of light and the shooting angle, resulting in deviations. However, by extracting the channel mean value, the overall distribution characteristics of a certain type of color in the image can be stably reflected. For example, at the end of the syringe, a trace amount of blood residue will significantly increase the mean value of the red channel. This processing method can effectively distinguish between clean areas and potential residue areas. In S32, the color coupling ratio index Ccr is designed to enhance the sensitivity to color anomalies in residue areas. Using the red channel alone may misjudge a normal red bottle surface as residue, while calculating the ratio of the red channel to the green and blue channels can eliminate the color interference of the material itself and highlight the color shift caused by the residue liquid. Its physical meaning is "whether the proportion of abnormal red is abnormal relative to the background components." For example, when gauze absorbs the medicine, the green and blue channels will weaken, and the Ccr value will rise rapidly, which can achieve rapid and stable anomaly detection. In S33, by setting two grading thresholds, T1 and T2, Ccr values ​​are divided into three risk levels: low, medium, and high, avoiding the ambiguity caused by binary judgment. If only a single threshold is set, samples near the critical value will frequently be misjudged, while the grading strategy can provide more detailed risk control for residues in the gray area. For example, if the Ccr is close to T2, it is judged as medium-risk L2 and enters the secondary disinfection process, instead of being ignored, thereby reducing potential safety hazards. In S34, a differentiated disposal strategy is implemented based on the residual risk level, and a traceability record mechanism is established. The purpose of this is to seamlessly connect detection with subsequent treatment, realizing a closed loop of "detection-disposal-tracing". For example, medium-risk L2 waste needs to be manually reviewed and enter secondary disinfection. If an anomaly occurs afterward, the images, judgment results, and processing procedures at that time can be directly retrieved from the database for tracing, ensuring that responsibility is traceable and risks are controllable. Overall, the implementation methods of S31 to S34 not only achieved accurate classification of residual risks, but also solved the problem of misjudgment caused by light interference and similar color and material through multi-channel analysis and coupling ratio calculation. At the same time, through classification and traceability mechanisms, it ensured that the test results could be truly transformed into actual prevention and control measures.

[0119] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for classifying waste in animal husbandry based on image processing, characterized by: The method comprises the following steps: S1, acquiring waste image data by setting a collection point in the waste throwing channel, preprocessing the waste image data to obtain preprocessed images, and extracting features based on the preprocessed images to obtain a first image feature set; S1 comprises S11; S11, setting a collection point in the waste throwing channel and setting an industrial camera in the collection point to collect waste image data in real time; and establishing a network connection between the industrial camera and a waste image analysis system through a local area network, and transmitting the collected waste image data to the waste image analysis system; The waste image analysis system is arranged on a server side; The collection point comprises a global collection point, a local focus collection point, and a static area collection point; The waste image data comprises global appearance image data, complete static image data, and detail image data; S2, analyzing the light intensity distribution characteristics of the local area of the waste based on the first image feature set, and making a preliminary determination based on the light intensity distribution characteristic analysis result; S2 comprises S21; S21, performing light intensity distribution characteristic analysis based on the first image feature set, wherein the light intensity distribution characteristic analysis is performed by comparing the gray value I i of the i-th pixel with the gray mean value Iavg of the region of interest and performing normalization operation to obtain a local light intensity non-uniformity index Lnu for representing light intensity distribution uniformity of the region of interest, wherein the local light intensity non-uniformity index Lnu is used as a detection basis for the residual trace; and a specific calculation formula of the local light intensity non-uniformity index Lnu is as follows: ; wherein N represents a total number of pixels in the region of interest. S3, when there is a residual suspicious feature in the preliminary determination, performing color channel feature analysis on the preprocessed images to obtain a second image feature set, performing color anomaly depth detection analysis based on the second image feature set, classifying the residual risk level based on the color anomaly depth detection analysis result, and executing a corresponding disposal strategy; S3 comprises S31; S31, after the preliminary determination of the residual suspicious feature, color channel feature analysis is performed, which separates all preprocessed images in the suspicious image set according to the red channel, green channel and blue channel to obtain a color channel set; The set of color channels includes a red color channel value R j , a green color channel value G j , and a blue color channel value B j of the jth pixel. And the mean value of the brightness value of the pixels in each color channel is statistically processed to obtain a second image feature set; The second image feature set comprises a red channel mean value Rmean, a green channel mean value Gmean, and a blue channel mean value Bmean; S3 comprises S32; S32, based on the second image feature set, color anomaly depth detection analysis is performed on all preprocessed images in the suspicious image set to obtain a color coupling ratio index Ccr, wherein the color coupling ratio index Ccr is calculated by the ratio relationship between the red channel mean value Rmean, the green channel mean value Gmean and the blue channel mean value Bmean, and quantifies the abnormal degree of color distribution in the waste image; the specific calculation formula of the color coupling ratio index Ccr is: Ccr=Rmean / Gmean+Bmean.

2. A method for classifying waste based on image processing for livestock veterinarian use according to claim 1, characterized in that: S1 further comprises S12; S12, in the waste image analysis system, using image processing technology to divide the waste image data into interest points to obtain a plurality of interest region images; and preprocessing the plurality of interest region images to obtain preprocessed images; The image processing technology comprises geometric rule region division technology, edge detection contour extraction technology, color and brightness distribution pixel segmentation technology, and image morphology operation region optimization technology; The region of interest image includes an image of the container opening area, an image of the container subject area, an image of the sharp object tip area, an image of the fiber adsorption area, and an image of the background contrast area. The preprocessing includes noise suppression, grayscale normalization, edge optimization, and background removal.

3. A method of classifying waste material for use in livestock veterinary practice based on image processing according to claim 2, characterised in that: S1 also includes S13; S13. Based on the acquired preprocessed image, perform feature extraction to obtain the first image feature set; The first image feature set includes the gray value I of the i-th pixel in the region of interest i and the average gray value Iavg of the region of interest The interest region in the preprocessed image is scanned pixel by pixel, the gray value I of each pixel is obtained by using image matrix reading technology, and a pixel gray distribution feature vector is formed, wherein the components of the pixel gray distribution feature vector represent the gray value I of the i-th pixel in the interest region i ; Then, the grayscale values ​​I of all pixels are averaged to obtain the average grayscale value Iavg of the region of interest.

4. The method as claimed in claim 1, wherein the classification of waste by image processing based livestock veterinarian is characterized by: S2 further includes S22; S22. After acquiring the local light intensity non-uniformity index Lnu, a preliminary judgment is made on the waste in all regions of interest. The preliminary judgment is made by using a preset light intensity non-uniformity judgment threshold TL and the real-time acquired local light intensity non-uniformity index Lnu. The specific judgment content is as follows: When the local light intensity non-uniformity index Lnu is less than the light intensity non-uniformity judgment threshold TL, the corresponding waste is judged to have uniform light intensity and enters the regular collection channel. When the local light intensity non-uniformity index Lnu is greater than or equal to the light intensity non-uniformity judgment threshold TL, the corresponding waste is judged to have non-uniform light intensity and has residual suspicious features. At this time, the preprocessed images of all suspicious regions of interest are summarized into a suspicious image set and then entered into color channel feature analysis.

5. A method of classifying waste based on image processing for livestock veterinarian use according to claim 1, characterized in that: S3 includes S33; S33. Based on the color anomaly depth detection and analysis results, residue risk level classification is performed. This classification compares the residue risk level with a preset first color judgment threshold T1 and a second color judgment threshold T2, using the real-time acquired color coupling ratio index Ccr. Based on the comparison results, residue risk level classification is performed on all preprocessed images in the suspicious image set. The specific details are as follows: When the color coupling ratio index Ccr < the first color judgment threshold T1, all preprocessed images in the current suspicious image set will be classified as L1 level. When the first color determination threshold T1 ≤ color coupling ratio index Ccr < the second color determination threshold T2, all preprocessed images in the current suspicious image set will be classified as L2 level. When the color coupling ratio index Ccr is greater than or equal to the second color determination threshold T2, all preprocessed images in the current suspicious image set are classified as L3 level.

6. A method of classifying waste material for use in livestock veterinary practice based on image processing according to claim 5, characterised in that: S3 also includes S31; S31. Based on the risk level classification results of residues, corresponding disposal strategies and traceability recording mechanisms; among which, the specific disposal strategies are as follows: When classified as L1, the corresponding waste will be sent to the regular collection channel; When classified as Level L2, the corresponding waste will undergo secondary disinfection, and a manual verification will be requested. When classified as L3, the corresponding waste will be placed in a dedicated hazardous waste isolation channel; The traceability and recording mechanism synchronously stores the corresponding residual risk level, all pre-processed images in the suspicious image set, detection time, and disposal process information in the waste management database for waste classified as L2 and L3.

Citation Information

Patent Citations

  • Waste treatment and detection method for animal husbandry and veterinary medicine based on image processing

    CN118762247A

  • Ceramic glaze detection method and system based on image processing and grading classifier

    CN119757354A

  • Flour quality detection method and system based on machine vision

    CN121032931A