An automatic image detection method and system for bovine colostrum agglutination degree
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING BAINAFU BIOTECHNOLOGY CO LTD
- Filing Date
- 2026-02-25
- Publication Date
- 2026-05-29
Smart Images

Figure CN122116356A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dairy product image detection technology, and in particular to an automatic image detection method and system for bovine colostrum coagulation degree. Background Technology
[0002] With the intelligent and standardized development of the dairy industry, the industry has put forward the application requirements of automated and high-precision detection of bovine colostrum agglutination. The detection technology is required to quickly complete sample image analysis and output accurate quantitative results of agglutination. However, the existing bovine colostrum agglutination image detection technology has always had the technical shortcomings of difficulty in balancing detection accuracy and automation, which cannot meet the industry's large-scale and standardized detection needs.
[0003] Bovine colostrum samples contain numerous tiny impurities that generate scattering background noise. Existing image detection preprocessing methods cannot specifically address the scattering characteristics of bovine colostrum, making it difficult to remove noise while fully preserving the original features of the agglomerates. This results in feature bias in the base image for subsequent agglomerate identification. Furthermore, current technologies offer only a single dimension for agglomerate feature representation, and the region identification and screening stages often employ rigid methods such as static thresholds and fixed templates. These methods cannot adapt to the diverse morphological and distributional characteristics of agglomerates in bovine colostrum, easily leading to missed or false detections of agglomerate regions. Moreover, multiple analytical steps in the detection process require manual intervention to adjust parameters and determine results, which not only significantly reduces the automation efficiency of the detection but also amplifies the error in agglomerate quantification results due to the subjectivity of human judgment. Ultimately, current technologies cannot achieve fully automated image detection throughout the entire process, nor can they guarantee the accuracy and consistency of agglomerate detection results. Summary of the Invention
[0004] This invention provides an automatic image detection method and system for bovine colostrum agglomeration to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides an automatic image detection method for bovine colostrum agglomeration, comprising:
[0006] S1. Obtain a transmitted light source microscopic image of the bovine colostrum sample, and suppress the scattering background of the microscopic image based on the scattering characteristics of light in the sample medium to obtain a sample image after background suppression.
[0007] S2. Extract phase gradient information based on local wavefront distortion from the sample image after background suppression to obtain the phase gradient distribution map caused by agglomerates;
[0008] S3. Nonlinearly couple the phase gradient distribution map with the intensity information of the sample image after background suppression to generate the coupled feature representation of the agglomerates;
[0009] S4. Based on the coupling feature representation, adaptive focusing growth of the aggregate region is performed using the feature coupling degree as the growth guide to obtain candidate aggregate regions;
[0010] S5. Based on the consistency analysis of the phase gradient flow direction within the region, the candidate agglomerate regions are verified for coherence, and non-agglomerate regions are screened out to obtain the final agglomerate regions.
[0011] S6. Determine the area ratio of the final aggregate region in the sample image to obtain the degree of bovine colostrum aggregation.
[0012] Preferably, the step of suppressing the scattering background of the microscopic image based on the scattering characteristics of light in the sample medium to obtain a background-suppressed sample image includes:
[0013] Based on the scattering angle distribution characteristics of light in the sample medium, the frequency domain transformation of the microscopic image is performed to obtain the frequency spectrum of the microscopic image.
[0014] In the frequency spectrum, based on the mapping relationship between scattering angle and spatial frequency, high-frequency components corresponding to large-angle scattering background and low-frequency components corresponding to small-angle transmitted signals are separated.
[0015] The high-frequency components are attenuated, and the attenuated high-frequency components are then recombined with the low-frequency components to obtain the corrected frequency spectrum.
[0016] The corrected frequency spectrum is subjected to inverse frequency domain transformation to reconstruct the spatial domain image, resulting in a sample image with background suppression.
[0017] Preferably, the step of extracting phase gradient information based on local wavefront distortion from the background-suppressed sample image to obtain a phase gradient distribution map caused by agglomerates includes:
[0018] For each pixel in the sample image after background suppression, the rate of change of image intensity in its neighborhood in multiple directions is analyzed to obtain the acceleration information of intensity change in each direction for each pixel.
[0019] Based on the intensity change acceleration information, the direction of the most drastic intensity change at each pixel and the degree of drastic change in that direction are determined.
[0020] By integrating the direction and degree of intensity change at each pixel, a vector field representing the local tilt of the light wavefront is constructed, resulting in a phase gradient distribution map.
[0021] Preferably, determining the direction of the most drastic intensity change at each pixel and the degree of drastic change in that direction based on the intensity change acceleration information includes:
[0022] For intensity change acceleration information, the degree of intensity change acceleration is accumulated and recorded along the continuous direction surrounding the pixel, and a correspondence between the direction index and the accumulated acceleration degree is established;
[0023] Compare the magnitudes of all cumulative acceleration values in the corresponding relationships to locate the cumulative acceleration value with the largest value;
[0024] The direction index associated with the largest cumulative acceleration value is taken as the direction of the most drastic change in intensity, and the largest cumulative acceleration value itself is taken as the drastic change in that direction.
[0025] Preferably, the step of nonlinearly coupling the phase gradient distribution map with the intensity information of the background-suppressed sample image to generate a coupled feature representation of the agglomerates includes:
[0026] Extract the orientation angle and magnitude of the gradient vector at each pixel in the phase gradient distribution map to form an orientation angle matrix and a magnitude matrix;
[0027] The intensity information of the sample image after background suppression is modulated according to the orientation angle matrix to obtain the modulated intensity distribution associated with the gradient direction.
[0028] Based on the modulus matrix, the intensity distribution after modulation is calibrated in the same distribution so that the spatial variation trend of the calibrated intensity distribution matches the phase gradient modulus, thus obtaining the coupling characteristic representation of the aggregate.
[0029] Preferably, the adaptive focused growth of the agglomerate region based on coupled feature representation and using feature coupling degree as the growth guide to obtain candidate agglomerate regions includes:
[0030] Based on coupled feature representation, the feature similarity and spatial proximity between pixels are measured to construct a dynamic association network between pixels;
[0031] Starting from the pixel position with the highest feature coupling in the dynamic association network, the feature coupling is passed to adjacent pixels along the dynamic association, completing one round of coupling diffusion;
[0032] The feature coupling degrees gathered within the pixel set reached through diffusion are merged and integrated to form an initial growth core;
[0033] Starting from the initial growth core, the coupling diffusion and merging integration are repeated to gradually expand the coverage of the initial growth core and obtain the candidate aggregate region.
[0034] Preferably, the process of repeatedly performing coupling diffusion and merging integration, starting from the initial growth core, to gradually expand the coverage area of the initial growth core and obtain candidate agglomerate regions includes:
[0035] Before each coupling diffusion, the correlation strength between the current growth core boundary pixel and the external pixels is evaluated based on the dynamic correlation network.
[0036] Based on the correlation strength, the priority and amount of coupling degree transmission to different external pixels are controlled to guide the expansion direction;
[0037] When the association strength between the current growth core boundary pixel and all external pixels is lower than a level dynamically determined by the association strength of pixels within the expanded region, expansion stops, and the growth core coverage area at this point is determined as the candidate aggregate region.
[0038] Preferably, the consistency analysis based on the phase gradient flow direction within the region is used to verify the coherence of candidate agglomerate regions, screen out non-agglomerate regions, and obtain the final agglomerate regions, including:
[0039] Based on the phase gradient distribution map, the gradient vector of all pixels inside each candidate agglomerate region is extracted to obtain the gradient vector set corresponding to each region.
[0040] For each region's gradient vector set, the distribution of its direction angles is statistically analyzed to obtain a distribution histogram describing the degree of direction concentration;
[0041] Analyze the peak shape characteristics and dispersion of the distribution histogram to generate a coherence score that characterizes the consistency of flow direction within the region;
[0042] The coherence scores of all candidate regions are compared, and regions with scores below the overall median level are identified as non-aggregate regions and screened out to obtain the final aggregate regions.
[0043] Preferably, determining the area ratio of the final agglomerate region in the sample image to obtain the bovine colostrum agglomeration degree includes:
[0044] Based on the uniformity of intensity distribution in the sample image after background suppression, a continuous region representing an effective bovine colostrum sample in the sample image is defined to obtain a mask of the effective sample region.
[0045] The total number of pixels in the final aggregate region and the effective sample region mask are counted and accumulated to obtain the total number of pixels in the aggregate region and the total number of pixels in the effective sample region.
[0046] The ratio of the total number of pixels in the agglomerate region to the total number of pixels in the effective sample region is used to obtain a proportional value that represents the area relationship, and this proportional value is used as the agglomeration degree of bovine colostrum.
[0047] To address the aforementioned problems, the present invention also provides an automatic image detection system for bovine colostrum agglomeration, the system comprising:
[0048] The image preprocessing module is used to acquire a transmitted light source microscopic image of bovine colostrum samples. Based on the scattering characteristics of light in the sample medium, the microscopic image is subjected to scattering background suppression to obtain a background-suppressed sample image.
[0049] The phase gradient distribution map determination module is used to extract phase gradient information based on local wavefront distortion from the sample image after background suppression, and obtain the phase gradient distribution map caused by agglomerates.
[0050] The multi-feature coupling module is used to nonlinearly couple the phase gradient distribution map with the intensity information of the sample image after background suppression to generate the coupled feature representation of the agglomerates.
[0051] The adaptive region growth module is used to perform adaptive focused growth of agglomerate regions based on coupled feature representation and with feature coupling degree as the growth guide, to obtain candidate agglomerate regions.
[0052] The regional verification and screening module is used to verify the coherence of candidate agglomerate regions based on the consistency analysis of the phase gradient flow direction within the region, screen out non-agglomerate regions, and obtain the final agglomerate regions.
[0053] The aggregation quantification module is used to determine the area ratio of the final aggregate region in the sample image, thus obtaining the aggregation degree of bovine colostrum.
[0054] Compared with the prior art, the present invention has the following beneficial effects:
[0055] 1. By extracting phase gradient information from local wavefront distortion, the wavefront distortion features induced by agglomerates can be accurately captured. This abstract feature is transformed into a quantified and visualized phase gradient distribution map, which clearly characterizes the key features such as the position and morphology of the agglomerates. Furthermore, through the nonlinear coupling of the phase gradient distribution map with image intensity information, deep fusion of phase gradient spatial features and image intensity grayscale features can be achieved, significantly improving the feature differentiation between agglomerates and background areas, and providing an accurate feature basis for subsequent agglomerate region identification.
[0056] 2. By constructing a pixel dynamic correlation network through coupling features, the initial core of agglomerate region growth can be accurately determined. Combined with the correlation strength to guide the growth expansion direction and dynamically set the expansion stop threshold, the growth process of the agglomerate region conforms to the actual shape of the agglomerate, accurately delineating the complete candidate agglomerate region, effectively avoiding the mis-inclusion of background pixels and the omission of agglomerate pixels, and improving the completeness and accuracy of agglomerate region recognition. Attached Figure Description
[0057] Figure 1A flowchart of an automatic image detection method for bovine colostrum agglomeration provided by the present invention;
[0058] Figure 2 The present invention provides a modular structure diagram of an automatic image detection system for bovine colostrum agglomeration. Detailed Implementation
[0059] 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 of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0060] Example 1, referring to Figure 1 The diagram shown is a flowchart illustrating an automatic image detection method for bovine colostrum agglomeration according to an embodiment of the present invention. In this embodiment, the automatic image detection method for bovine colostrum agglomeration includes:
[0061] S1. Obtain a transmitted light source microscopic image of the bovine colostrum sample, and suppress the scattering background of the microscopic image based on the scattering characteristics of light in the sample medium to obtain a sample image after background suppression.
[0062] S2. Extract phase gradient information based on local wavefront distortion from the sample image after background suppression to obtain the phase gradient distribution map caused by agglomerates;
[0063] S3. Nonlinearly couple the phase gradient distribution map with the intensity information of the sample image after background suppression to generate the coupled feature representation of the agglomerates;
[0064] S4. Based on the coupling feature representation, adaptive focusing growth of the aggregate region is performed using the feature coupling degree as the growth guide to obtain candidate aggregate regions;
[0065] S5. Based on the consistency analysis of the phase gradient flow direction within the region, the candidate agglomerate regions are verified for coherence, and non-agglomerate regions are screened out to obtain the final agglomerate regions.
[0066] S6. Determine the area ratio of the final aggregate region in the sample image to obtain the degree of bovine colostrum aggregation.
[0067] In embodiments of the present invention, background suppression of microscopic images is performed based on the scattering characteristics of light in the sample medium to obtain a background-suppressed sample image, including:
[0068] Based on the scattering angle distribution characteristics of light in the sample medium, the frequency domain transformation of the microscopic image is performed to obtain the frequency spectrum of the microscopic image.
[0069] In the frequency spectrum, based on the mapping relationship between scattering angle and spatial frequency, high-frequency components corresponding to large-angle scattering background and low-frequency components corresponding to small-angle transmitted signals are separated.
[0070] The high-frequency components are attenuated, and the attenuated high-frequency components are then recombined with the low-frequency components to obtain the corrected frequency spectrum.
[0071] The corrected frequency spectrum is subjected to inverse frequency domain transformation to reconstruct the spatial domain image, resulting in a sample image with background suppression.
[0072] Specifically, a fresh bovine colostrum sample is taken, dropped onto a clean glass slide, and covered with a coverslip. The slide is placed on the stage of a transmission light source microscope, the focus is adjusted to clearly capture the internal details of the sample, the transmission light source is turned on so that the light penetrates the sample perpendicularly, and the transmission light source microscopic image of the bovine colostrum sample is captured by the microscope image acquisition component. Then, based on the scattering characteristics of light in the bovine colostrum medium, the scattering background of the microscopic image is suppressed to obtain the sample image after background suppression.
[0073] Furthermore, based on the distribution characteristic that the scattering angle of light in bovine colostrum is concentrated in the range of 30°-60°, the acquired microscopic image is subjected to frequency domain transformation. First, the gray value of each pixel in the image is arranged into one-dimensional data in rows. Then, the product of the gray value and the corresponding frequency coefficient is calculated point by point and accumulated to complete the frequency domain transformation and obtain the frequency spectrum of the microscopic image.
[0074] Furthermore, in the obtained frequency spectrum, based on the mapping relationship that a larger scattering angle corresponds to a higher spatial frequency, the signal in the high-frequency region of the frequency spectrum is separated into a high-frequency component corresponding to the large-angle scattering background, which is generated by the scattering of fine impurities in bovine colostrum. The signal in the low-frequency region is separated into a low-frequency component corresponding to the small-angle transmission signal, which is generated by the unscattered transmitted light.
[0075] Furthermore, the separated high-frequency components are subjected to intensity attenuation processing, and the signal amplitude of the high-frequency components is reduced point by point until the amplitude of the high-frequency components is reduced to 1 / 3 of the original amplitude. Then, the attenuated high-frequency components and the unprocessed low-frequency components are superimposed point by point at the corresponding frequency positions to obtain the corrected frequency spectrum.
[0076] Finally, an inverse frequency domain transformation is performed on the corrected frequency spectrum, and the product of the corrected frequency coefficient and the gray value of the corresponding pixel position is calculated point by point and accumulated to reconstruct the spatial domain image, which is the sample image after background suppression.
[0077] In summary, this approach effectively eliminates background noise caused by fine impurities in bovine colostrum, thus improving the image signal-to-noise ratio. At the same time, it fully preserves the effective low-frequency transmission signals associated with the agglomerates, without destroying the original feature information of the agglomerates. This significantly improves the contrast between the agglomerates and the background within the sample, providing a clear and accurate base image for subsequent steps such as phase gradient information extraction and agglomerate feature coupling.
[0078] In embodiments of the present invention, phase gradient information based on local wavefront distortion is extracted from the background-suppressed sample image to obtain a phase gradient distribution map caused by agglomerates, including:
[0079] For each pixel in the sample image after background suppression, the rate of change of image intensity in its neighborhood in multiple directions is analyzed to obtain the acceleration information of intensity change in each direction for each pixel.
[0080] Based on the intensity change acceleration information, the direction of the most drastic intensity change at each pixel and the degree of drastic change in that direction are determined.
[0081] By integrating the direction and degree of intensity change at each pixel, a vector field representing the local tilt of the light wavefront is constructed, resulting in a phase gradient distribution map.
[0082] The acceleration information of intensity change is calculated using the following formula:
[0083]
[0084] In the formula, This indicates information about the acceleration of intensity changes. Indicates the direction of analysis. , , The second-order partial derivative represents the image intensity.
[0085] In embodiments of the present invention, based on intensity change acceleration information, determining the direction of the most drastic intensity change at each pixel and the degree of drastic change in that direction includes:
[0086] For intensity change acceleration information, the degree of intensity change acceleration is accumulated and recorded along the continuous direction surrounding the pixel, and a correspondence between the direction index and the accumulated acceleration degree is established;
[0087] Compare the magnitudes of all cumulative acceleration values in the corresponding relationships to locate the cumulative acceleration value with the largest value;
[0088] The direction index associated with the largest cumulative acceleration value is taken as the direction of the most drastic change in intensity, and the largest cumulative acceleration value itself is taken as the drastic change in that direction.
[0089] Specifically, a bovine colostrum sample image after background suppression was selected. The gray values of the agglomerate region in the image are significantly different from those of the surrounding region. For each pixel in the image, a 3×3 neighborhood range was selected, and four continuous analysis directions of 0°, 45°, 90°, and 135° were determined. The rate of change of image intensity in the neighborhood in these four directions was analyzed point by point, and the acceleration information of intensity change in each direction of each pixel was calculated.
[0090] Specifically, during the calculation, the gray values of each pixel in the neighborhood of each pixel are first obtained. For example, the gray values of the horizontal adjacent pixels of a certain pixel are 22, 25, and 28, the gray values of the vertical adjacent pixels are 23, 25, and 27, and the gray values of the diagonal adjacent pixels are 21, 25, and 29.
[0091] The first-order rate of change in each direction is calculated by the difference between adjacent gray values. The change rate is then obtained by calculating the difference between the first-order rates of change. Combined with the preset method for calculating the second-order partial derivative of image intensity, the value of the pixel is obtained. , , .
[0092] in The second-order partial derivative in the horizontal direction. The second-order partial derivative in the vertical direction. The second-order partial derivatives are calculated in the diagonal direction, and then the results are determined based on the different analytical directions. Determine the corresponding and These values are then substituted into the formula for calculating the acceleration of intensity change information, and the acceleration of intensity change information for each pixel in each direction is calculated.
[0093] Furthermore, the intensity change acceleration information of each pixel is accumulated along a continuous direction from 0° to 360° every 45°. Each accumulation selects the intensity change acceleration information of two adjacent directions for summation, and records the corresponding direction index at the same time.
[0094] For example, 0° and 45° are accumulated, 45° and 90° are accumulated, and the accumulation operation in all consecutive directions is completed in sequence, establishing a one-to-one correspondence between the direction index and the degree of cumulative acceleration.
[0095] Furthermore, each pixel's cumulative acceleration level is compared one by one, and the magnitude of each cumulative value is compared to find the cumulative acceleration level with the largest value. The direction index and specific value corresponding to the largest cumulative acceleration level are then determined.
[0096] Furthermore, the direction index associated with the largest cumulative acceleration value is determined as the direction of the most drastic intensity change at that pixel, and the specific value of the largest cumulative acceleration value is determined as the degree of change in that direction, ensuring that each pixel corresponds to a unique direction and degree of the most drastic change.
[0097] Finally, the direction and degree of intensity change of all pixels in the image are integrated. Starting from each pixel, a line segment is drawn along the direction of the most drastic change. The length of the line segment is determined by the degree of change. The greater the degree of change, the longer the line segment. In this way, a vector field representing the local tilt of the light wavefront is constructed. This vector field is the phase gradient distribution map caused by the agglomerates.
[0098] In summary, this approach specifically captures the phase gradient features caused by wavefront distortion due to agglomerates, overcoming the limitations of simply relying on image intensity to extract features. The multi-directional refined analysis allows for more comprehensive extraction of phase gradient information, effectively distinguishing the wavefront changes between agglomerates and the background region.
[0099] Simultaneously, the abstract wavefront distortion features are transformed into a visualized and quantified vector field phase gradient distribution map, which clearly characterizes the key features such as the position and morphology of the agglomerates. This provides an accurate and effective feature basis for the subsequent nonlinear coupling of phase gradient information with image intensity information, avoids the interference of feature extraction deviation on subsequent agglomerate region growth and coherence verification, and ensures the accuracy of feature matching and region identification in subsequent detection steps.
[0100] In embodiments of the present invention, the phase gradient distribution map is nonlinearly coupled with the intensity information of the background-suppressed sample image to generate a coupled feature representation of the agglomerates, including:
[0101] Extract the orientation angle and magnitude of the gradient vector at each pixel in the phase gradient distribution map to form an orientation angle matrix and a magnitude matrix;
[0102] The intensity information of the sample image after background suppression is modulated according to the orientation angle matrix to obtain the modulated intensity distribution associated with the gradient direction.
[0103] Based on the modulus matrix, the intensity distribution after modulation is calibrated in the same distribution so that the spatial variation trend of the calibrated intensity distribution matches the phase gradient modulus, thus obtaining the coupling characteristic representation of the aggregate.
[0104] The formula for calculating the intensity distribution after modulation is as follows:
[0105]
[0106] In the formula, Indicates the intensity distribution after modulation. This represents the intensity information of the sample image after background suppression. This represents the phase gradient direction angle matrix. Indicates the gradient direction angle of the intensity image. Represents the modulation coefficient. This represents the cosine function.
[0107] Specifically, a phase gradient distribution map caused by bovine colostrum agglomerates is selected. Each pixel in the map corresponds to a unique gradient vector. Pixels in the image are selected one by one, and the angle between the gradient vector of each pixel and the horizontal direction is observed. The specific angle of this angle is measured as the direction angle of the gradient vector, and the length of the line segment of the gradient vector of each pixel is measured as the magnitude of the gradient vector.
[0108] Then, the orientation angles of all pixels are arranged sequentially according to their positions in the image to form an orientation angle matrix, and the magnitudes of all pixels are arranged sequentially according to their corresponding positions to form a magnitude matrix.
[0109] Furthermore, a bovine colostrum sample image after background suppression is selected, and the gray value of each pixel in the image is read. This gray value is the intensity information of the sample image after background suppression.
[0110] Specifically, modulation coefficient Based on the characteristics of bovine colostrum samples, and given the moderate intensity difference between bovine colostrum agglomerates and the background, preset parameters can be used. The value is set to 0.3 to avoid over-modulation leading to intensity distortion or under-modulation failing to reflect gradient direction correlation.
[0111] For each pixel, obtain its corresponding intensity information. Read the phase gradient orientation angle corresponding to the pixel in the orientation angle matrix. Calculate the gradient direction angle of the intensity image for this pixel. , The direction of the grayscale difference is determined by the difference in grayscale values between this pixel and its neighboring pixels. The direction, then calculate and Find the difference, calculate the cosine of the difference, and multiply the cosine by the value. Add 1 to the end, and then compare the result with... By multiplying and performing calculations pixel by pixel, the modulated intensity distribution associated with the gradient direction can be obtained.
[0112] Furthermore, a modulus matrix was selected, and the modulus variation trend of each region in the modulus matrix was observed. The modulus of the region corresponding to the agglomerate was larger and the change was gradual, while the modulus of the background region was smaller and there was no obvious change.
[0113] Finally, based on this trend, the modulated intensity distribution is calibrated by the same distribution. For regions with long modulus, the gray value of the modulated intensity distribution is appropriately increased. For regions with short modulus, the gray value of the modulated intensity distribution is kept unchanged, so that the calibrated intensity distribution matches the phase gradient modulus in terms of spatial variation trend. The image obtained after calibration is the coupling feature representation of the aggregate.
[0114] In summary, this scheme achieves deep fusion of spatial features of phase gradient and grayscale features of image intensity, breaking through the limitations of single feature representation of agglomerates. Orientation alignment modulation enables precise correlation between intensity information and phase gradient direction of agglomerates, and co-distribution calibration further aligns the spatial distribution trends of the two types of features, enabling the coupled features to more accurately and comprehensively represent the position and morphological features of agglomerates, significantly improving the feature differentiation between agglomerates and background regions, providing a more reliable feature basis for subsequent adaptive focusing growth of agglomerate regions, and effectively avoiding subsequent region recognition errors caused by single feature bias.
[0115] In embodiments of the present invention, based on coupling feature representation, adaptive focused growth of the agglomerate region is performed using feature coupling degree as the growth guide, resulting in candidate agglomerate regions, including:
[0116] Based on coupled feature representation, the feature similarity and spatial proximity between pixels are measured to construct a dynamic association network between pixels;
[0117] Starting from the pixel position with the highest feature coupling in the dynamic association network, the feature coupling is passed to adjacent pixels along the dynamic association, completing one round of coupling diffusion;
[0118] The feature coupling degrees gathered within the pixel set reached through diffusion are merged and integrated to form an initial growth core;
[0119] Starting from the initial growth core, the coupling diffusion and merging integration are repeated to gradually expand the coverage of the initial growth core and obtain the candidate aggregate region.
[0120] In embodiments of the present invention, starting from the initial growth core, coupling diffusion and merging integration are repeatedly performed to gradually expand the coverage area of the initial growth core, resulting in candidate agglomerate regions, including:
[0121] Before each coupling diffusion, the correlation strength between the current growth core boundary pixel and the external pixels is evaluated based on the dynamic correlation network.
[0122] Based on the correlation strength, the priority and amount of coupling degree transmission to different external pixels are controlled to guide the expansion direction;
[0123] When the association strength between the current growth core boundary pixel and all external pixels is lower than a level dynamically determined by the association strength of pixels within the expanded region, expansion stops, and the growth core coverage area at this point is determined as the candidate aggregate region.
[0124] Specifically, the coupling feature representation of the agglomerates is selected, which corresponds to the feature difference image between the agglomerates and the background in the bovine colostrum sample. The feature difference between each pixel in the image and the surrounding 3×3 neighboring pixels is compared one by one. The smaller the feature difference, the higher the feature similarity.
[0125] Simultaneously, it determines whether pixels are adjacent to each other to establish spatial proximity. Pixels with high feature similarity and spatial proximity are connected by lines. The comparison and connection operations of all pixels are completed one by one to construct a dynamic relationship network between pixels. Each connection in the network represents the relationship between two pixels.
[0126] Furthermore, from the constructed dynamic relationship network, the feature coupling degree of each pixel is checked one by one. The feature coupling degree is determined by the degree of fit between the pixel's own features and the features of related pixels. The pixel feature fit degree in the central region of bovine colostrum agglomerate is the highest. The pixel position with the highest feature coupling degree is found. Starting from this position, its feature coupling degree is passed to the adjacent pixels one by one according to the relationship. Each adjacent pixel receives the corresponding proportion of coupling degree, completing one round of coupling degree diffusion.
[0127] Furthermore, all pixels that have received coupling after one round of diffusion are collected to form a pixel set. The feature coupling of all pixels in the set is added together and then divided by the number of pixels in the pixel set to obtain the average coupling. This average coupling is used as the overall coupling of the set. The correlation and coupling of the pixels in the set are integrated to make the pixels in the set form a closely related whole, forming an initial growth core. This core is the initial region of the suspected aggregate.
[0128] Furthermore, starting from the initial growth core, before each coupling diffusion, the boundary pixels of the current growth core are extracted, and the association between the boundary pixels and the external pixels in the dynamic association network is analyzed one by one. The association strength is evaluated by combining the feature similarity and spatial distance between the two. The higher the feature similarity and the closer the spatial distance, the higher the association strength.
[0129] Furthermore, based on the assessed correlation strength, coupling is preferentially transmitted to external pixels with high correlation strength, and the number of transmitted couplings is greater than that of external pixels with low correlation strength. External pixels with low correlation strength transmit couplings later. In this way, the priority and amount of coupling transmission are controlled to guide the expansion direction of the growth core.
[0130] Finally, the correlation strength between all pixels in the expanded area is calculated, and the average value is taken as the judgment level. The correlation strength between the current growth core boundary pixels and all external pixels is compared one by one. When the correlation strength between all boundary pixels and external pixels is lower than the judgment level, the expansion is stopped, and all pixel areas covered by the growth core at this time are determined as candidate agglutination areas. This area corresponds to the range of suspected agglutinations in bovine colostrum.
[0131] In summary, this scheme uses coupling features as the core basis for adaptive focusing growth of agglomerate regions, which breaks through the limitations of fixed thresholds in traditional image region segmentation. Furthermore, the dynamic correlation network can accurately associate feature-similar pixels of agglomerates, and the construction of the initial core from highly coupled pixels ensures the accuracy of the region growth starting point.
[0132] Meanwhile, adaptive expansion based on correlation strength allows the region to grow in accordance with the actual shape of the aggregates, avoiding both over-expansion that includes background pixels and under-expansion that misses aggregate pixels, thus accurately delineating the complete range of suspected aggregates and providing accurate and complete candidate regions for subsequent coherence verification.
[0133] In embodiments of the present invention, coherence verification of candidate agglomerate regions is performed based on consistency analysis of phase gradient flow direction within the region, non-agglomerate regions are screened out, and the final agglomerate regions are obtained, including:
[0134] Based on the phase gradient distribution map, the gradient vector of all pixels inside each candidate agglomerate region is extracted to obtain the gradient vector set corresponding to each region.
[0135] For each region's gradient vector set, the distribution of its direction angles is statistically analyzed to obtain a distribution histogram describing the degree of direction concentration;
[0136] Analyze the peak shape characteristics and dispersion of the distribution histogram to generate a coherence score that characterizes the consistency of flow direction within the region;
[0137] The coherence scores of all candidate regions are compared, and regions with scores below the overall median level are identified as non-aggregate regions and screened out to obtain the final aggregate regions.
[0138] Specifically, candidate agglomerate regions composed of bovine colostrum agglomerates are selected, and the phase gradient distribution map caused by the agglomerates is retrieved. Each candidate agglomerate region is selected one by one, and the gradient vectors corresponding to all pixels in each region are extracted. The gradient vector of each pixel contains direction and length information. The gradient vectors of all pixels in the same candidate region are collected to obtain the gradient vector set corresponding to each candidate agglomerate region.
[0139] Furthermore, for each candidate agglomerate region, the direction angle of each gradient vector in the set is extracted one by one. The direction angle is evenly divided into 8 intervals from 0 degrees to 360 degrees, and the number of gradient vectors contained in each direction angle interval is counted one by one.
[0140] For example, in a certain candidate region, 35 gradient vectors are located in the range of 45 degrees to 90 degrees, 10 are located in the range of 90 degrees to 135 degrees, and the remaining ranges have very few vectors. Based on the statistical results, a graph is drawn with the horizontal axis representing the directional angle range and the vertical axis representing the number of vectors, resulting in a distribution histogram describing the degree of concentration of gradient vector directions in that region.
[0141] Furthermore, observe the peak shape characteristics and dispersion of each distribution histogram. If the histogram has a clear single peak and the range of the interval corresponding to the peak is narrow, it indicates that the gradient flow direction in the region is concentrated and the dispersion is small. If the histogram has no obvious peak and the vector is evenly distributed in multiple intervals, it indicates that the dispersion is large. Specific scores are given according to the concentration of the peak shape and the dispersion. The more concentrated the peak and the smaller the dispersion, the higher the score. In this way, a coherence score that characterizes the consistency of the flow direction within each region is generated.
[0142] Finally, all the coherence scores of the candidate agglutination regions are listed, and the scores are compared one by one to find the overall median level. When the coherence score of a candidate region is lower than the overall median level, the region is determined to be a non-agglutination region. All such non-agglutination regions are screened out, and the remaining candidate agglutination regions are the final agglutination regions, which correspond to the actual agglutination range in bovine colostrum.
[0143] In summary, this scheme uses the consistency of phase gradient flow direction as the core verification basis, accurately grasping the essential difference between the real aggregate and stray interference regions. The gradient flow direction in the real aggregate region is highly consistent, while the flow direction in non-aggregate regions such as impurities and artifacts is chaotic.
[0144] Meanwhile, by using coherence scoring and median level screening, interference areas in the candidate regions can be effectively eliminated, significantly improving the accuracy of agglomerate region identification and avoiding errors caused by non-agglomerate regions in subsequent agglomerate degree calculations. This provides a real and reliable basis for the accurate measurement of bovine colostrum agglomerate degree, ensuring the accuracy and effectiveness of the test results.
[0145] In embodiments of the present invention, determining the area ratio of the final agglomerate region in the sample image to obtain the bovine colostrum agglomeration degree includes:
[0146] Based on the uniformity of intensity distribution in the sample image after background suppression, a continuous region representing an effective bovine colostrum sample in the sample image is defined to obtain a mask of the effective sample region.
[0147] The total number of pixels in the final aggregate region and the effective sample region mask are counted and accumulated to obtain the total number of pixels in the aggregate region and the total number of pixels in the effective sample region.
[0148] The ratio of the total number of pixels in the agglomerate region to the total number of pixels in the effective sample region is used to obtain a proportional value that represents the area relationship, and this proportional value is used as the agglomeration degree of bovine colostrum.
[0149] Specifically, a bovine colostrum sample image after background suppression was selected. In this image, the intensity distribution of the effective area of bovine colostrum is uniform, while the intensity of the blank area on the slide is extremely low and the distribution is disordered. The intensity change of each pixel in the image is observed row by row and column by column.
[0150] When the pixel grayscale value is in a continuous range with a narrow fluctuation range, the pixel is determined to belong to the effective bovine colostrum sample area. All such effective pixels are connected and divided to define a continuous region representing the effective bovine colostrum sample. The image corresponding to this continuous region is the sample effective region mask.
[0151] Furthermore, the final aggregate region and the sample effective region mask are selected, and all pixels in the final aggregate region are checked point by point, marked and counted one by one. The counting is done row by row, without repetition or omission. The total number of marked pixels is the total number of pixels in the aggregate region. Using the same method, all pixels in the sample effective region mask are checked point by point, marked and counted one by one to obtain the total number of pixels in the sample effective region.
[0152] Finally, the total number of pixels in the agglomerate region is used as the dividend, and the total number of pixels in the valid sample region is used as the divisor. A division operation is performed, and the quotient is calculated digit by digit, retaining an appropriate number of decimal places to obtain a proportional value that represents the area relationship between the two. This proportional value directly reflects the area ratio occupied by the agglomerates in the bovine colostrum sample. This proportional value is used as the bovine colostrum agglomeration degree, thus completing the determination of the bovine colostrum agglomeration degree.
[0153] In summary, this scheme eliminates interference from invalid areas such as blank areas on the slide by defining the effective sample area, making the base for agglutination calculation more consistent with the actual bovine colostrum sample and avoiding the impact of invalid pixels on the accuracy of the results; the point-by-point counting method ensures that the pixel statistics are without duplication or omission, providing an accurate data foundation for ratio calculation.
[0154] Finally, the agglomeration degree is quantitatively characterized by the pixel area ratio, which can intuitively and accurately reflect the actual proportion of agglomerates in bovine colostrum. Combined with the final agglomerate area that was accurately screened in the previous step, the final agglomeration degree test result is true and reliable, providing an accurate quantitative indicator for the quality assessment of bovine colostrum. At the same time, the quantitative calculation method is simple and efficient, and it is suitable for the overall needs of automatic image detection.
[0155] Example 2, as Figure 2 The diagram shown is a module structure diagram of an automatic image detection system for bovine colostrum agglomeration provided by the present invention, which includes:
[0156] The image preprocessing module 101 is used to acquire a transmitted light source microscopic image of a bovine colostrum sample, and to suppress the scattering background of the microscopic image based on the scattering characteristics of light in the sample medium, so as to obtain a sample image after background suppression.
[0157] The phase gradient distribution map determination module 102 is used to extract phase gradient information based on local wavefront distortion from the sample image after background suppression to obtain the phase gradient distribution map caused by agglomerates.
[0158] The multi-feature coupling module 103 is used to nonlinearly couple the phase gradient distribution map with the intensity information of the sample image after background suppression to generate the coupled feature representation of the agglomerate.
[0159] The adaptive region growth module 104 is used to perform adaptive focused growth of the aggregate region based on the coupled feature representation and with the feature coupling degree as the growth guide, so as to obtain the candidate aggregate region.
[0160] The region verification and screening module 105 is used to perform coherence verification on candidate agglomerate regions based on the consistency analysis of the phase gradient flow direction within the region, screen out non-agglomerate regions, and obtain the final agglomerate regions.
[0161] The aggregation quantification module 106 is used to determine the area ratio of the final aggregate region in the sample image to obtain the aggregation degree of bovine colostrum.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. An automatic image detection method for bovine colostrum agglomeration, characterized in that, The method includes: S1. Obtain a transmitted light source microscopic image of the bovine colostrum sample, and suppress the scattering background of the microscopic image based on the scattering characteristics of light in the sample medium to obtain a sample image after background suppression. S2. Extract phase gradient information based on local wavefront distortion from the sample image after background suppression to obtain the phase gradient distribution map caused by agglomerates; S3. Nonlinearly couple the phase gradient distribution map with the intensity information of the sample image after background suppression to generate the coupled feature representation of the agglomerates; S4. Based on the coupling feature representation, adaptive focusing growth of the aggregate region is performed using the feature coupling degree as the growth guide to obtain candidate aggregate regions; S5. Based on the consistency analysis of the phase gradient flow direction within the region, the candidate agglomerate regions are verified for coherence, and non-agglomerate regions are screened out to obtain the final agglomerate regions. S6. Determine the area ratio of the final aggregate region in the sample image to obtain the degree of bovine colostrum aggregation.
2. The automatic image detection method for bovine colostrum agglomeration as described in claim 1, characterized in that, The method of suppressing background scattering in microscopic images based on the scattering characteristics of light in the sample medium to obtain a background-suppressed sample image includes: Based on the scattering angle distribution characteristics of light in the sample medium, the frequency domain transformation of the microscopic image is performed to obtain the frequency spectrum of the microscopic image. In the frequency spectrum, based on the mapping relationship between scattering angle and spatial frequency, high-frequency components corresponding to large-angle scattering background and low-frequency components corresponding to small-angle transmitted signals are separated. The high-frequency components are attenuated, and the attenuated high-frequency components are then recombined with the low-frequency components to obtain the corrected frequency spectrum. The corrected frequency spectrum is subjected to inverse frequency domain transformation to reconstruct the spatial domain image, resulting in a sample image with background suppression.
3. The automatic image detection method for bovine colostrum agglomeration as described in claim 1, characterized in that, The step of extracting phase gradient information based on local wavefront distortion from the background-suppressed sample image to obtain a phase gradient distribution map caused by agglomerates includes: For each pixel in the sample image after background suppression, the rate of change of image intensity in its neighborhood in multiple directions is analyzed to obtain the acceleration information of intensity change in each direction for each pixel. Based on the intensity change acceleration information, the direction of the most drastic intensity change at each pixel and the degree of drastic change in that direction are determined. By integrating the direction and degree of intensity change at each pixel, a vector field representing the local tilt of the light wavefront is constructed, resulting in a phase gradient distribution map.
4. The automatic image detection method for bovine colostrum agglomeration as described in claim 3, characterized in that, The process of determining the direction of the most dramatic intensity change at each pixel and the degree of dramatic change in that direction based on the intensity change acceleration information includes: For intensity change acceleration information, the degree of intensity change acceleration is accumulated and recorded along the continuous direction surrounding the pixel, and a correspondence between the direction index and the accumulated acceleration degree is established; Compare the magnitudes of all cumulative acceleration values in the corresponding relationships to locate the cumulative acceleration value with the largest value; The direction index associated with the largest cumulative acceleration value is taken as the direction of the most drastic change in intensity, and the largest cumulative acceleration value itself is taken as the drastic change in that direction.
5. The automatic image detection method for bovine colostrum agglomeration as described in claim 1, characterized in that, The step of nonlinearly coupling the phase gradient distribution map with the intensity information of the background-suppressed sample image to generate a coupled feature representation of the agglomerates includes: Extract the orientation angle and magnitude of the gradient vector at each pixel in the phase gradient distribution map to form an orientation angle matrix and a magnitude matrix; The intensity information of the sample image after background suppression is modulated according to the orientation angle matrix to obtain the modulated intensity distribution associated with the gradient direction. Based on the modulus matrix, the intensity distribution after modulation is calibrated in the same distribution so that the spatial variation trend of the calibrated intensity distribution matches the phase gradient modulus, thus obtaining the coupling characteristic representation of the aggregate.
6. The automatic image detection method for bovine colostrum agglomeration as described in claim 1, characterized in that, The adaptive focused growth of agglomerate regions based on coupled feature representation, using feature coupling degree as the growth guide, yields candidate agglomerate regions, including: Based on coupled feature representation, the feature similarity and spatial proximity between pixels are measured to construct a dynamic association network between pixels; Starting from the pixel position with the highest feature coupling in the dynamic association network, the feature coupling is passed to adjacent pixels along the dynamic association, completing one round of coupling diffusion; The feature coupling degrees gathered within the pixel set reached through diffusion are merged and integrated to form an initial growth core; Starting from the initial growth core, the coupling diffusion and merging integration are repeated to gradually expand the coverage of the initial growth core and obtain the candidate aggregate region.
7. The automatic image detection method for bovine colostrum agglomeration as described in claim 6, characterized in that, Starting from the initial growth core, the coupling diffusion and merging process is repeated to gradually expand the coverage area of the initial growth core, resulting in candidate aggregate regions, including: Before each coupling diffusion, the correlation strength between the current growth core boundary pixel and the external pixels is evaluated based on the dynamic correlation network. Based on the correlation strength, the priority and amount of coupling degree transmission to different external pixels are controlled to guide the expansion direction; When the association strength between the current growth core boundary pixel and all external pixels is lower than a level dynamically determined by the association strength of pixels within the expanded region, expansion stops, and the growth core coverage area at this point is determined as the candidate aggregate region.
8. The automatic image detection method for bovine colostrum agglomeration as described in claim 1, characterized in that, The consistency analysis based on the phase gradient flow direction within the region is used to verify the coherence of candidate agglomerate regions, screening out non-agglomerate regions to obtain the final agglomerate regions, including: Based on the phase gradient distribution map, the gradient vector of all pixels inside each candidate agglomerate region is extracted to obtain the gradient vector set corresponding to each region. For each region's gradient vector set, the distribution of its direction angles is statistically analyzed to obtain a distribution histogram describing the degree of direction concentration; Analyze the peak shape characteristics and dispersion of the distribution histogram to generate a coherence score that characterizes the consistency of flow direction within the region; The coherence scores of all candidate regions are compared, and regions with scores below the overall median level are identified as non-aggregate regions and screened out to obtain the final aggregate regions.
9. The automatic image detection method for bovine colostrum agglomeration as described in claim 1, characterized in that, The determination of the area ratio of the final agglomerate region in the sample image to obtain the bovine colostrum agglomeration degree includes: Based on the uniformity of intensity distribution in the sample image after background suppression, a continuous region representing an effective bovine colostrum sample in the sample image is defined to obtain a mask of the effective sample region. The total number of pixels in the final aggregate region and the effective sample region mask are counted and accumulated to obtain the total number of pixels in the aggregate region and the total number of pixels in the effective sample region. The ratio of the total number of pixels in the agglomerate region to the total number of pixels in the effective sample region is used to obtain a proportional value that represents the area relationship, and this proportional value is used as the agglomeration degree of bovine colostrum.
10. An automatic image detection system for bovine colostrum agglomeration, used to implement the automatic image detection method for bovine colostrum agglomeration as described in any one of claims 1-9, characterized in that, The system includes: The image preprocessing module is used to acquire a transmitted light source microscopic image of bovine colostrum samples. Based on the scattering characteristics of light in the sample medium, the microscopic image is subjected to scattering background suppression to obtain a background-suppressed sample image. The phase gradient distribution map determination module is used to extract phase gradient information based on local wavefront distortion from the sample image after background suppression, and obtain the phase gradient distribution map caused by agglomerates. The multi-feature coupling module is used to nonlinearly couple the phase gradient distribution map with the intensity information of the sample image after background suppression to generate the coupled feature representation of the agglomerates. The adaptive region growth module is used to perform adaptive focused growth of agglomerate regions based on coupled feature representation and with feature coupling degree as the growth guide, to obtain candidate agglomerate regions. The regional verification and screening module is used to verify the coherence of candidate agglomerate regions based on the consistency analysis of the phase gradient flow direction within the region, screen out non-agglomerate regions, and obtain the final agglomerate regions. The aggregation quantification module is used to determine the area ratio of the final aggregate region in the sample image, thus obtaining the aggregation degree of bovine colostrum.