Pork surface dirt detection method and system based on image recognition

By combining multispectral image acquisition and non-local mean filtering algorithm with difference calculation and texture sequence extraction, the accuracy and stability problems of pork surface dirt detection are solved, and efficient identification and accurate detection of subtle pollution are achieved.

CN120411792BActive Publication Date: 2025-09-09XIAN BENBEN ANIMAL HUSBANDRY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510898244.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-09-09
Estimated Expiration
2045-07-01

AI Technical Summary

Technical Problem

Existing pork surface dirt detection methods based on image recognition have difficulty in effectively distinguishing the spectral response differences of different parts and the texture diversity of local areas, leading to misjudgment or missed judgments, especially when the contamination area is small or the degree is mild.

Method used

Multispectral image acquisition and non-local mean filtering algorithm are used, combined with difference calculation and texture sequence extraction. The dirty areas are identified by calculating the dirtiness rate and consistency. The characteristics of the visible light, near-infrared and short-wave infrared bands are used to perform difference analysis and regional division of multispectral images.

Benefits of technology

The accuracy and robustness of pork surface dirt detection have been improved, and it can accurately identify subtle changes in pollution, reduce noise interference, and improve the stability and precision of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411792B_ABST
    Figure CN120411792B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image data processing technology, and more specifically to a method and system for detecting pork surface contamination based on image recognition. The method comprises: collecting multiple multispectral images of historical pork samples with normal and contaminated surfaces in different bands, calculating the differences between each pair of images in each band, and summing them to obtain the degree of separation of each band; obtaining multispectral images of the sample to be tested in each band, dividing them into multiple target areas, and using the difference between the texture sequence of each target area and its neighboring target areas as the degree of consistency of each target area; combining the degree of consistency with the degree of separation of historical samples to calculate the contamination rate of each area, and responsively identifying a target area with a contamination rate greater than a set threshold as a contaminated area. The present invention solves the problem of difficulty in effectively distinguishing whether the pork surface is contaminated when detecting whether it is contaminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and more particularly to a method and system for detecting dirt on the surface of pork based on image recognition. Background Art

[0002] During pork processing, transportation, sales, and quality control, the presence of surface contamination directly impacts food safety and consumer purchasing decisions. Traditional surface contamination detection relies heavily on manual visual inspection, a method that is not only inefficient but also subject to factors like ambient lighting, operator experience, and fatigue. This method is subject to significant subjectivity and instability, easily leading to missed detections or misjudgments, making it difficult to meet the growing automation and intelligent demands of the modern meat processing industry.

[0003] With the continuous advancement of computer vision technology and image recognition algorithms, automated detection of pork surface contamination using image recognition has become a key research and application area. Multispectral imaging technology, with its ability to simultaneously capture image information across multiple spectral bands, offers stronger feature extraction capabilities than single visible light images and has been widely used in fields such as fruit and vegetable sorting, agricultural product quality assessment, and industrial defect detection. In pork surface inspection scenarios, multispectral images can provide a rich set of texture, color, and spectral reflectance features, helping to improve detection accuracy and robustness.

[0004] However, existing methods for detecting dirt on pork surfaces based on image recognition still face many technical bottlenecks and challenges. First, most existing solutions perform image analysis based only on multispectral images of a single band, and distinguish between dirty areas and normal areas by setting a global threshold. This approach ignores the differences in spectral responses of different parts of the pork surface and the diversity of textures in local areas. It is difficult to effectively handle situations where the contaminated area is small or the degree of contamination is light, and it is easy to cause misjudgment or missed judgment. Secondly, the single-band image has limited response capabilities to different types of dirt (such as blood, grease, impurities, etc.) at specific wavelengths, and cannot fully characterize the differences in spectral characteristics of different pollutants, thereby affecting the overall recognition effect, and thus leading to the problem of difficulty in effectively distinguishing whether the pork surface is dirty. Summary of the Invention

[0005] In order to solve the problem raised in the above background art that it is difficult to effectively distinguish whether the surface of pork is dirty, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a method for detecting surface dirtiness of pork based on image recognition, comprising: collecting a plurality of multispectral images of historical pork samples with normal surfaces and those with dirty surfaces in different bands and multispectral images of pork samples to be detected in different bands; calculating the degree of separation of the images of historical pork samples with normal surfaces and those with dirty surfaces in any band, wherein the degree of separation is obtained by summing the differences between all any two historical images of pork samples with normal surfaces and those with dirty surfaces in any band; dividing the multispectral images of the pork samples to be detected in different bands into regions to obtain a plurality of target regions, and obtaining texture sequences of the target regions; taking the difference between the texture sequences of each target region and a plurality of target regions within a set window range as the degree of consistency of the target regions; calculating the dirtiness rate of each target region, wherein the dirtiness rate is inversely correlated with the degree of consistency of the target region in any band and positively correlated with the degree of separation; and a target region in which the dirtiness rate is greater than a set threshold is defined as a dirty region.

[0007] This technical solution, through the combined application of multispectral image difference calculation, texture sequence extraction, and regional segmentation, accurately analyzes the degree of surface contamination in pork samples. By evaluating the similarity and separation between normal and contaminated samples across various wavelengths, the solution effectively identifies the sensitivity of different wavelengths to contamination signatures, thereby improving detection accuracy and resolving the difficulty in effectively distinguishing whether a pork surface is contaminated.

[0008] Furthermore, the difference is specifically calculated as follows: the difference between any two historical pork sample images with normal surface and dirty surface in the band Differences in , , where For the A pork sample with normal appearance in the band In the multispectral image, The standard deviation of the pixel values ​​of all pixels in the set neighborhood with the pixel point as the center is For the A sample of pork with a dirty surface is shown in the band In the multispectral image, The standard deviation of the pixel values ​​of all pixels in the set neighborhood with the pixel point as the center is For the A pork sample with normal appearance in the band On the multispectral image The pixel value of each pixel, For the A sample of pork with a dirty surface is shown in the band On the multispectral image The pixel value of a pixel.

[0009] The above technical solution can accurately quantify the differences in texture and pixel values ​​between different samples by calculating the differences in each band between any two pork samples with normal surfaces and dirty surfaces. In particular, by combining the calculation of pixel values ​​and neighborhood standard deviations, it enhances sensitivity to subtle changes in pollution.

[0010] Furthermore, calculate the The dirtiness rate of target areas , , For the Target area in the band The degree of consistency in the multispectral image, Images of historical pork samples with normal and dirty surfaces in the band The degree of separation, is the sum of the separation degrees in different bands, is the number of bands, For the natural constant An exponential function with base .

[0011] Furthermore, the different bands include: visible light band, near infrared band and short-wave infrared band.

[0012] By collecting images in different bands, the above technical solution can improve the recognition accuracy of surface dirt and normal areas within a wider spectral range, thereby significantly improving the accuracy and robustness of pork quality monitoring.

[0013] Furthermore, a multispectral camera is used to collect the multispectral images of the historical pork samples with normal surfaces and dirty surfaces in different bands and the multispectral images of the surface of the pork samples to be tested in different bands.

[0014] Furthermore, a non-local mean filtering algorithm is used to perform denoising on the multispectral images of the historical pork samples with normal surfaces and dirty surfaces in different bands and the multispectral images of the pork samples to be tested in different bands.

[0015] This technical solution effectively improves image quality by denoising multispectral images using a non-local mean filtering algorithm. It can preserve image details and edge information while reducing noise interference. This is particularly true when processing images of pork samples containing surface contamination, enabling more accurate capture of surface features. By considering global pixel similarity, non-local mean filtering can reduce the impact of noise in complex environments, thereby improving the stability and robustness of image processing, providing a more reliable technical foundation for efficient surface contamination detection and quality monitoring.

[0016] Furthermore, the target area is specifically: multispectral images of the surface of the pork sample to be tested in different bands are evenly divided to obtain multiple target areas of the same size.

[0017] Furthermore, each texture sequence of the target area is obtained, specifically: within the target area, a plurality of pixel pairs consisting of adjacent pixels are sequentially extracted along a preset direction, and the difference between each pixel pair is arranged in the extraction order to obtain each texture sequence of the target area.

[0018] This technical solution extracts adjacent pixel pairs within a target area along a preset direction and calculates their differences to generate a texture sequence. This method meticulously captures local texture variations within an image, particularly subtle fluctuations in surface detail, making texture features more prominent and facilitating subsequent analysis. By arranging the differences between pixel pairs in the order of extraction, the solution effectively extracts texture information with high continuity and consistency, thereby more accurately reflecting the structural characteristics of the target area. This technology is of great significance in surface contamination detection, enhancing the ability to identify surface anomalies, improving overall detection accuracy, and providing more precise input data for subsequent identification of contaminated areas.

[0019] Furthermore, the setting window range is 5 5.

[0020] In a second aspect, the present invention provides a pork surface dirt detection system based on image recognition, comprising a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, any one of the above-mentioned pork surface dirt detection methods based on image recognition is implemented.

[0021] The beneficial effects of the present invention are:

[0022] This invention integrates multispectral image acquisition, image processing, and contamination detection to efficiently identify contaminated areas on pork surfaces. Utilizing information from different wavelengths, particularly visible light, near-infrared, and short-wave infrared, the system can deeply analyze surface features and accurately identify contamination by comparing historical sample images with the image to be tested. This solves the problem of effectively distinguishing whether pork surfaces are contaminated. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart schematically illustrating a method for detecting dirt on the surface of pork based on image recognition according to an embodiment of the present invention;

[0024] Figure 2 FIG. 1 is a block diagram schematically illustrating a structure of a pork surface dirt detection system based on image recognition according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] An embodiment of a method for detecting dirt on pork surface based on image recognition.

[0026] like Figure 1 As shown in FIG, a flowchart of a method for detecting dirt on the surface of pork based on image recognition according to an embodiment of the present invention includes the following steps:

[0027] S1: Collect multiple multispectral images of historical pork samples with normal and dirty surfaces in different bands and multispectral images of pork samples to be tested in different bands.

[0028] In one embodiment, a multispectral camera is used to collect the multispectral images of the plurality of historical pork samples with normal surfaces and dirty surfaces at different wavelengths and the multispectral images of the surface of the pork sample to be tested at different wavelengths;

[0029] Specifically, the different wavelengths described include visible light, near-infrared, and short-wave infrared. These wavelengths have distinct spectral response characteristics, offering significant advantages in surface contamination detection. For example, the visible light wavelength captures surface contaminants visible to the naked eye, while the near-infrared and short-wave infrared wavelengths provide a deeper understanding of the sample's intrinsic physical properties, such as moisture content and fat content. This provides more information for more precise surface contamination detection.

[0030] Furthermore, the multispectral images of the historical pork samples with normal and contaminated surfaces, as well as the multispectral images of the pork samples to be tested, at different wavelengths, were denoised using a non-local mean filtering algorithm. Compared to traditional denoising methods, images processed using the non-local mean filtering algorithm are more likely to retain detailed image information, offering significant advantages in identifying complex surface contaminants. The denoising effect of non-local mean filtering ensures that key surface features are retained while removing noise from each image band, making subsequent analysis and classification more accurate.

[0031] S2: Calculate the difference between any two historical pork sample images with normal surfaces and dirty surfaces in any band, and obtain the degree of separation of each band based on the difference.

[0032] In one embodiment, the differences between any two historical pork sample images (one with a normal surface and one with a dirty surface) in any wavelength band are summed to determine the degree of separation between the normal and dirty pork sample images in any wavelength band. By calculating and summing the differences in any wavelength band, the degree of separation between the normal and dirty pork sample images in that wavelength band can be quantified. This approach objectively assesses the similarities and differences between different samples, providing an accurate basis for subsequent automatic classification and recognition.

[0033] Specifically: Calculate the band of any two historical pork sample images with normal surface and dirty surface Differences in , , where For the A pork sample with normal appearance in the band In the multispectral image, The standard deviation of the pixel values ​​of all pixels in the set neighborhood with the pixel point as the center is For the A sample of pork with a dirty surface is shown in the band In the multispectral image, The standard deviation of the pixel values ​​of all pixels in the set neighborhood with the pixel point as the center is For the A pork sample with normal appearance in the band On the multispectral image The pixel value of each pixel, For the A sample of pork with a dirty surface is shown in the band On the multispectral image The pixel value of a pixel.

[0034] By calculating the difference between any two images of pork samples with normal and dirty surfaces in specific bands, the method can effectively capture subtle surface changes in the image, especially the impact of surface dirt on image texture and pixel value distribution. Combining pixel values ​​and pixel standard deviations within a neighborhood, the scheme can accurately reflect the detailed differences between different pork samples, especially in different bands of multispectral images, enhancing sensitivity to small contaminants and surface irregularities. This method not only improves the detection accuracy of differences between images, but also better identifies subtle changes between surface dirt and normal conditions, providing higher resolution and accuracy for pork surface contamination detection, thereby contributing to efficient food safety monitoring and quality control.

[0035] S3: Divide the multispectral images of the pork sample to be tested in different bands into multiple target areas, and calculate the consistency of the multiple target areas.

[0036] In one embodiment, the target area is specifically: multispectral images of the surface of the pork sample to be tested in different bands are averaged to obtain multiple target areas of the same size.

[0037] and obtaining each texture sequence of the target area; taking the difference between each texture sequence of each target area and multiple target areas within a set window as the consistency degree of each target area;

[0038] By dividing the surface image of the pork sample under inspection into multiple target regions and extracting texture sequences within each target region, the local texture features of the image can be analyzed in detail. By calculating the difference in texture sequences between the target region and its adjacent regions, the consistency of the textures of each region can be quantified, effectively distinguishing surface contamination from normal areas. This method not only captures subtle texture variations in the image but also allows for adjustable detection sensitivity through a set window range, improving the accuracy of detecting surface contaminants and their distribution, and enhancing the ability to determine local consistency in multispectral image analysis.

[0039] The texture sequences of the target area are obtained by sequentially extracting a plurality of pixel pairs consisting of adjacent pixels along a preset direction in the target area, and arranging the differences of the pixel pairs in an extraction order to obtain the texture sequences of the target area.

[0040] The setting window range is 5 5. Of course, it can also be set according to actual conditions.

[0041] S4: Obtaining the contamination rate of each target area based on the consistency degree and the separation degree, and a target area in which the contamination rate is greater than a set threshold is regarded as a contaminated area.

[0042] In one embodiment, the calculation The dirtiness rate of target areas , , For the Target area in the band The degree of consistency in the multispectral image, Images of historical pork samples with normal and dirty surfaces in the band The degree of separation, is the sum of the separation degrees in different bands, is the number of bands, For the natural constant An exponential function with base ;

[0043] By calculating the contamination rate of each target area, the degree of contamination in the target area can be comprehensively assessed. By combining the consistency and separation information of each band image, the scheme can more accurately reflect the complexity of surface contamination in the target area. Especially with the support of multi-band imagery, it can effectively distinguish the subtle differences between a normal surface and a dirty surface. Through weighted processing using an exponential function, the scheme rationally adjusts the impact of different bands, ensuring that the importance of different bands in multispectral images is properly reflected, improving the accuracy and robustness of contamination detection, providing efficient and reliable technical support for pork surface quality monitoring, and enabling accurate contamination rate assessment in automated testing.

[0044] In response to the soiling rate being greater than a set threshold, the target area is defined as a soiled area.

[0045] The threshold is set to 0.5, and of course, it can also be set according to actual conditions.

[0046] The proposed method achieves efficient detection of pork surface contamination by integrating multiple technologies, including multispectral image acquisition, difference calculation, texture analysis, and soiling rate calculation. Through meticulous comparison and regional segmentation of multi-band images, the method accurately captures subtle variations in surface contamination and assesses regional consistency through the difference of texture sequences, thereby improving detection accuracy.

[0047] Example of pork surface dirt detection system based on image recognition:

[0048] like Figure 2 As shown, a structural block diagram of a pork surface dirt detection system based on image recognition according to an embodiment of the present invention includes a processor and a memory.

[0049] The present invention also provides a pork surface dirt detection system based on image recognition. Figure 2 As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, the pork surface dirt detection method based on image recognition according to the present invention is implemented.

[0050] The pork surface dirt detection system based on image recognition also includes other components familiar to those skilled in the art, such as a communication interface. The settings and functions of these components are known in the art and will not be described in detail here.

[0051] In the present invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, the computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium can be part of, accessible to, or connectable to a device. Any application or module described in the present invention can be implemented using computer-readable / executable instructions stored or otherwise maintained by such a computer-readable medium.

[0052] In the description of this specification, "multiple" and "several" mean at least two, such as two, three or more, etc., unless otherwise clearly defined.

[0053] While several embodiments of the present invention have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Numerous modifications, variations, and alternatives will occur to those skilled in the art without departing from the concept and spirit of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in practicing the present invention.

Claims

1. A method for detecting dirt on pork surface based on image recognition, characterized in that: include: Collect multiple multispectral images of historical pork samples with normal surfaces and dirty surfaces at different bands, and multispectral images of pork samples to be tested at different bands; Calculate the bands of any two historical pork sample images with normal and dirty surfaces Differences in , , where For the A normal pork sample in the band In the multispectral image, The standard deviation of the pixel values ​​of all pixels in the set neighborhood with a pixel as the center is For the A sample of pork with a dirty surface is shown in the band In the multispectral image, The standard deviation of the pixel values ​​of all pixels in the set neighborhood with a pixel as the center is For the A normal pork sample in the band On the multispectral image The pixel value of each pixel, For the A sample of pork with a dirty surface is shown in the band On the multispectral image The pixel value of each pixel; Calculating the degree of separation of historical pork sample images with normal surfaces and those with dirty surfaces in any band, wherein the degree of separation is obtained by summing the differences between all arbitrary two historical pork sample images with normal surfaces and those with dirty surfaces in any band; Divide the multispectral image of the pork sample to be tested in different bands into multiple target areas, and obtain the texture sequences of the target areas; and use the difference between the texture sequences of each target area and the multiple target areas within the set window as the consistency of each target area; Calculate the dirtiness rate of each target area, The dirtiness rate of target areas for: , For the Target area in the band The degree of consistency in the multispectral image, Images of historical pork samples with normal and dirty surfaces in the band The degree of separation, is the sum of the separation degrees in different bands, is the number of bands, The natural constant An exponential function with base ; In response to the dirtiness rate being greater than a set threshold, the target area is defined as a dirtied area.

2. The pork surface dirt detection method based on image recognition according to claim 1 is characterized in that: The different bands include: visible light band, near infrared band and short-wave infrared band.

3. The pork surface dirt detection method based on image recognition according to claim 1 is characterized in that: A multispectral camera is used to collect the multispectral images of the historical pork samples with normal surfaces and dirty surfaces in different bands and the multispectral images of the surface of the pork samples to be tested in different bands.

4. The pork surface dirt detection method based on image recognition according to claim 1 is characterized in that: The multispectral images of the historical pork samples with normal surfaces and dirty surfaces in different bands and the multispectral images of the pork samples to be tested in different bands are denoised using a non-local mean filtering algorithm.

5. The pork surface dirt detection method based on image recognition according to claim 1 is characterized in that: The target area is specifically: the multispectral image of the surface of the pork sample to be tested in different bands is evenly divided to obtain multiple target areas of the same size.

6. The pork surface dirt detection method based on image recognition according to claim 1 is characterized in that: The texture sequences of the target area are obtained by sequentially extracting a plurality of pixel pairs consisting of adjacent pixels along a preset direction in the target area, and arranging the differences of the pixel pairs in an extraction order to obtain the texture sequences of the target area.

7. The method for detecting dirt on pork surface based on image recognition according to claim 1, characterized in that: The setting window range is 5 5.

8. The pork surface dirt detection system based on image recognition is characterized by: The method comprises a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for detecting dirt on the surface of pork based on image recognition according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Stainless steel surface defect detection method based on machine vision

    CN119810080A

  • Intelligent flushing system for solar cell panel of photovoltaic power station

    CN120150628A