Enhancing the Quality of Dairy Products by Reducing the Pilferage and Increase the Efficiency of Logistics Performance by Using Automated Dairy System.

Background: Dairy farming is a vital sector in developing countries, where small farmers contribute approximately 80% of the dairy milk supply. These farmers often rely on traditional practices and are disconnected from technological advancements. This gap highlights the necessity for technology integration to meet the increasing global demand for dairy products. Objective: This research paper aims to prevent water adulteration in milk and enhance the monitoring of the milk trade through an Automated Dairy System, ensuring the provision of pure milk to the public. Methods: Our Automated Dairy System incorporates several components and interfaces, including a Sensor Interface (I/O), Internet Connection Interface, Bluetooth Interface, and Audio Interface. The system enables dairy farmers to check milk quality for impurities before dispatching to vendors and upon arrival. Additionally, it tracks the transportation of milk containers from farms using GPS technology. Results: Initial tests on the prototype demonstrate the system's effectiveness in detecting changes in milk volume, indicating potential adulteration. The GPS tracking feature successfully monitors the transport process, ensuring the milk's purity during transit. Conclusion: The implementation of this Automated Dairy System in dairy farming, especially in Pakistan, represents a significant stride towards improving milk quality and quantity. This innovation not only meets the current technological gap in traditional farming practices but also aligns with the growing global demand for high-quality dairy products. Our system is expected to have a substantial impact on the dairy industry by ensuring the delivery of pure milk to consumers and enhancing the overall efficiency of milk production and trade.


INTRODUCTION
In recent years, the dairy industry has grappled with the issue of milk adulteration, which poses significant health risks (1).The world's growing population has led to an increased demand for dairy products.Earlier estimates suggest that while industrialized countries consume more dairy than developing countries, this gap is widening as global populations grow and dietary preferences evolve.Approximately 80% of dairy in developing countries is produced by small farmers (2), many of whom are disconnected from technological advancements.The implementation of technology is crucial to meet the increasing global demand for dairy products.Our proposed system is designed to ensure constant milk quality monitoring.It features a long lifespan, precise measurements, and easy upgrades through the integration of components with advanced capabilities.User-friendly, it requires no prior knowledge for operation.The system aims to detect impurities in milk, such as water, at both the farming and retail stages, thereby mitigating health risks associated with milk adulteration.The future of agriculture depends on strong collaboration among all stakeholders in the food production sector.Advances in agricultural research and smart technology are vital for progress in genetics, breeding, crop management, conservation, and environmental protection.The impact of the Internet of Things (IoT) in agriculture, particularly through smart farming in Ontario, Canada, serves as a case study for the future of food production (3).This study explores how smart farming technologies contribute to efficient agricultural management and sustainable practices.The current paper highlights the importance of integrating innovative research and advanced technology in agriculture.The emergence of IoT in this sector is crucial for global ecosystems, as it can significantly enhance both the quality and quantity of agricultural production.This demonstrates the transformative potential of IoT in developing sustainable and efficient food production systems.Over the years, the dairy sector has seen numerous technological innovations (4).However, the widespread implementation of these innovations presents challenges.Successful integration requires consideration of technological feasibility, economic viability, and sustainability goals within the complex dairy industry.A separate study, "Smart Dairy Farmer," emphasizes extending grazing seasons, optimizing herd breeding strategies, improving milking efficiency, refining feeding management, enhancing energy management, and exploring aspects of energy production, forestry, and biodiversity (5).The primary goal of this research is to improve processes related to breeding, energy utilization, calf feeding, and milking for better efficiency in dairy farming.Insights into the automation of the dairy industry indicate significant advancements in transforming raw materials into finished goods to meet production targets (6).Automation in processing aims to enhance food safety and quality.This includes the use of Automatic Milking Systems (AMS) or milking robots, which have significantly improved livestock management and maintenance.Automation in the dairy industry enables continuous operation, ensuring consistency and product quality that are difficult to achieve manually (7).A study on the dry period in dairy cows found that the optimal duration varies depending on desired production outcomes (8).Similarly, a correlation between increased heat stress and decreased milk yield was observed, with variations based on cow parity and lactation stage (9).Effective management practices must consider these factors to mitigate heat stress impacts on milk production.Finally, this review focuses on advancements in welfare biomarkers, activity-based welfare assessment, and sensors for temperature and pH monitoring in dairy farming (10).The integration of these technologies into smart husbandry support systems is expected to significantly transform traditional dairy farming, enhancing animal well-being and farm profitability.

MATERIAL AND METHODS
In conducting our research, we visited farms to gather information about farmers and the milk trade.Our findings revealed a lack of milk quality checks before it is sent to retailers and upon its arrival.This observation led us to develop a solution aimed at ensuring the consumption of healthy milk.Our methodology centers on tracking and identifying adulteration in milk.Dairy farmers first measure the volume of milk using a sensor before loading it onto transport vehicles headed for vendors.They then employ our tracking system, which uses the transporter's mobile GPS, to monitor the vehicle loaded with milk from the farm.The tracker records the duration of the journey, updating the app if the vehicle takes longer than expected to reach its destination.This information is relayed to both the vendor and the farmer through the app.Prior to loading, the truck's milk is tested for volume and impurities using our sensor, and this process is repeated upon arrival at the shop.Our goal is to oversee the entire milk trading process.Regarding hardware components, our system includes the NodeMCU ESP8266 (Wi-Fi module).This self-contained SOC with an integrated TCP/IP protocol stack allows any microcontroller to access a Wi-Fi network.The ESP8266 can host an application or offload all Wi-Fi networking functions from another application processor (11).We also utilize the Ultrasonic Sensor HC-SR04 (Generic), which employs SONAR to determine the distance to an object, similar to how bats operate.It provides excellent non-contact range detection with high accuracy and stable readings, ranging from 2 cm to 400 cm or 1" to 13 feet (12).Additionally, our system comprises LED bulbs, a 3.3-volt battery, wires, and a switch.Our product aims to reduce adulteration in milk, ensuring the delivery of healthy and fresh milk to consumers.We have integrated our application with FCM, a real-time database, to update changes in milk volume, facilitating real-time monitoring through our app.
A UML (Unified Modeling Language) diagram is a tool used to visually represent a system, detailing its major actors, roles, actions, artifacts, or classes, for the purpose of understanding, editing, maintaining, or documenting the system's information.In Figure 1's UML diagram, there are three actors: the Farmer, the Transporter, and the Vendor/Shopkeeper.The Farmer begins the process by placing the milk into a 40-liter container, which is then subdivided into smaller containers for transport.The Transporter is responsible for enabling their GPS location, which is tracked by both the Farmer and the Vendor.This tracking ensures that the Transporter can easily navigate to the Vendor's location.Upon reaching the Shopkeeper, the quality of the milk is verified.If the milk quality remains unchanged, it indicates that no adulteration has occurred during transit.The Shopkeeper receives notifications from the tracking app system every 10 seconds, and upon the safe arrival of the container, the Farmer is notified.The Shopkeeper also checks the milk level after receiving it from the Transporter.For tracking purposes, the Transporter's mobile location is utilized, facilitated by a GPS mobile tracker (GSM).In this scenario, login access is provided for security purposes to both Farmers and Shopkeepers.This measure ensures that tracking is exclusive to individuals who are part of this supply chain, preventing unauthorized access.
The Process Flow Diagram (PFD) depicted in Figure 2 illustrates the configuration of the equipment and accessories required for the process.It also shows the stream connections, flow rates and compositions, and operating conditions.According to the diagram in Figure 2, the administrator grants access to the farmer, transporter, and milk vendor or shopkeeper to use the system; however, customers are not provided with this access.Both the farmer and the shopkeeper are responsible for checking the volume of milk, while the vehicle transporting the milk is tracked using mobile GPS by both the shopkeepers and farmers.Additionally, the diagram outlines the tracking and delivery activities, highlighting that users cannot access the page without verified identity.
In Figure 3, a form of UML diagram is presented that depicts the various types of objects in a system and the static relationships that exist between them.It also illustrates the operations and attributes of the classes.The class diagram for the milk purification system is divided into two main components.The first consists of four actors: the admin, farmer, vehicle, and shopkeeper.The second component includes milk and a tracker.The admin possesses attributes such as credentials, location, and shop address.The admin's methods include adding records, updating records, and deleting records.The second actor, the farmer, has attributes like farmer ID, farmer name, and contact.The farmer's methods encompass the farmer ID, farmer name, contact number, and the quantity of milk supplied.The third actor, the vehicle, features attributes such as vehicle ID, driver name, and contact.Its methods include vehicle registration, driver name, contact number, and details of milk transportation.The shopkeeper has attributes including shop ID, full name, shop name, shop address, and contact.Lastly, the tracker has attributes like tracker ID and the number of transportation tracking instances.Its methods involve tracking the number of vehicles and the transportation of milk.In this system, the admin is connected to the farmers, transporter, and shopkeeper.Additionally, the farmer and transporter are linked to the shopkeeper.

RESULTS AND DISCUSSION
In this section of the study, validations were conducted.Verification is a process that determines the quality of software.This process includes all activities associated with producing high-quality software, such as testing, inspection, design analysis, and specification analysis.Verification is a relatively objective process, requiring no subjective judgment if the processes and documents are precisely expressed.Validation is the phase where the software's functionality is ensured to align with the customer's requirements.This crucial step occurs towards the end of the development process, following the completion of verifications.If any defects are overlooked during the verification phase, the validation process identifies and addresses them as failures.In cases where there is a misunderstanding of specifications during verification, and development has already occurred, the validation process is instrumental in recognizing disparities between the actual and expected results, allowing for corrective actions (13).Validation occurs during various testing stages, including feature testing, integration testing, system testing, load testing, compatibility testing, and stress testing.Its primary objective is to ensure the development of a product that aligns with the customer's requirements, satisfying their business process needs.The distinction between validation and verification lies in the role of specifications.Validation checks if the specifications accurately capture the customer's requirements, while verification focuses on confirming that the software adheres to these specifications (14).On the other hand, validation is a subjective process, involving assessments of how well the proposed system addresses real-world needs.It includes activities such as requirements modeling, prototyping, and user evaluation.The combined process of validation and verification serves as a method for measuring product usability or user-friendliness, facilitating future improvements (15).Initially, to assess the precision of the sensor components in detecting liquid volume within a milk container, tests were conducted on a prototype.The container was first filled with water instead of milk and sealed.The hardware component was positioned at the top of the cap inside the container.The initial step involved setting the volume and noting the initial reading before altering the water/milk level.Subsequently, the liquid level was adjusted and any changes in the reading were observed.Differences were compared with the previous reading (16).After recording these observations, a physical check was conducted to ascertain whether the recorded reading differences aligned with the results of a physical measuring process.This step was crucial for verifying the accuracy level of the sensor components in the liquid volume detection system.Following the initial phase, the next step involved placing the project in transport and verifying if the object (the transport vehicle) was correctly displayed on the map screen.Adjustments were made to the milk level, and observations were made regarding the alarm functionality in the application.This evaluation was important for assessing the accuracy of the components in scenarios where there might be leakage.The accuracy of the components was tested when a leakage occurred on a flat road.This involved monitoring the gradual decrease in liquid height over a certain period at various locations.Such a decrease could be indicative of potential leakage or unauthorized theft.This testing phase aimed to ensure the effectiveness of the system in detecting and alerting to such critical events in realworld conditions.The accuracy of the component was tested by tilting the container first.This activity was performed for a few seconds before the surface was balanced again to check for reading variations in the stability of the container.In the subsequent phase, the verification of both the driver's location and the locations of vendor shops was conducted.This was achieved by sending the location information via a link to the transporter and then comparing the vendor's location with the driver's location.A match between these locations indicated proper functionality.Following this, the validation process of the mobile application was examined.This involved checking various user interfaces, including the login UI and Sign-In UI.After these checks, the Home UI was scrutinized to ensure the overall effectiveness and accuracy of the mobile-based application.In the Login UI, a series of checks were performed to ensure the functionality and validity of the application.The input text fields were tested for responsiveness.The validation process involved attempting to log in with incorrect username and password combinations.If the login was successful with invalid credentials, it indicated a lack of validity.Conversely, if the login failed with invalid credentials, the validation was considered successful (17).The visibility of the password field was examined, and if it was visible, the functionality was altered to make it hidden.The login button's clickability was assessed, and after successful login, the frame's disposal was checked.If the frame was disposed of, it confirmed the verification process.Additionally, the Sign-in button at the bottom of the Login UI was tested for clickability.After clicking, the opening of the new form page was verified.This new form contained multiple fields and labels, including first name, last name, email, and contact information.
Each input field was tested with various scenarios, such as providing incorrect information or leaving fields empty.Any issues identified were addressed, and the app was validated successfully (18).For the Sign-in interface, clicking the registration button was tested to ensure that all fields cleared after submission.Two types of test cases were applied: negative test cases, where incorrect information was entered, and positive test cases, where correct information was provided.Success in executing functions with incorrect inputs indicated a successful negative test, and successful execution with correct inputs confirmed the validity of positive test cases.Any discrepancies were noted for further refinement (19).It was noticed that the milk supplied to retailers was often not pure, with a mixing process that was hidden, making the milk not as healthy as it usually is.Milk adulteration can cause many harmful diseases; therefore, due to this practice, the decision was made to create a device through which the whole milk trade could be tracked to stop the dilution of other substances.A device was built that would help stop milk adulteration, ensuring that the milk delivered remained pure.Despite the benefits of the device, there were some limitations, such as its inability to diagnose diseases associated with milk adulteration and to alter the quality of the milk.Additionally, it could not purify impurities present in the milk, nor could it check the temperature of the milk extracted from cows (20).

CONCLUSION
Dairy farming is increasingly becoming an attractive business in Pakistan, with the potential to boost the country's economic prospects.This study focuses on an automated dairy system, acknowledging the challenges of innovating in milking, a process traditionally fraught with risks.Society's growing demands for pure and disease-free milk production underscore the need for such innovations.Automated dairy farming offers an efficient and potentially transformative technique in dairy farming.This smart dairy system aims to connect farmers and retailers through our application.It monitors the milk volume in containers, updates this information periodically on the application, and alerts retailers if there are changes in milk volume.Additionally, the system includes GPS tracking of vehicles transporting milk containers from farms.The primary objective of developing this system is to provide the public with purified milk.The implementation of a smart system, which involves technological data collection, milk volume readings, and tracking of milk transport, is the subject of a case study in this research paper.The demand for innovative dairy farming research that integrates new technologies is particularly high in Pakistan.Our product is poised to significantly improve and increase both the quality and quantity of milk production.