In-Line Technologies for the Analysis of Important Milk Parameters during the Milking Process: A Review

: Considering automatized and robotic milking systems substantially decreasing the contact between producers and the herd, milk analysis is crucial to maintain the quality and safety of all dairy products. These systems naturally also decrease the possibility of health problems and illness identiﬁcation. Abnormalities in milk can be caused by several factors. Milk quality can be affected by external conditions, such as temperature and contamination in the feedstock; by management practices, such as hygiene, milking frequency, treatment, and feedstuff quality; and by diseases, genetics, or age. Somatic cell count, electric conductivity, and contents of urea, fat, protein, and lactose were reviewed as likely parameters of milk representing its quality with respect to feedback for consumers and breeders. Methods for evaluating milk constituents and parameters are still being developed to provide in-line information. These methods allow the avoidance of enormous economic losses every year caused by milk discard, health treatments, or cow replacements. In addition, individual and in-line milk analysis provides information in terms of nutritional status or lactation period and fertility. The objective of this study is to identify trends and potential methods focusing on in situ and in-line techniques for the analysis of milk parameters during the automatized and robotic milking process. Four methods are described and compared: near-infrared spectroscopy (NIRS) and mid-infrared spectroscopy (MIRS), optical analysis, milk conductivity analysis, and milk leukocyte differential test. The versatility and accessibility of these methods were also evaluated, showing a considerable range of possible related problems.


Introduction
Nowadays, automated milking systems (AMSs) represent a significant trend in the herd sector. These systems, implemented especially in developed countries, provide higher efficiency in milk production and thus higher activity profit. Labor-intensive tasks of feeding and milking usually carried out by managing the livestock in groups are known as systems of herd management [1]. On the other hand, milk characteristics are frequently affected by individual conditions (i.e., psychological state and genetic effects), and therefore, it is necessary to use individual procedures to guarantee required milk quality [2].
In connection with the mentioned quality of milk, it is important to avoid contamination after the milking process and then during the tank storage step. Such contamination may result in the disposal of the entire production volume, shorter product shelf life [3,4], or lower quality of the products [5]. In order to prevent or detect contamination, there is an Mastitis is defined as inflammation of the mammary gland associated in many cases with bacterial invasion of the affected gland. It results in the immune system's response and the fight against this invasion [23]. It has been reported that mastitis caused a loss of 150 euros per cow per year in 2002, which corresponds to approximately 185 euros in 2020. Moreover, udder infections represent the second most common cause of cow replacement It has also been reported that almost all steps in milk production can influence milk characteristics [15]. Milk composition (proportion of proteins, fat, and lactose), its microbial composition, and bacterial count may be affected. Contamination via milking equipment is due to the accumulation of milk residues from previous milkings or due to microorganisms accumulated in small cracks and slots, where they exhibit resistance to washing. Additionally, practices such as entrance control, ventilation, frequent bedding change, animal hygiene, and correct training of staff can decrease the bacterial count and other microorganisms in milk [16]. Conversely, insufficient cow housing and poor hygiene of milking equipment can lead to an increase in undesirable milk microbiota as well as to an increase in lipolysis intensity [17]. According to [18], fat amount as a milk quality indicator can be associated with the quantity and quality of feedstuff in terms of animal nutrition and with lactation period. The size of the milk fat globules may vary with the milking time [19]. Finally, among all factors that can result in milk quality alterations, low quality and insufficient space of facilities may be responsible for an increase by 13% in somatic cell count (SCC) and a reduction in milk fat by approximately 0.2%, as reported in [20].
In addition, health problems and diseases, such as mastitis, cause significant economic losses and are considered to be one of the most dramatic factors affecting the quality of milk. Several diseases affect the dairy herd, most of them directly affecting the volume of milk production or even milk quality. According to laws and national or international standards, some attributes in milk caused by diseases may be hazardous to human health. Moreover, it can even be a motive to discard the production, or even to replace the animal [8].
Milk quality can be affected by ketosis activating the excessive mobilization of fat in the period of transition between pregnancy and lactation [21]. Ketosis is based on the production of ketones as a source of energy in a state of negative energy balance. Ketone levels are not always compatible with high fat/protein ratios. In this context, researchers suggested that an increased fat-to-protein ratio of milk may indicate ketosis and negative energy balance [21,22]. Consequently, ketosis can lead to a reduction in milk production and an increase in the fat/protein ratio. If the ketosis is left untreated, it can develop into mastitis and infertility or cause early culling [22].
Mastitis is defined as inflammation of the mammary gland associated in many cases with bacterial invasion of the affected gland. It results in the immune system's response and the fight against this invasion [23]. It has been reported that mastitis caused a loss of 150 euros per cow per year in 2002, which corresponds to approximately 185 euros in 2020. Moreover, udder infections represent the second most common cause of cow replacement [24]. Mastitis is caused by an infection in the interior tissues of the teats. Microorganisms causing mastitis can be either contagious pathogens or environmental pathogens that could be difficult to be eradicated from the herd [25]. The infection can be classified as clinical when the cow shows recognizable symptoms or can also be classified as subclinical if there are no apparent signals of mastitis [16]. To identify this illness, a more detailed examination than visual analysis is required.
These udder infections can significantly increase the count of microorganisms in raw milk. The milk parameters already being monitored by the European Parliament and Council are somatic cell count (SCC) and total plate count of mesophilic microorganisms (TPC). Regarding consumer health, these milk parameters are monitored in the context of foodborne illness control [26]. The causes of abnormalities in milk are schematically illustrated in Figure 2.
The main objective of this literature review is to provide a comprehensive overview of the main methods and technical solutions for on-farm analysis of milk abnormalities and parameters. The presented methods should be compatible with in-line detection of milk in an automatized and robotic milking process (i.e., fast evaluation of data, cheap operation, long life, and calibration period) without degrading the milk.

Materials and Methods
The Web of Science (WoS) and ScienceDirect (SD) databases for bibliometric analysis of scientific publications were mainly used. These databases contain original research and review articles, book chapters, and other publications with the highest level of quality. For this reason, WoS and SD were used as the main sources of information in this study. In addition, the publications obtained from the mentioned databases were supplemented by articles found in SpringerLink (indexed by Scopus) and the Wiley Online Library.
The scope of research mainly included publications from the Elsevier and Cambridge University Press publishers. All recently published publications in WoS and SD searched by the keywords "milking technology," "in-line technologies," "milk parameters," and "milk analysis" were analyzed. Several older publications were added for their relevance.
A qualitative bibliometric method based on the analysis of publications by the authors themselves, partially supported by WoS sophisticated tools and the extraction of bibliometric data for processing in a spreadsheet software, was applied in the work. The used methodological approach included the following stages: 1. Identifying publications in scientific databases by keywords: "milking technology," "in-line technologies," "milk parameters," and "milk analysis." 2. Analyzing the results and selection of relevant publications of journals focused on agriculture and technology using the "Analyze Results" tool (WoS). 3. Downloading all selected relevant publications in the analyzed period and extracting their bibliometric data (authors, title, year of issue, keywords, additional keywords, publishing house) using the "Export to Excel" (WoS) and "Extract" (SD) tools. 4. Processing bibliometric data using the spreadsheet software MS Excel 2019 (sorting according to required criteria, identification of articles from the same authors, key-

Materials and Methods
The Web of Science (WoS) and ScienceDirect (SD) databases for bibliometric analysis of scientific publications were mainly used. These databases contain original research and review articles, book chapters, and other publications with the highest level of quality. For this reason, WoS and SD were used as the main sources of information in this study. In addition, the publications obtained from the mentioned databases were supplemented by articles found in SpringerLink (indexed by Scopus) and the Wiley Online Library.
The scope of research mainly included publications from the Elsevier and Cambridge University Press publishers. All recently published publications in WoS and SD searched by the keywords "milking technology," "in-line technologies," "milk parameters," and "milk analysis" were analyzed. Several older publications were added for their relevance.
A qualitative bibliometric method based on the analysis of publications by the authors themselves, partially supported by WoS sophisticated tools and the extraction of bibliometric data for processing in a spreadsheet software, was applied in the work. The used methodological approach included the following stages:
Analyzing the results and selection of relevant publications of journals focused on agriculture and technology using the "Analyze Results" tool (WoS).

3.
Downloading all selected relevant publications in the analyzed period and extracting their bibliometric data (authors, title, year of issue, keywords, additional keywords, publishing house) using the "Export to Excel" (WoS) and "Extract" (SD) tools.

4.
Processing bibliometric data using the spreadsheet software MS Excel 2019 (sorting according to required criteria, identification of articles from the same authors, keywords analysis for further search).

5.
Detailed qualitative analysis of the content of selected publications in terms of the following: achieved results and their relevance to the solution of the investigated problem.

Fat Content
Fat content is an important milk parameter due to its industrial attributions and the health signals it represents. Milk fat can be controlled for use in different dairy products [27], and it is highly associated with flavor and the milk visual aspect. It contributes to a variety of characteristics, such as flavors, mouthfeel, whiter appearance, and density. Some of them are being desired for various industrial uses [28].
It is also a good indicator of cattle health because it is influenced by many factors, such as breeds and genetics, environmental factors, management, psychological aspects, and nutritional efficiency [17]. Consequently, factors such as milking frequency and quality, frequency of feed, space, comfort, stress, and even seasons can affect milk fat content [29]. It has also been reported that a reduction of fat content in milk compared with the previous performance check of more than 0.4% could indicate rumen acidosis or structural fiber deficiency [30].
Another important factor considering fat content is "free fatty acid" (FFA) content. Fatty acids are substances dispersed chiefly in milk fat. Increase in FFA content is related to dairy cow metabolic problems or cow health deterioration, such as microbiological contamination. Higher content of FFA can compromise milk sensory properties, technological milk properties, milk fermentation, and other industrial properties. Thus, it is also related to milk putrefaction and, consequently, the safety of consumption [19,31]. The normal and limit concentrations of FFA in milk are shown in Table 1. Table 1. Normal and limit concentrations of free fatty acid (FFA) in milk.

Protein Content
Proteins are one of the most important constituents of milk, both economically and nutritionally. They are synthesized in the mammary gland or transferred from the blood [33].
Milk nitrogen can be divided into three groups: caseins, whey protein, and non-protein nitrogen (NPN), which is composed mostly of urea [34]. Urea represents approximately 50% of the total NPN [35]. Protein nitrogen is composed of 80% of casein and 20% of whey proteins, differentiated from casein proteins by precipitation. Caseins tend to precipitate at pH 4.6 and at 20 • C [17].
While the total percentage of proteins is usually considered to be about 2.8%-3.5% [34], Linn reported that the total percentage of proteins is about 3.5% [17]. These different results are explained by some variations considering different breeds, analyses, stages of lactation, and parities [36,37].
Other factors, such as genetics, illnesses, environment, and management, can affect milk protein distribution. For example, mastitis can affect the composition by increasing the permeability of blood constituents. Temperature and climatic seasons can influence whey protein and casein percentage when related to lactation stages and feeding [17].
Furthermore, the fat/protein (F/P) ratio is also intensively monitored. The F/P ratio depends on the breed and may affect nutritional quality, metabolism, and nutrient conversion [38]. F/P ratio values between 1.2 and 1.4 can be considered an optimal Agriculture 2021, 11, 239 6 of 17 condition [39]. It can be expected that cattle have rumen acidosis when the ratio is below 1.2. On the other hand, an increased ratio of over 1.4 indicates an energy deficit and subclinical ketosis. It is usually expected for a rather long exposure and may show an increase of over 1.5 [40]. The F/P ratio depending on the dairy cattle breed is shown in Table 2).

Lactose Content
Lactose, well known as milk sugar [41], is the main carbohydrate present in dairy products [42]. Other carbohydrates in the form of oligosaccharides are also present in the milk of most mammals [43]. Most people are able to digest lactose after birth, which is then the main source of nutrition until weaning. Approximately 75% of the world's population lose their ability to digest lactose during their life. Lactase, the intestinal enzyme that hydrolyzes lactose into absorbable sugars, has its maximum intestinal activity during the perinatal period, and then there is a significant reduction of its activity in some persons. It is called hypolactasia [44].
The molecule of lactose is formed by two different monosaccharides linked via β-glycosidic bond, glucose, and galactose [41]. Lactose represents the major milk osmotic compound responsible for 50% of the osmotic pressure of milk and milk volume [43,45]. Due to this fact, it is not possible to significantly reduce lactose concentration by feeding strategies or genetic selection to meet the requirements of consumers with lactose intolerance. On the other hand, many lactose-free products with lactose concentration below 0.1% are made using lactase treatment technology. It represents the possibility to avoid symptoms like abdominal pain and diarrhea [42]. Moreover, lactose content is not affected by milk dilution through days in milk (DIM), and its lactation curve is associated with the curve of milk yield and lactose yield with peak in early lactation [46].
The concentration of lactose is approximately 4.8 g lactose per 100 g, decreasing progressively with the lactation stage and with the increase of SCC in milk. Monosaccharide concentration is~10 mg·L −1 , and oligosaccharides~100 mg·L −1 [43].
Lactose represents a source of energy and causes an increase in the concentration of glucose in the blood. Considering that the glycemic index defines the rate of glucose utilization in the body, it is an important parameter to determine lactose concentration [47].
The relationship between lactose concentration and intramammary infections is important for the evaluation of milk parameters and quality. White cell inflammatory response factors cause damage to the epithelium surrounding the alveoli. As a result, the mammary blood barrier equilibrium is affected, and the concentration of lactose in the alveoli decreases and is osmotically balanced by some minerals, such as Na and Cl. Therefore, the milk of cows affected by mastitis has a lower lactose concentration, saltier taste, and greater electrical conductivity [45,48].

Urea Content
Urea is the final metabolic product of proteins and amino acids in animals [49]. It is the main component of non-protein nitrogen in milk [50], and it is directly associated with animal health. Urea content in the blood is an important indicator of renal diseases, while urea content in milk is an indicator of feeding efficiency and quality, including protein content [49].
There is also another important reason to monitor milk urea, considering the possibility of adulterated milk protein content adding cheap and nitrogen-rich compounds. It is also known that the combination of urea and water increases the volume of adulterated milk [51]. This harmful adulterant mixture associated with human diseases is a polar substance with dielectric behavior, which makes its detection very difficult. Moreover, it is easily incorporated into the milk [52].
A high presence of urea can lead to indigestion, ulcers, cancers, and malfunction of the kidney, among other human health concerns [51]. Reproductive performance and longevity, as well as technological indicators of milk, are reduced at higher urea concentrations. An increase in the average annual urea content in milk by 100 mg·L −1 extends the time of the insemination interval by an average of 3.6 days [31]. The normal and limit concentration of urea content in milk is shown in Table 3.

Somatic Cell Count (SCC)
Somatic Cell Count (SCC) is a significant and widely used indicator of udder health and, hence, of milk quality. There is no doubt that excessive SCC negatively affects the quantity and quality of produced milk, while the association between mineral content and coagulation properties has not yet been sufficiently investigated [55]. Regarding milk quality, the amount of SCC affects the fat, protein, and lactose contents [48]; the technological properties [56]; and the yield and quality of cheeses [57]. Reduction in milk production and quality due to high SCC levels has a significant negative economic impact on farmers and dairy producers.
Somatic cells are the most common cells in the immune system, representing 80% of the cells in healthy quarters and 99% of the cells in mastitic quarters [58]. SCC variation is associated with immune system responses to infections in mammary glands. It is accompanied by an influx of cells, such as leukocytes, macrophages, and lymphocytes in the affected region. SCC can increase in 1 h by a factor of 10-20 during infection [7]. At the same time, the transmission of antibiotic resistance through consumption and the transfer of pathogens from animals to humans may occur.
SCC and mastitis are moderately to strongly associated, and therefore, SCC can be used for indirect detection of mastitis. The relationship between SCC and mastitis and SCC and milk yield does not appear to be linear. As with high SCC levels, below some critical levels of SCC, the risk of mastitis may increase and cause a decrease in milk yield [59]. The effect of SCC levels on the mentioned milk properties may also be different for different cattle breeds, although this influence has not yet been studied in detail [60].
Due to farmer responsibility to supply milk of a certain quality according to the applicable standards, a high amount of SCC in milk sold is penalized in most countries by companies buying milk [61]. The SCC limits for processing and consumption were established by the European Commission to guarantee food quality and safety [58]. These limits are given in Table 4. Table 4. Somatic cell count limits of European Union and indicators of quarter health.

Parameter SCC in 1 mL of Milk
Healthy quarter 70,000-250,000 Infected quarter/limit for processing >400,000

Electrical Conductivity (EC)
Milk electrical conductivity is mainly due to its soluble salt fraction. Lactose, peptides, and proteins carry little or no electrical current. In addition, fat reduces the electrical conductivity of milk [62]. The values of electrical conductivity may be affected in case of illnesses, such as mastitis or other infections [63]. Moreover, microbial growth and metabolic activity also affect this milk parameter [62].
It has also been reported that it is possible to detect mastitis by recording electrical conductivity (EC) values during milking. It is usually carried out by applying correction models on the differences naturally occurring due to natural variation. Lien, Wan, and Ting performed tests on 48 randomly selected dairy cows and statistically evaluated the obtained data using linear discriminant analysis [63]. They found a predictability of 30.7% for infected quarters and a predictability of 90.8% for healthy quarters using the SAS Generalized Linear Model procedure, which is a bit inferior compared with the predictability of the SCC technique described above in Section 3.5. It was concluded that EC measurement has great potential as a simple and inexpensive method for real-time detection of mastitis without using historical EC recordings.
On the other hand, there are several factors that must be considered when performing EC measurements. The electrical conductivity of milk varies from cow to cow and depends on the lactation period. The eventual detection of illnesses by a single measurement of milk electrical conductivity is inaccurate for the reasons mentioned above. Thus, it is necessary to make a series of measurements during the lactation period [63].
Monitoring of EC is effective only when the EC is measured for each udder quarter, because the disease may not appear in the whole udder at the same time [64]. It is very important to measure milk temperature as when the temperature rises, the EC increases as well. Between 15 • C and 40 • C, the EC temperature coefficient ranges from 0.0146 to 0.0241 per degree Celsius [65]. The reference value of EC for milk from a healthy cow is 4-6 mS·cm −1 at 25 • C [66]. The important factors affecting EC are presented in Table 5.

Mycotoxin Content
Mycotoxins are harmful substances produced mainly by fungi. The formation of mycotoxins in agricultural products occurs due to unfavorable temperatures and humidity during harvesting, storage, transport, and further processing. The mycotoxins presented in the feed are easily absorbed into the cow's body and then enter the milk. Mycotoxins are of extreme toxicity, and therefore, it should be of great importance to monitor their content in dairy milk.
The most dangerous group of mycotoxins are probably aflatoxins that are produced by Aspergillus [72,73]. Aflatoxins are among the strongest known carcinogens primarily invading the liver and causing chronic diseases (tumors) [74]. They are mutagenic, hepatotoxic, nephrotoxic, and immunosuppressive [75]. More than 20 types of aflatoxins have been described, but only 4 are found in food, namely, aflatoxins B1, B2, G1, and G2. However, aflatoxins M1, M2, P1, and Q1 may also occur during metabolic conversion. Many studies report an association between aflatoxin M1 in milk and aflatoxin B1 in feed, as aflatoxin B1 toxins consumed with feed are metabolically converted and excreted as aflatoxin M1 in urine and milk. Subsequently, aflatoxin M1 with resistance to heat inactivation, pasteurization, and sterilization can also be transferred to dairy products intended for human consumption. Milk is tested for the presence of aflatoxin M1, while aflatoxins B2 and M2 are also mentioned in connection with milk [76].
As part of the quality control of food products, great efforts are being made to monitor the content of mycotoxins, including dangerous aflatoxins. Detection of aflatoxins is usually performed by accredited laboratories with sophisticated instrumentation. Official methods include thin layer chromatography [77], gas chromatography-mass spectrometry [78], and high-pressure liquid chromatography (HPLC) using fluorescent or mass spectrometry detections [79]. In addition, methods of spectroscopic analysis, including Fourier-transform infrared spectroscopy and Raman spectroscopy, are used to detect aflatoxins [80,81]. Despite their undeniable advantages, these methods are laborious and time-consuming. Some modern techniques detect the presence of aflatoxins immunochemically by using specific antibodies to specifically determine their analytes from complex samples or by using immunochemical assays, such as enzyme-linked immunosorbent assay [82], lateral flow immunoassay [83], and chemiluminescent immunoassay [84].
In in-line measurements, analyses are performed in a short time, and current technology provides only very limited detection capabilities. Considering that immunochemical methods are also very labor-intensive, it is usually not the ambition of in-line measuring systems to monitor the mycotoxin content. On the other hand, there are recent publications aimed at automated systems for the detection of aflatoxins. For example, Rhemrev et al. dealt with the development of a reusable immunoaffinity cartridge where the antibody was coupled to a pressure-resistant polymer, making the cartridge usable in a commercially available automated system coupling the cleanup cartridge to the liquid chromatography system for analysis with fluorescence detection [85]. On the other hand, this study did not deal with the in-line detection of aflatoxins in milk, but in several plant products. Aflatoxins from these plant products can contaminate milk indirectly only after metabolic conversion.

Near-Infrared and Mid-Infrared Spectroscopy
Infrared spectroscopy is the physicochemical technology used among others on rice or wheat, providing an analysis method for food industry quality efficiency. The principle of this method is based on the reflection and absorption of different wavelengths and identification of specific molecular vibrations. The characteristic spectrum of near-infrared spectroscopy (NIRS) is between 800 and 2500 nm [86], while the characteristic spectrum of mid-infrared spectroscopy (MIRS) is between 2500 and 25,000 nm [87]. The reflection and absorption of these wavelengths provide information about the characteristic bonds in organic molecules, such as C-H and O-H [88].
NIRS can be used to analyze parameters, such as water, lactose, fat, and protein composition. Moreover, it can be used for the measurement of somatic cell count (SCC) and milk urea nitrogen (MUN) [1].
Recently, many authors have focused on the use of MIRS to predict fatty acid (FA) and fatty acid groups (FAGs), which has a high potential for this purpose. Achieving high accuracy and robustness by MIRS calibrations can be achieved by developing prediction equations using milk from different breeds, countries, and seasons using the same reference method [87]. Milk coagulation properties (MCPs), protein composition, and acidity and their prediction by MIRS have been investigated in [89] and considered to be valid for predicting MCPs and milk acidity in bovine milk. On the other hand, it can be stated that MIRS cannot be used to predict milk protein composition with high accuracy, and therefore, the prediction models are not currently suitable for the dairy industry [87]. Moreover, MIRS prediction models by McParland et al. provided useful information on the energy status of cows to dairy farmers [90].
Compared with other milk analysis techniques, these methods have some advantages, such as portability, easy different systems adaptation, low costs, robustness, fast result obtainment, and nondestruction of the sample. It is ideal to in situ and online application [91]. In addition, it is a nonpollutant technique and does not require sample pretreatment [1].
On the other hand, specific milk characteristics, such as heterogeneity, opacity, mineral, and fat molecules reduce the accuracy of this analysis and the equipment precision [92].
To increase the precision, a series of studies are being carried out to generate precise calibration models and low error rates, as well as to reveal the technology reliability [90]. Anyway, recent studies have proved the reliability of portable models in in situ applications and models used in technologies with a direct connection to milking equipment [1].
Although it is difficult to compare the costs of the presented analytical methods, a relatively expensive instrumentation is required in the case of infrared spectrometry. The price of commercial NIR and MIR spectrometers ranges widely from approximately 6000 euros for the cheapest models to tens of thousands of euros. Low-cost spectrometric devices are sometimes developed in scientific laboratories, such as in [93]. The price of such a device can be in the order of thousands of euros, while the most expensive is the development of the software.

Milk Conductivity Analysis
The traditional somatic cell count measurement is a time-consuming and expensive method. Thus, using this method for the determination of mastitis in cows cannot provide instant information [54].
On the other hand, measurement of electrical conductivity is a simple, low-cost, easyto-incorporate, and automated in-line method. Measuring the conductivity is carried out during the milking [94,95]. This method was invented in the 1990s as an alternative to determining subclinical mastitis. An integrated system with a sensor can be used to measure milk yield, milk temperature, and the electrical conductivity of the milk [96].
Electrical conductivity is determined by the presence of cations and anions. They appear when Na+ and Cl− concentrations increase in milk in case of mastitis [94].
Milk is a heterogeneous complex solution without a constant composition. Milk electrical conductivity depends on the period of lactation, and it is not equal for all collected milk samples. Obviously, milk electrical conductivity is highly individual (different for each cow) [63]. Thus, due to inexpensive and fast measurements, a historical series of data and a continuous analysis of these databases can indicate abnormal signals in milk with high precision [97].
Zaninelli et al. reported that a sensor for measuring the electrical conductivity of milk can be placed at the base of each individual teat cup. A designed device was expected to have an average value of milk flow of 0.8 L·min −1 [98].
Milk conductivity analysis seems to be the most affordable of the presented analytical methods thanks to simple operation and relatively inexpensive instrumentation, including commercial sensors, a signal converter, and simple data storage software. The price of this equipment can be in the order of hundreds of euros.

Optical Analysis
The use of optical sensors is different in milk quality analysis. Due to physical changes of milk caused by abnormalities and contamination, it is possible to indirectly explore the scattering aspect of light and its absorbency. Changes in color caused by blood contamination, fat concentration, and casein micelles can be focused on using optical sensors [9].
It has been proved that optical instruments, such as optical fiber sensors, have great efficiency for fat content measurement. Optical measurements also have high field applicability due to their cost and portability [99].
Concerning the detection of contamination by microorganisms, one of the most applied methods in automized systems is flow cytometry, tested and approved by both European (European Union Reference Laboratories) and North American (Food and Drug Administration) reference laboratories [100].
While traditional cell count methods are considered to be slow, labor-intensive, costly, and not applicable for routine use [101], flow cytometry provides analysis of up to 10,000 cells per second. In addition, it is possible to determine more complex characteristics of the sample, such as typology of microorganisms, using different techniques and chang-ing the analysis patterns achieved using stains and different labels. It can also be carried out more precisely because the method is not based on approximations and is established on colony counting [102].
In addition to commercial devices for optical analysis (with the price in the order of hundreds of euros), there are also low-cost devices developed in scientific laboratories [103]. Another expense of this method is associated with the calibration of the instrumentation after 6 or 12 months.

Milk Leukocyte Differential Test (MLD)
Milk leukocyte differential test (MLD) is a method based on optical analysis but focused exclusively on leukocyte count developed for indirect mastitis identification. The major commercial equipment is based on the scanning of milk samples with a built-in microscope (Advanced Animal Diagnostics).
This method is based on the fact that the number of white cells is rapidly increased in the course of mammary gland infections, such as mastitis. It is a means of defense of the udder against pathogens, thus playing an important role in mammary health [5]. MLD allows us to analyze, count, and establish the percentages of three different types of leukocytes (lymphocytes, neutrophils, and macrophages). Moreover, it is possible to make a diagnosis by determining which of these leukocytes represents an infection state using other differentials (Advanced Animal Diagnostics).
Recent studies have confirmed good results of MLD tests compared with traditional California mastitis tests (CMTs), although only a few independent studies of MLD have been made so far. On the other hand, other studies with more randomized sampling and different conditions are still needed to prove its economic and real precision as well as its usability for health treatments [104].
The test is shown as an alternative to traditional SCC tests, with precise and digitalanalysis-test-based results. It includes factors such as early or late lactation and uses the analysis of each one of the quarters. Each analysis takes between 3 and 15 min, depending on the chosen mode, and costs approximately 4 euros per cow [105].

Discussion
The objective of this study is to collect new methods that could be used in automized milking systems, helping farmers avoid economic and animal losses related to contamination and milk quality. Many health and management problems can be detected just by analyzing milk quality, which are shown schematically in Figure 3.
In order to choose the most adequate methods to complete this review, factors such as reliability, possible automation, and quickness were considered. In addition, other methods involving chemical mixtures and reagents damaging the sample or biological methods requiring microorganism cultures with their rather lengthy processes or inaccurate results were found not to fulfill the requirements for in-line and in situ detection systems.
An interesting observation derived from this overview is the importance of milk fat content for the identification of many different health and management problems [17]. Milk fat content is obviously crucial for commercial value [19]. These characteristics can increase the value of milk fat as one of the most versatile parameters in milk evaluation.
Concerning the other results summarized in Figure 3, somatic cell count is still one of the most important milk parameters directly revealing illnesses and other health and hygiene problems. Besides the precision of the methods mentioned before based on the parameters directly and easily related to these problems [7], it is important to notice that mastitis can also be detected using indirect indicators, such as electrical conductivity and protein content [17,63]. rate results were found not to fulfill the requirements for in-line and in situ detection systems.
An interesting observation derived from this overview is the importance of milk fat content for the identification of many different health and management problems [17]. Milk fat content is obviously crucial for commercial value [19]. These characteristics can increase the value of milk fat as one of the most versatile parameters in milk evaluation. Concerning the other results summarized in Figure 3, somatic cell count is still one of the most important milk parameters directly revealing illnesses and other health and hygiene problems. Besides the precision of the methods mentioned before based on the parameters directly and easily related to these problems [7], it is important to notice that mastitis can also be detected using indirect indicators, such as electrical conductivity and protein content [17,63]. Considering studies showing the correlation among milk parameters, it seems to be possible to ever better integrate the existing methods simplifying milk quality analyses in the future. It could also favor farmers popularizing less accessible methods and increasing the milk quality as a general standard.
It must be clearly stated that there are many factors that are able to influence the results obtained with the appropriate analysis equipment. Thus, it is necessary to be focused on the technical issues and precise adjustment. This approach leads to the best parameters and the most suitable equipment for milk analysis, such as illness monitoring, milk quality monitoring, and nutritional monitoring, leading to the best parameters and the most suitable equipment to use. Many methods are still at a developing stage or are not commercially available in spite of their precision and reliability. There is also much said about small farmers that they cannot afford these investments to automize milk production [63] because more accessible equipment for their farms is required.
High quality and safeness of milk should not be limited to big farmers; it is interesting to notice that many methods are already being developed to meet this purpose. For example, milk conductivity analysis and near-infrared spectroscopy are simple means, and they represent a large potential due to their low-cost techniques to monitor milk [91,94].

Conclusions
It is proven that technologies enabling milk quality analysis in a fast way or even immediately exist. Moreover, they represent accessible and data-driven methods to control the quality of the final product and support the management applicable in automated milking systems. To increase the efficiency of milk quality detection, it is necessary to analyze milk from each quarter of the dairy cow separately. This approach increases the probability of detecting, for example, udder inflammation, which may occur only in one quarter of the udder.
The mentioned methods are based on the main constituents, such as fat, protein, lactose, and other parameters (e.g., urea, somatic cell count, and electrical conductivity). They allow a diverse approach to detect and evaluate milk. These parameters are often used to identify the most common health and management problems and possible contaminations or adulterations and to establish the value of the product.
Concerning the applicability of the methods and their widespread use in the future, NIRS, MIRS, and electrical conductivity measurement have a good potential due to their simplicity and accessibility. Optical analysis is advantageous for its versatility and precision.
These methods should be considered fundamental for developed in-line milk quality monitoring systems aimed at evaluating the current milk quality and preventing the milking of abnormal milk into a milk tank. Consequently, these methods can protect the interests of future consumers and increase profits for breeders. The presented technologies also provide important information for the management of the breeding herd, which will help to improve the welfare of dairy cows. In order to increase the reliability and popularization of in-line milk monitoring systems, additional research and test applications are needed.
Funding: This work was financially supported by the Ministry of Agriculture of the Czech Republic, research project QK1910174: "Improving the quality of milk and its economic indicators by using an automatic monitoring system for selected parameters in real time".