Pork surface dirt detection method and system based on image recognition

Through multi-spectral image acquisition and processing technology, combined with difference calculation and texture sequence analysis, the accuracy of the surface dirty detection of pork is solved, and efficient and accurate identification of dirty areas is achieved.

CN120411792AActive Publication Date: 2025-08-01XIAN BENBEN ANIMAL HUSBANDRY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The existing method of surface dirty detection of pork based on image recognition is difficult to effectively distinguish the differences in spectral responses of different parts and the texture diversity of local areas, resulting in misjudgment or misjudgment, especially when the pollution area is small or the degree of light, the effect is not good.

Method used

Multispectral image acquisition technology is used, combining visible light, near-infrared and short-wave infrared bands, through differential calculation, texture sequence extraction and area division, the dirt rate is calculated and the dirt area is set to identify dirt areas, and the non-local mean filtering algorithm is used to denoised.

Benefits of technology

It improves the accuracy and robustness of the surface dirty detection of pork, can accurately identify subtle pollution changes, reduce noise interference, and improves the stability and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411792A_ABST
    Figure CN120411792A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to a pork surface smudginess detection method and system based on image recognition, and the method comprises the steps: collecting multispectral images of a plurality of historical pork samples with normal and smudginess surfaces in different wavebands, calculating the difference of every two images in each waveband, and summing the difference to obtain the separation degree of each waveband; acquiring a multispectral image of a to-be-detected sample in each wave band, dividing the multispectral image into a plurality of target regions, and taking a difference value between each target region and a texture sequence of a neighborhood target region as a consistent degree of each target region; and calculating the smudginess rate of each region in combination with the consistency degree and the historical sample separation degree, and responding to the target region with the smudginess rate greater than a set threshold value as a smudginess region. The problem that it is difficult to effectively distinguish whether the surface of pork is dirty or not is solved.
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. More specifically, the present invention relates to a method and system for detecting dirt on the surface of pork based on image recognition. Background Art

[0002] In the processing, transportation, sales, and quality control of pork, whether there is dirt on the surface of pork is directly related to food hygiene and safety and consumers' willingness to purchase. Traditional surface dirt detection mostly relies on manual visual inspection. This method not only has low work efficiency, but also is limited by factors such as environmental light, inspectors' experience, and fatigue, resulting in great subjectivity and instability, and is prone to missed detection or misjudgment, making it difficult to meet the increasing automation and intelligence requirements of the modern meat processing industry.

[0003] With the continuous development of computer vision technology and image recognition algorithms, using image recognition technology to achieve automatic detection of dirt on the surface of pork has become a key research and application direction. Among them, multi-spectral imaging technology, with its advantage of being able to obtain image information in multiple spectral bands simultaneously, has stronger feature extraction ability than single visible light images, and has been widely used in many fields such as fruit and vegetable sorting, agricultural product quality evaluation, and industrial defect detection. In the scenario of pork surface detection, multi-spectral images can provide rich texture, color, and spectral reflection characteristics, which helps to improve the accuracy and robustness of detection.

[0004] However, the existing methods for detecting dirt on the surface of pork based on image recognition still face many technical bottlenecks and challenges. First, most existing solutions only perform image analysis based on multi-spectral images of a single band and distinguish dirty areas from normal areas by setting a global threshold. This method ignores the spectral response differences of different parts of the pork surface and the diversity of local textures, making it difficult to effectively handle the situation where the contaminated area is small or the degree of contamination is light, and is prone to misjudgment or missed detection. Second, the response ability of single-band images to different types of dirt (such as blood stains, grease, impurities, etc.) at a specific wavelength is limited, and it is unable to comprehensively characterize the spectral feature differences of different pollutants, thus affecting the overall recognition effect, and further leading to the problem of being difficult to effectively distinguish whether the surface of pork is dirty. Summary of the Invention

[0005] To solve the problem of being difficult to effectively distinguish whether the surface of pork is dirty as proposed in the above background art, 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 dirty pork on 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 dirty pork on 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 of different samples by calculating the differences between any two pork samples with normal and soiled surfaces in each wavelength band. In particular, by combining the calculation of pixel values and neighborhood standard deviation, the sensitivity to subtle contamination changes is enhanced.

[0010] Further, calculate the soiling rate of the th target area , , is the degree of consistency of the th target area in the multispectral image at wavelength band , is the degree of separation between the historical pork sample images with normal and soiled surfaces at wavelength band , is the sum of the degrees of separation in different wavelength bands, is the number of wavelength bands, is the exponential function with the natural constant as the base.

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

[0012] The above technical solution can improve the recognition accuracy of soiled and normal areas on the surface in a wider spectral range by collecting images in different wavelength bands, thus significantly enhancing the accuracy and robustness of pork quality monitoring.

[0013] Further, use a multispectral camera to collect the multispectral images of the above-mentioned multiple historical pork samples with normal and soiled surfaces in different wavelength bands and the multispectral images of the surface of the pork sample to be detected in different wavelength bands.

[0014] Further, use the non-local means filtering algorithm to denoise the multispectral images of the above-mentioned multiple historical pork samples with normal and soiled surfaces in different wavelength bands and the multispectral images of the surface of the pork sample to be detected in different wavelength bands.

[0015] The above technical solution effectively improves the image quality by using the non-local means filtering algorithm to denoise the multispectral image. It can reduce the interference of noise while retaining the image details and edge information. Especially when processing the pork sample image containing surface contamination, it can more accurately capture the surface features. The non-local means filtering can reduce the influence of noise in a complex environment by considering the similarity of global pixels, thus enhancing the stability and robustness of image processing and providing a more reliable technical guarantee for efficient surface contamination detection and quality monitoring.

[0016] ​​​​Further, the target area is specifically: the multi-spectral images of the surface of the pork sample to be detected in different bands are evenly divided to obtain a plurality of target areas of the same size.

[0017] Further, obtaining each texture sequence of the target area specifically includes: in the target area, a plurality of pixel pairs composed of adjacent pixels are sequentially extracted along a preset direction, and the differences of each pixel pair are arranged in the extraction order to obtain each texture sequence of the target area.

[0018] The above technical solution obtains the texture sequence by extracting adjacent pixel pairs in the target area along the preset direction and calculating their differences, which can finely capture the changes in local texture in the image, especially the minute fluctuations in surface details, making the texture features more prominent and facilitating subsequent analysis. By arranging the differences of pixel pairs in the extraction order, the solution can effectively extract texture information with strong continuity and consistency, thus more accurately reflecting the structural characteristics of the target area. This technology is of great significance in surface contamination detection, can enhance the ability to identify surface anomalies, improve the overall detection accuracy, and provide more accurate input data for subsequent identification of dirty areas.

[0019] Further, the set window range is 5 5.

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

[0021] The beneficial effects of the present invention are as follows: By comprehensively collecting multi-spectral images, image processing, and dirt detection, the present invention can efficiently identify the dirty areas on the surface of pork. Utilizing the information in different bands, especially the visible light, near-infrared, and short-wave infrared bands, the system can deeply analyze the surface features and obtain accurate dirt recognition results by comparing the differences between historical sample images and the sample images to be detected, solving the problem that it is difficult to effectively distinguish when detecting whether the surface of pork is dirty. Description of the Drawings

[0022] Figure 1 is a flowchart schematically showing a method for detecting dirt on the surface of pork based on image recognition according to an embodiment of the present invention; Figure 2 is a block diagram schematically showing a system for detecting dirt on the surface of pork based on image recognition according to an embodiment of the present invention. Detailed Embodiments

[0023] Embodiment of a method for detecting dirt on the surface of pork based on image recognition.

[0024] As Figure 1 shown, the flowchart of the 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: S1: Collect multi-spectral images of multiple historical pork samples with normal surfaces and dirty surfaces in different bands and multi-spectral images of the pork sample to be detected in different bands.

[0025] In one embodiment, a multi-spectral camera is used to collect multi-spectral images of the multiple historical pork samples with normal surfaces and dirty surfaces in different bands and multi-spectral images of the surface of the pork sample to be detected in different bands; Specifically, the different bands include: visible light band, near-infrared band, and short-wave infrared band. These bands have different spectral response characteristics and have significant advantages in surface dirt detection. For example, the visible light band can capture surface contaminants visible to the naked eye, while the near-infrared and short-wave infrared bands can deeply reflect the internal physical properties of the sample, such as moisture content, fat layer, etc., which provides more information for more accurate surface contaminant detection.

[0026] Furthermore, the non-local means filtering algorithm is used to denoise the multi-spectral images of the multiple historical pork samples with normal surfaces and dirty surfaces in different bands and the multi-spectral images of the surface of the pork sample to be detected in different bands. The image processed by using the non-local means filtering algorithm can better retain the detailed information of the image compared with the traditional denoising method, especially having significant advantages in the recognition of complex surface contaminants. The denoising effect of the non-local means filtering ensures that each band's image can remove noise while retaining key surface features, making the subsequent analysis and classification processes more accurate.

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

[0028] In one embodiment, the differences between all pairs of historical pork sample images with normal surfaces and dirty surfaces in any band are summed to obtain the separation degree of the historical pork sample images with normal surfaces and dirty surfaces in any band; by calculating and summing the differences between the images in any band, the separation degree of the historical pork sample images with normal surfaces and dirty surfaces in this band can be quantified. In this way, the similarity and difference between different samples can be objectively evaluated, providing an accurate basis for subsequent automatic classification and recognition.

[0029] Specifically: Calculate the difference between any two historical pork sample images with normal surfaces and dirty surfaces in the band Differences on , , where is the standard deviation of the pixel values of all pixel points within a set neighborhood centered on the th pixel point in the hyperspectral image of the th pork sample with a normal surface in the band; is the standard deviation of the pixel values of all pixel points within a set neighborhood centered on the th pixel point in the hyperspectral image of the th pork sample with a dirty surface in the band; is the pixel value of the th pixel point on the hyperspectral image of the th pork sample with a normal surface in the band; is the pixel value of the th pixel point on the hyperspectral image of the th pork sample with a dirty surface in the band.

[0030] By calculating the differences between any two hyperspectral images of pork samples with normal and dirty surfaces in a specific band, subtle surface changes in the images can be effectively captured, especially the effects of surface dirt on image texture and pixel value distribution. Combining pixel values and the standard deviation of pixels within the neighborhood, the solution can accurately reflect the detailed differences between different pork samples, especially in different bands of hyperspectral images, enhancing the sensitivity to fine contaminants and surface irregularities. This method not only improves the detection accuracy of differences between images but also better identifies the subtle changes between dirty and normal surface states, providing higher resolution and accuracy for pork surface contamination detection, thus contributing to efficient food safety monitoring and quality control.

[0031] S3: Divide the hyperspectral images of the pork sample to be detected in different bands into multiple target regions and calculate the degree of consistency of the multiple target regions.

[0032] In one embodiment, the target region is specifically: evenly divide the hyperspectral images of the surface of the pork sample to be detected in different bands to obtain multiple target regions of the same size.

[0033] And obtain the texture sequences of each target region; use the difference between each target region and the texture sequences of multiple target regions within its set window range as the degree of consistency of each target region; By evenly dividing the surface image of the pork sample to be detected 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 a target region and its adjacent regions, the texture consistency of each region can be quantified, thereby effectively identifying the difference between the surface contamination and the normal region. This method can not only capture the subtle texture changes in the image but also adjust the detection sensitivity through the set window range, improving the detection accuracy of surface contaminants and their distribution and enhancing the ability to judge local consistency in multispectral image analysis.

[0034] Obtaining each texture sequence of the target region specifically includes: within the target region, sequentially extracting multiple pixel pairs composed of adjacent pixels along a preset direction, and arranging the differences of each pixel pair in the extraction order to obtain each texture sequence of the target region.

[0035] The set window range is 5 5. Of course, it can also be set according to the actual situation.

[0036] S4: Obtain the contamination rate of each target region based on the degree of consistency and the degree of separation, and the target region where the contamination rate is greater than the set threshold is the contaminated region.

[0037] In one embodiment, calculate the contamination rate of the th target region where is the degree of consistency of the th target region in the multispectral image in the band, is the degree of separation between the historical pork sample images with normal surface and contaminated surface in the band, is the sum of the degrees of separation in different bands, is the number of bands, is the exponential function with the natural constant as the base; By calculating the contamination rate of each target region, the degree of contamination of the target region can be comprehensively evaluated. 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 region. Especially with the support of multi-band images, it can effectively distinguish the subtle differences between normal surface and contaminated surface. Through the weighted processing of the exponential function, the scheme reasonably adjusts the influence of different bands, ensuring that the importance of different bands in the multispectral image is appropriately reflected, improving the accuracy and robustness of contamination detection, providing efficient and reliable technical support for pork surface quality monitoring, and enabling accurate evaluation of the contamination rate in automated detection.

[0038] The target area in response to the dirt rate being greater than the set threshold is a dirty area.

[0039] The set threshold is 0.5. Of course, it can also be set according to the actual situation.

[0040] The solution of the present invention realizes the efficient detection of dirt on the surface of pork by comprehensively applying multiple technologies such as multi-spectral image acquisition, difference calculation, texture analysis, and dirt rate calculation. Through the careful comparison and regional division of multi-band images, this method can accurately capture the subtle changes in surface contamination, and evaluate the regional consistency through the difference of texture sequences, thereby improving the accuracy of detection.

[0041] Embodiment of a pork surface dirt detection system based on image recognition: As Figure 2 shown, the structural block diagram of the pork surface dirt detection system based on image recognition in the embodiment of the present invention includes a processor and a memory.

[0042] The present invention also provides a pork surface dirt detection system based on image recognition. As Figure 2 shown, the system includes a processor and a memory, and the memory stores computer program instructions, which when executed by the processor implement the pork surface dirt detection method based on image recognition according to the above of the present invention.

[0043] The pork surface dirt detection system based on image recognition further includes other components well-known to those skilled in the art such as a communication interface, and its settings and functions are known in the art, so they will not be described in detail here.

[0044] In the present invention, the foregoing memory may be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, the computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a 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, a module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions stored or otherwise maintained by such a computer-readable medium.

[0045] In the description of this specification, the meanings of "a plurality of" and "several" are at least two, such as two, three, or more, etc., unless otherwise specifically and clearly defined.

[0046] Although this specification has shown and described multiple embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, alterations, and alternative ways without departing from the spirit and idea of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in the practice of the present invention.

Claims

1. A method for detecting dirt on the surface of pork based on image recognition, characterized in that, Including: Collecting multi-spectral images of multiple historical pork samples with normal surfaces and soiled surfaces at different bands, and multi-spectral images of the pork samples to be detected at different bands; Calculating the separation degree of the historical pork sample images with normal surfaces and soiled surfaces at any band, where the separation degree is obtained by summing the differences of all pairs of historical pork sample images with normal surfaces and soiled surfaces at any band; Dividing the multi-spectral images of the pork samples to be detected at different bands into multiple target regions, and obtaining each texture sequence of the target regions; taking the difference between each target region and each texture sequence of multiple target regions within its set window range as the consistency degree of each target region; Calculating the soiling rate of each target region, where the soiling rate is inversely correlated with the consistency degree of the target region at any band and positively correlated with the separation degree; Responding that the target region with the soiling rate greater than the set threshold is a soiled region.

2. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, characterized in that, The difference is specifically as follows: Calculate the difference between the historical pork sample images with normal surface and dirty surface for any two surfaces in the band where , , in the formula, is the standard deviation of the pixel values of all pixel points within a set neighborhood centered on the th pixel point in the multispectral image of the band of the th normal surface pork sample, is the standard deviation of the pixel values of all pixel points within a set neighborhood centered on the th pixel point in the multispectral image of the band of the th dirty surface pork sample, is the pixel value of the th pixel point on the multispectral image of the band of the th normal surface pork sample, is the pixel value of the th pixel point on the multispectral image of the band of the th dirty surface pork sample.

3. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, characterized in that, Calculate the soiling rate of the target area , , is the degree of consistency of the th target area in the multispectral image in the band . is the degree of separation between the historical pork sample images of normal surface and soiled surface in the band . is the sum of the degrees of separation in different bands, is the number of bands, is the exponential function with the natural constant as the base.

4. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, wherein The different bands include: visible light band, near-infrared band, and short-wave infrared band.

5. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, characterized in that, Using a multi-spectral camera to collect the multi-spectral images of the multiple historical pork samples with normal surfaces and soiled surfaces at different bands, and the multi-spectral images of the surface of the pork samples to be detected at different bands.

6. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, wherein Using a non-local means filtering algorithm to denoise the multi-spectral images of the multiple historical pork samples with normal surfaces and soiled surfaces at different bands, and the multi-spectral images of the surface of the pork samples to be detected at different bands.

7. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, characterized in that The target region is specifically: evenly dividing the multi-spectral images of the surface of the pork samples to be detected at different bands to obtain multiple target regions of the same size.

8. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, wherein, Obtaining each texture sequence of the target region specifically: within the target region, sequentially extracting multiple pixel pairs composed of adjacent pixels along a preset direction, and arranging the differences of each pixel pair in the extraction order to obtain each texture sequence of the target region.

9. The method for detecting dirt on the surface of pork based on image recognition according to claim 1, wherein The set window range is 5 5 10. A pork surface dirt detection system based on image recognition, characterized in that, Including a memory and a processor, where computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the pork surface soiling detection method based on image recognition according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Electronic component appearance defect detection method and system based on multispectral imaging

    CN119780119A

  • Stainless steel surface defect detection method based on machine vision

    CN119810080A

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

    CN120150628A

  • Hyperspectral abnormal target detection method and device based on three-dimensional Markov model

    CN120198781A

  • Image quality via multi-wavelength light

    US20070253033A1

Cited By

  • Slaughter workshop environment temperature and humidity intelligent regulation and control system

    CN120578254A