<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prateek Agarwal on Medium]]></title>
        <description><![CDATA[Stories by Prateek Agarwal on Medium]]></description>
        <link>https://medium.com/@prateekagarwal_37029?source=rss-3be553b6347d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Zow0lLdH7hQxriCSIR6Tyg.jpeg</url>
            <title>Stories by Prateek Agarwal on Medium</title>
            <link>https://medium.com/@prateekagarwal_37029?source=rss-3be553b6347d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:53:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prateekagarwal_37029/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Productivity Tracking in Mining Operations]]></title>
            <link>https://medium.com/@prateekagarwal_37029/productivity-tracking-in-mining-operations-17496c693af7?source=rss-3be553b6347d------2</link>
            <guid isPermaLink="false">https://medium.com/p/17496c693af7</guid>
            <category><![CDATA[mining-industry]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <dc:creator><![CDATA[Prateek Agarwal]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 04:18:51 GMT</pubDate>
            <atom:updated>2025-03-23T04:18:51.882Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVSXRogASDw73ZdPcW2sdg.jpeg" /></figure><h3>Mining Operations</h3><p>The process of extracting valuable minerals and resources from the Earth through various methods.</p><p><strong>Types of Mining</strong></p><ul><li><strong>Surface Mining </strong>— Extracting minerals and ores from the Earth’s surface.<br> — <strong>Quarry Mining </strong>— Open-pit excavation for stones, aggregates, and minerals.<br> — <strong>Rock Mining </strong>— Extraction of solid rock deposits near the surface.</li><li><strong>Underground Mining </strong>— Extracting minerals from deep below the Earth’s surface.</li></ul><h3>Mining Equipment &amp; Operations</h3><ul><li><strong>Loading Sites </strong>— Locations where minerals are loaded onto haul trucks for transport.</li><li><strong>Unloading Sites </strong>— Locations where mined materials are offloaded for processing or storage.</li><li><strong>Haul Trucks </strong>— Transport minerals between dynamic loading and fixed unloading sites.</li><li><strong>Loaders </strong>— Heavy machinery used to scoop and load minerals onto haul trucks.</li></ul><h3>IoT Device Installation &amp; Tracking</h3><p>All haul trucks are installed with sensor tracking devices that stream data from 100+ sensors to our data lake, enabling real-time monitoring and analytics.</p><h3>Stages of a Haul Truck’s Journey</h3><ol><li><strong>Loading </strong>— The loading sites are dynamic and can change locations across days.</li><li><strong>Journey to Unloading Site </strong>— Tracking the haul truck’s journey from loading to unloading.</li><li><strong>Unloading </strong>— The unloading sites have fixed geolocations, allowing automated inference of unloading stops.</li><li><strong>Return Journey to Loading Site </strong>— Tracking the truck’s journey back to the loading site.</li><li><strong>Idling Stops </strong>— Stops at locations other than loading and unloading sites, where the vehicle is deemed idle.</li></ol><h3>Objective</h3><p>We can only optimize what we can measure. The productivity of a mining site is determined by the <strong>total tonnage mined</strong>, while costs are driven by the <strong>fuel consumed to mine it</strong>. By tagging each vehicle’s journey across different operational stages, we can measure key metrics at each phase, identify inefficiencies, and unlock opportunities for optimization.</p><h3>Challenges &amp; Limitations</h3><ul><li><strong>Sparse or Absent Payload Data </strong>— The ideal solution is the payload sensor, which provides real-time weight data, but access to this sensor is not available for some reasons.</li><li><strong>Unreliable Sensor Availability </strong>— Due to variations in OEMs and truck models, different vehicles send different subsets of sensor data.</li><li><strong>Absent Geolocation Data in Underground Mines </strong>— Lack of GPS signals in underground operations prevents spatial tracking, limiting operational insights.</li></ul><h3>Problem Statement</h3><p>Without access to the ground truth and considering the challenges stated above, develop an approach to infer these stages effectively.</p><h3>High Level Approach</h3><ol><li><strong>Generating Labeled Data Without Ground Truth</strong></li></ol><p>In the absence of labeled data, we need a method to approximate labels with high confidence. This could involve clustering sensor patterns, anomaly detection, or rule-based heuristics that align with expected behaviors.</p><p><strong>2. Inferring Stages from Sensor Data</strong></p><p>Any vehicle, when loaded or unloaded, exhibits a change in dynamics before and after the event. This change is reflected in certain sensor readings (e.g., engine load, suspension pressure, speed variations). By analyzing these sensor patterns, we can infer loading and unloading events.</p><p><strong>3. Handling Sparse and Inconsistent Sensor Data</strong></p><p>The more sensors we can use, the more robust the model will be to missing data. If a few sensors are missing, other correlated sensors can help compensate.</p><p><strong>4. Handling Speed Bias</strong></p><ul><li>Sensor readings can vary depending on the truck’s speed, leading to potential misinterpretations.</li><li>To account for this, we compare sensor values pre and post-stop <strong>only when the vehicle is moving at similar speeds</strong>.</li><li>We create speed-normalized sensor features by bucketing sensor readings into speed ranges and adjusting the comparisons accordingly.</li><li>This ensures that differences in sensor values truly reflect loading/unloading events rather than speed-related variations.</li></ul><h3>Model Training</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LkFohJYdYmFabnBF" /><figcaption><em>Diagrammatic Representation of Model Training Approach</em></figcaption></figure><h3>Generating Labeled Data</h3><p>To classify truck operations accurately, we first utilize <strong>speed and RPM sensors</strong> to segregate moving and stopped cycles.</p><p><strong>Key Assumptions &amp; Approach:</strong></p><ul><li><strong>Expected Behavior:</strong> In an ideal scenario, each stop corresponds to either a <strong>loading</strong> or <strong>unloading</strong> event, with zero idling in between.</li><li><strong>Sensor Pattern Analysis:</strong> Loading and unloading events exhibit <strong>inverse patterns</strong> in readings of impacted sensors.</li><li><strong>Pattern-Based Labeling:</strong> We identify <strong>continuous time windows</strong> where the sequence of stopped cycles aligns with expected loading/unloading behavior. If the pattern deviates, we terminate the sequence to maintain data integrity.</li><li><strong>Confidence Threshold:</strong> To ensure reliability, we require <strong>at least three sensors</strong> to show <strong>significant ratio changes</strong> before confirming a loading or unloading event.</li><li><strong>Domain Expertise Integration:</strong> Subject matter experts analyze key sensor ratios, validating whether observed changes correspond to loading or unloading events.</li></ul><p>This structured approach enables <strong>high-confidence labeling</strong>, even in the absence of explicit ground truth data.</p><h3>Feature Engineering</h3><ul><li><strong>Pre-Stop Sensor Means</strong>: The average sensor readings recorded during the moving phase before a stop, after filtering out outliers in the 5th-95th percentile range.</li><li><strong>Post-Stop Sensor Means</strong>: The average sensor readings recorded during the moving phase after a stop, after removing outliers in the 5th-95th percentile range.</li></ul><h3>Training Process</h3><ul><li><strong>Model Choice:</strong> We use an <strong>XGBoost classifier</strong> as the initial model due to its strong performance in handling structured data.</li><li>Separate Loading and Unloading models are trained to enhance prediction accuracy.</li><li><strong>Feature Selection:</strong> The model is initially trained using <strong>all available sensors</strong> to capture a wide range of operational patterns.</li><li><strong>SHAP (SHapley Additive exPlanations)</strong> values are utilized to assess sensor importance, allowing us to retain only the most influential sensors for robust and efficient predictions.</li><li><strong>Truck-Specific Models</strong>: Since sensor behaviors can vary significantly across different trucks, a dedicated model is trained for each truck, ensuring model performance aligns with vehicle-specific characteristics.</li></ul><p>This approach ensures scalability, adaptability, and precision, even when working with heterogeneous sensor data across a fleet of haul trucks.</p><h3>Solution Workflow</h3><h3>Step 1: Model Prediction</h3><p>Once the model is trained, it is applied to each stopped cycle to determine the probability of loading and unloading events.</p><ul><li>A <strong>loading stop</strong> is identified when the model assigns a high loading score and a low unloading score.</li><li>An <strong>unloading stop</strong> is identified when the unloading score is high, and the loading score is low.</li><li>An <strong>idling stop</strong> occurs when both scores are low or similar.</li></ul><p><strong>Measuring Accuracy</strong></p><p>When ground truth is unavailable, how can we assess the accuracy of predictions?</p><p>The reality is — we can’t measure it directly.</p><p>Instead, we leverage our understanding of expected behavior to establish a close proxy. A well-structured sequence should follow a pattern where <strong>Loading and Unloading stops alternate, with Idling stops interspersed in between</strong>.</p><p>Ex. <em>Loading → Moving → Idling → Moving → Idling → Moving → Unloading → Moving → Idling → Moving → Loading → Moving → Unloading ……</em></p><p>To approximate accuracy, we analyze deviations from this expected sequence, identifying inconsistencies.</p><h3>Step 2: Post Processing: Handling Deviations in Expected Sequence</h3><p><strong>Possible Deviations:</strong></p><ul><li><strong>Two consecutive loading stops detected</strong></li></ul><p><strong>Opportunistic Approach:</strong></p><p>To handle this, we attempt to identify potential <strong>alternating patterns</strong> within the sequence window that can restore the broken sequence. We achieve this by utilizing the predicted scores that exceed a relaxed threshold, allowing us to restitch the correct pattern.</p><p><strong>Example:</strong></p><p>Detected sequence:<br>*🚛 <strong><em>Loading → Idling → Idling → Idling → Loading</em></strong></p><p>Fixed sequence:<br>*🚛 <strong><em>Loading → Unloading → Loading → Unloading → Loading</em></strong></p><p>Here, all three <strong>Idling</strong> stops have their respective <strong>inferred state scores</strong> greater than the relaxed threshold, allowing us to infer the missing events and reconstruct the expected sequence.</p><h3>Step 3: Final Step</h3><p>After Step 1, for any remaining unresolved windows, we apply a straightforward rule: <strong>“Always First or Always Last.”</strong> This approach selects the first/last occurrence as the final assignment. This step ensures that we have neat cycles as the end result.</p><p>We log the accuracy after <strong>Step 1 and Step 2</strong> to monitor progress and ensure continuous improvement over time.</p><h3>Future Work</h3><ol><li>Improve the model accuracy by leveraging data from other sources.<br> — For ex: There is sensor data coming from the loaders too. We can do time-series analysis to understand patterns during loading and unloading cycles .</li><li>The approach described above infers the temporal information of the cycles</li><li>Develop models to predict the value of the payload sensor using available sensors</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17496c693af7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Detect Poor Road Conditions in Surface Mining Sites]]></title>
            <link>https://medium.com/@prateekagarwal_37029/how-to-detect-poor-road-conditions-in-surface-mining-sites-c87a584dc544?source=rss-3be553b6347d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c87a584dc544</guid>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[self-organizing-map]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[entropy]]></category>
            <dc:creator><![CDATA[Prateek Agarwal]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 04:18:28 GMT</pubDate>
            <atom:updated>2025-03-23T09:11:14.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkWUl9TjP7KJan_Si9_Wjw.jpeg" /></figure><p>Poor road conditions in surface mining can significantly impact safety, equipment longevity, and overall operational efficiency. Some common issues include:</p><ul><li><strong>Improper grading</strong>: Leads to water pooling, potholes, and erosion.</li><li><strong>Soft spots and ruts</strong>: Cause uneven loading on tires and suspension systems, leading to premature wear and tear.</li><li><strong>Frequent repairs needed</strong>: Increases downtime and operational costs.</li><li><strong>Inefficient haul cycles</strong>: Poor roads slow down production and reduce fuel efficiency.</li><li><strong>Steep inclines and sharp turns</strong>: Increase the risk of rollovers and equipment accidents.</li></ul><p>Therefore, maintaining an acceptable level of efficiency for the entire road network by adopting effective road pavement monitoring and maintenance programs becomes a major challenge.</p><p>The objective of this work is to develop a low-cost and reliable system able to carry out real-time screening of road pavement conditions. The data are acquired with accelerometers mounted on a vehicle, and the data are analyzed by machine learning.</p><h3>Accelerometers Signal</h3><p>Accelerometer data is useful for road pavement monitoring because it captures <strong>vibrations, shocks, and surface irregularities</strong> that indicate road conditions. Here’s why it helps:</p><p>1. Detecting Surface Irregularities</p><ul><li>When a vehicle drives over <strong>potholes, cracks, ruts, or bumps</strong>, the accelerometer detects sudden vertical and horizontal accelerations.</li><li>Larger vibrations indicate <strong>severe damage</strong>, while smaller variations may suggest <strong>surface roughness or early wear</strong>.</li></ul><p>2. Cost-Effective &amp; Scalable</p><ul><li>Traditional pavement assessments rely on <strong>LIDAR, laser profilometers, or high-resolution cameras</strong>, which are expensive.</li><li>Accelerometers are <strong>low-cost sensors</strong> that can be easily deployed on multiple vehicles for large-scale monitoring.</li></ul><h3>Short-Time Fourier Transform (STFT)</h3><p>A <strong>Short-Time Fourier Transform (STFT)</strong> of the accelerometer signal works well for road condition monitoring because it provides a <strong>time-frequency representation</strong> of the signal, helping to analyze how different vibration frequencies change over time. Here’s why STFT is useful.</p><h3>Road Defects Have Distinct Frequency Signatures</h3><p>STFT Solves This Problem by Adding Frequency Information</p><ul><li>Instead of just plotting acceleration vs. time, <strong>STFT transforms the signal into a time-frequency spectrogram</strong>.</li><li>This helps distinguish between:<br> — <strong>Sharp, short bursts of high-frequency energy</strong> → Likely a pothole.<br> — <strong>Longer-lasting, periodic vibrations</strong> → Likely corrugations or rough roads.<br> — <strong>Low-frequency oscillations</strong> → Normal vehicle motion.<br> — More random, broadband frequency content. → Loose gravel</li></ul><h3>Capturing Localized Events (Time-Frequency Analysis)</h3><ul><li>A standard <strong>Fourier Transform (FT)</strong> gives only a <strong>global frequency spectrum</strong>, losing time-related information.</li><li><strong>STFT</strong> applies a <strong>moving window</strong> to analyze the signal in small time segments, preserving time information.</li><li>This allows detection of <strong>transient events</strong> like sudden jolts from potholes, which might otherwise be lost in a full FT.</li></ul><p>For example, a <strong>sharp pothole impact</strong> will appear as a <strong>short burst of high-frequency energy</strong>, while a <strong>washboard road</strong> will show <strong>repeating frequency patterns over time</strong>.</p><h3>Differentiating Road Anomalies from Vehicle Motion</h3><ul><li>Mining trucks have <strong>inherent vibrations</strong> due to engine and suspension movement.</li><li>These background vibrations occur at <strong>consistent, lower frequencies</strong>.</li><li><strong>STFT helps filter out these steady-state vibrations</strong> and isolate high-frequency spikes or irregular patterns caused by actual road issues.</li></ul><h3>Feature Extraction for Machine Learning</h3><ul><li>The <strong>STFT spectrogram</strong> can be used as input for <strong>ML models</strong> to classify road conditions.</li><li>Features like <strong>spectral entropy, peak frequency, and energy distribution</strong> help distinguish between smooth and rough roads.</li></ul><h3>How STFT Provides a Time-Frequency Representation</h3><ul><li>STFT <strong>divides the signal into short time segments</strong> and applies a Fourier Transform to each.</li><li>This results in a <strong>spectrogram</strong>, which is a <strong>2D representation</strong> where:<br> — <strong>X-axis</strong> = Time<br> — <strong>Y-axis</strong> = Frequency<br> — <strong>Color/Intensity</strong> = Energy at that frequency</li></ul><p>An example visualization!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bWERShAjTsp5BHl0" /></figure><ol><li><strong>Acceleration signal over time</strong>: The first plot shows a relatively smooth signal initially. At <strong>6 seconds</strong>, there is a sharp spike due to a pothole impact, followed by a transition to rough terrain at <strong>8 seconds</strong>, where the signal becomes more erratic and higher in frequency.</li><li><strong>STFT (Short-Time Fourier Transform) Spectrogram</strong>: The second plot highlights the frequency content over time. Initially, low frequencies dominate. At <strong>6 seconds</strong>, there’s a brief high-energy event (pothole) across a broad range of frequencies. After <strong>8 seconds</strong>, higher frequency components become more pronounced, indicating rough terrain.</li></ol><h3>Feature Engineering</h3><h3>Spectral Entropy</h3><p>Spectral entropy is a measure of the <strong>disorder or randomness</strong> in the frequency domain of a signal.</p><p><strong>Intuition</strong></p><ul><li>If the signal contains a <strong>single frequency component</strong>, its spectral entropy will be <strong>low</strong> because most of the power is concentrated at one frequency.</li><li>If the signal has a <strong>broad spectrum with many frequency components</strong>, the spectral entropy will be <strong>high</strong>, indicating a more random or complex structure.</li></ul><p><strong>How Spectral Entropy Captures Changes in Road conditions?</strong></p><p>Spectral entropy measures the <strong>distribution of energy</strong> across the frequency spectrum:</p><ul><li><strong>For a smooth road</strong>: The acceleration signal is mostly low-frequency, with <strong>low spectral entropy</strong> because power is concentrated in a few frequency bins.</li><li><strong>For a pothole</strong>: A sudden impact creates a <strong>sharp peak</strong> in the frequency domain, temporarily increasing spectral entropy.</li><li><strong>For rough terrain</strong>: The signal contains a <strong>wider range of frequencies</strong>, leading to <strong>higher spectral entropy</strong> over a longer duration.</li></ul><p><strong>Mathematical Definition</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*kS31_QLp762cBd-h" /></figure><p><strong>Frame</strong>: The total time window that represents the smallest unit for feature computation.</p><p><strong>Segment</strong>: A division of the frame along the time axis (x-axis). The STFT applies the discrete Fourier transform (DFT) to the signal within each segment.</p><p><strong>Block</strong>: A further subdivision along the frequency axis (y-axis), grouping the frequency range into discrete bins within each segment.<br>Each block in this STFT matrix is defined by (p,u) where 0 ≤ p ≤ P−1 and 0 ≤ u ≤U−1, with P representing the number of segments within the acquired frame and U denoting the number of frequency samples within each segment.</p><p>The STFT matrix is divided into submatrices. The energy contained in each submatrix (<em>i</em>, <em>j</em>) is computed as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/0*JUR03ndpSanCa17y" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/0*EizxVpstR0nqQE3Q" /></figure><p>where <em>E</em> ̃<em>i</em>,<em>j</em> is a scaled (normalized) version of <em>Ei</em>,<em>j</em> such that ∑<em>N</em>−1 <em>E</em> ̃<em>i</em>,<em>j</em> = 1 for 0 ≤ <em>i</em> ≤ <em>M</em> − 1.</p><h3>Speed Variation</h3><p>The speed of a vehicle is also aﬀected by the road condition. Two key observations:</p><ol><li><strong>Damaged Roads Reduce Speed</strong> — Vehicles tend to slow down when traveling on roads with larger damaged segments.</li><li><strong>Potholes Cause Sudden Vibrations</strong> — On smoother roads, vehicles traveling at higher speeds experience noticeable vibrations when encountering potholes or small damaged segments.</li></ol><p>These insights highlight how <strong>speed variation</strong> can be a useful parameter for <strong>road categorization</strong>, helping identify road quality based on vehicle movement patterns.</p><p>Illustration of the above features for a time frame of a particular trip:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1z9OCqZn0S9qyD80" /></figure><p>The above diagram shows the block energy aggregated from the SFTP diagram over it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0UtRoDsZlrDQq6Lm" /></figure><h4>Other Key Sensors for this System</h4><ul><li><strong>GPS Sensors</strong> to map detected anomalies to specific locations.<br> — By combining accelerometer readings with <strong>GPS coordinates</strong>, the system can generate a <strong>real-time road quality map</strong>.</li></ul><h3>Model Selection</h3><ol><li>Since there is no labeled data available to indicate the actual condition of the mining road, an unsupervised approach is necessary.</li><li>This involves applying a combination of the Self-Organizing Map (SOM) and <em>k</em>-means clustering algorithms to features extracted from GPS and accelerometer data for road condition monitoring.</li><li>The SOM algorithm differentiates between damaged and non-damaged road segments, while the <em>k</em>-means algorithm further classifies the roughness levels of the non-damaged road segments.</li></ol><h3>SOM Modelling</h3><ul><li>We used the network of 5×5 neurons for small mining areas and 10x10 neurons for larger mining areas.</li><li>We analyze the codebook, distance, and hit count matrices of SOM networks trained on trip data. Neurons linked to damaged road segments exhibit high distances from their neighbors and have significantly lower hit counts due to the lower proportion of damaged segments​ in the overall stretch. These segments can be efficiently identified using a distance or hit count threshold.</li><li>The codebook matrix (CC) is split into two parts: Cd for damaged road segments and Cd′ for other segments. Similarly, the distance (D) and hit count (H) matrices are divided. No further processing is done for damaged segments (Cd,Dd,Hd), but the non-damaged segments (Cd′,Dd′,Hd′) undergo k-means clustering (in the next section) to classify road roughness levels (smooth, moderate, high).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a7nPTTtSrGO1lXZ8" /></figure><h3>K-Means Clustering</h3><p>The non-damaged segments from SOM (Cd′,Dd′,Hd′) undergo k-means clustering to classify road roughness levels — smooth (green), moderate (yellow), high (orange). The damaged road segments inferred from SOM are labelled as red.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*9m3AAR8Jj76l810T" /></figure><h3>Geo-Coordinate Tagging &amp; Patches</h3><ol><li>The next step involves mapping each sample from the Feature Data to its corresponding temporal cluster and also associating it with the vehicle’s GPS coordinates during that time window.</li><li>To streamline computations, geo-coordinates are converted into geohashes. We then perform a frequency count of each geohash’s occurrence within a cluster and use a color-coding heuristic based on these counts to assign a final color to each geohash.</li><li>Finally, DBSCAN is applied to geohashes of the same color to identify continuous sequences of geohashes thereby creating bigger road patches.</li><li>Each identified road patch is assigned a unique identifier and stored in our database. This ensures that when the algorithm runs daily, it can first check for existing patches that closely overlap with newly detected ones and reuse them instead of creating duplicates.</li></ol><h3>Final Result: Road Quality Heat Map</h3><p>The images below illustrate examples of how we visualize the patches on maps. To maintain clarity and focus, we exclude smooth patches (green ones) from visualization, as our primary objective is to highlight rough patches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-dQO2YTOdlAdXi5W" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/0*i6uiqiEO7YZ-lGyG" /></figure><h3><strong>Future Work</strong></h3><ul><li>Collect feedback from the mining areas to measure the accuracy of the results.</li><li>Explore other techniques to improve the accuracy.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c87a584dc544" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shopping made Quick and Easy with a LLM-Powered ChatBot Assistant]]></title>
            <link>https://medium.com/@prateekagarwal_37029/shopping-made-quick-and-easy-with-a-llm-powered-chatbot-assistant-2e439751ca8d?source=rss-3be553b6347d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e439751ca8d</guid>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Prateek Agarwal]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 17:17:32 GMT</pubDate>
            <atom:updated>2025-03-23T09:11:41.341Z</atom:updated>
            <content:encoded><![CDATA[<p>This demo showcases an AI-powered chatbot designed to help users discover mobile phones based on their preferences. The chatbot is integrated with a mobile discovery platform and provides users with personalized recommendations, comparisons, and detailed mobile specifications.</p><h3>Core Functionalities</h3><p>The chatbot assists users in three primary areas:</p><ol><li><strong>Mobile Recommendations</strong>: Users can express their subjective and objective preferences, and the chatbot dynamically suggests phones that match their needs.</li><li><strong>Mobile Comparisons</strong>: Once users shortlist a few phones, the chatbot provides a detailed comparison to aid informed decision-making.</li><li><strong>Mobile Details</strong>: Users can request comprehensive specifications and insights about any mobile device.</li></ol><h3>High Level Flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPUU6FXKzzS7bdSMSvyCWg.png" /></figure><h3>FULL DEMO VIDEO</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnNii_YFMjM4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnNii_YFMjM4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnNii_YFMjM4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca2ee5a5151f947ff3f8479e21f94396/href">https://medium.com/media/ca2ee5a5151f947ff3f8479e21f94396/href</a></iframe><h3>DEMO BREAKDOWN</h3><h3>Starting the conversation</h3><ul><li>The user initiates the conversation by specifying a preference (e.g., “I love making reels. Suggest me some phones.”)</li><li>The chatbot intelligently infers that features like <em>4K recording and high-resolution cameras</em> are essential and sorts phones based on camera scores.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FbEXbzgL6Kgs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbEXbzgL6Kgs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FbEXbzgL6Kgs%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c751db32306531077eeba8db959cfc00/href">https://medium.com/media/c751db32306531077eeba8db959cfc00/href</a></iframe><h3>Explore More recommendations</h3><ul><li>The user can request additional suggestions using “Show more.”</li><li>Embedded pagination allows seamless browsing within the chat context.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQhQKZamwFdo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQhQKZamwFdo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQhQKZamwFdo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1b380560e94f73ca67e502f4a4717f8/href">https://medium.com/media/e1b380560e94f73ca67e502f4a4717f8/href</a></iframe><h3>Incrementally Adding Filters</h3><ul><li>The user specifies a <em>budget range</em> (e.g., 40K to 60K), and the chatbot adjusts recommendations accordingly.</li><li>Sorting preferences can be modified (e.g., switching from camera score to popularity-based rankings).</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUZIYdQFZgFI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUZIYdQFZgFI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUZIYdQFZgFI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cf88194d2c6170b3e42e03231189856/href">https://medium.com/media/6cf88194d2c6170b3e42e03231189856/href</a></iframe><h3>Updating existing filters</h3><ul><li>Existing Preferences can be modified (e.g., switching from camera score to popularity-based rankings).</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSQn4V98gDl4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSQn4V98gDl4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSQn4V98gDl4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c384617aba809b317dd909cfecb2dcc/href">https://medium.com/media/6c384617aba809b317dd909cfecb2dcc/href</a></iframe><h3>Product Detailed Comparison</h3><ul><li>The user requests a side-by-side comparison of shortlisted phones.</li><li>The chatbot presents a structured table with detailed specifications for each phone.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F1a5IW4LVUwQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1a5IW4LVUwQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1a5IW4LVUwQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dcac1ba2ca8e7b020a61fed39ccd4b38/href">https://medium.com/media/dcac1ba2ca8e7b020a61fed39ccd4b38/href</a></iframe><h3>Refining Search Based on Additional Requirements</h3><ul><li>The user mentions they receive a lot of calls.</li><li>The chatbot automatically adds <em>battery life and dual SIM support</em> as new preferences and re-ranks recommendations.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEEFTObNJ6wY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEEFTObNJ6wY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FEEFTObNJ6wY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0190c4b9ba6b46431a40c1999753ff0/href">https://medium.com/media/d0190c4b9ba6b46431a40c1999753ff0/href</a></iframe><h3>Deep Dive Into Specific Features</h3><ul><li>The user requests detailed information about the <em>screen and camera</em> of selected phones.</li><li>The chatbot provides in-depth insights along with links to expert reviews.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZpV2D9z4qcE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZpV2D9z4qcE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZpV2D9z4qcE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1724dbdaebbad4f13a282385fcf713f3/href">https://medium.com/media/1724dbdaebbad4f13a282385fcf713f3/href</a></iframe><h3>Guidance on Features for Specific Use Cases</h3><ul><li>The user asks, “Which features should I look for if I love watching OTT?”</li><li>The chatbot suggests necessary specifications like high-resolution displays, storage capacity, large screens, and strong battery life.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_7Fk4pVVMtY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_7Fk4pVVMtY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_7Fk4pVVMtY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c52e60cedf27fa7cc817923dd344d24/href">https://medium.com/media/3c52e60cedf27fa7cc817923dd344d24/href</a></iframe><h3>Handling Irrelevant Queries</h3><ul><li>The chatbot gracefully handles off-topic requests (e.g., “Tell me some nice places to eat”).</li><li>However, it creatively engages with relevant pop culture references (e.g., “Which phones do you think Iron Man would like?”).</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjOUkO4cX1Bo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjOUkO4cX1Bo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjOUkO4cX1Bo%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/33f38af98b8bb011109cd95fe268d174/href">https://medium.com/media/33f38af98b8bb011109cd95fe268d174/href</a></iframe><h3>Conclusion</h3><p>The Mobile Assistant Chatbot successfully interprets user preferences and dynamically refines recommendations, making mobile discovery highly interactive and intuitive. It efficiently handles comparisons, deep dives, and even creative queries, demonstrating its robustness as a personalized shopping assistant.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e439751ca8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Small Talk to Deep Bonds: The Chatbot That Truly Knows You]]></title>
            <link>https://medium.com/@prateekagarwal_37029/from-small-talk-to-deep-bonds-the-chatbot-that-truly-knows-you-dbb3604e600a?source=rss-3be553b6347d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbb3604e600a</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Prateek Agarwal]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 17:06:19 GMT</pubDate>
            <atom:updated>2025-03-23T09:12:07.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gJudWYdAqwUeFlfV" /></figure><p>The more you talk to someone, the better they get to know you, your background, personality, hobbies likes, dislikes, your behavior. And within a few conversations, the connection deepens and new friendship begins to blossom. This boat aspires to achieve the same. Its knowledge is not limited by the current active conversation. Throughout interactions, it captures noteworthy details about the user. We call them memos short for memories. These memos are then contextually retrieved to enrich on ongoing conversations, fostering a deeper sense of connection where users feel genuinely understood and valued by the chatbot.</p><h3>HIGH LEVEL FLOW</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3ckVTMHypssEUnbm7PVeg.png" /></figure><h3>DEMO VIDEO</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3LSzryyzHIU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3LSzryyzHIU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3LSzryyzHIU%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a495e20998e06fca08662b47de6133b/href">https://medium.com/media/9a495e20998e06fca08662b47de6133b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbb3604e600a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boost Your Social Media Ad Efficiency with Algorithm Optimization]]></title>
            <link>https://medium.com/@prateekagarwal_37029/boost-your-social-media-ad-efficiency-with-algorithm-optimization-c940784ec2b9?source=rss-3be553b6347d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c940784ec2b9</guid>
            <dc:creator><![CDATA[Prateek Agarwal]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 06:32:42 GMT</pubDate>
            <atom:updated>2025-03-21T06:32:42.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DGYfFaji_JA9Z24BlCX9Q.jpeg" /></figure><p>Managing an advertising budget efficiently is crucial for maximizing ROI. Algorithms help automate and optimize ad spend allocation, ensuring the best possible results. This approach relies on structured recipes, which define optimization strategies tailored to different campaign objectives.</p><h3>Why Not AI Models?</h3><p>AI models can be powerful for ad optimization, but they come with significant drawbacks:</p><ol><li><strong>Cold Start Problem</strong> — AI models require large amounts of historical data to learn patterns. New campaigns or small businesses may not have enough data for accurate predictions.</li><li><strong>They Are a Black Box</strong> — AI decision-making is often opaque. Marketers may struggle to understand why budgets shift, making troubleshooting difficult.</li><li><strong>Slow Adaptation</strong> — Machine learning models may take time to adjust to sudden changes in consumer behavior, whereas rule-based recipes can be tweaked instantly.</li><li><strong>Overfitting Risks</strong> — AI can overfit to historical trends, failing to adapt to new audience behaviors or campaign strategies.</li><li><strong>Dependency on Platform-Specific AI Systems</strong>- Platforms like Google Ads and Meta Ads provide AI-driven budget optimization, but these systems work as “black boxes” and prioritize their own ad ecosystem’s revenue. Businesses have limited control over how these algorithms allocate spend.</li><li><strong>High Computational Costs</strong> — Training and running AI models require significant computational resources. Cloud-based AI optimization tools can be expensive, making them less viable for businesses with tight advertising budgets.</li></ol><p>These drawbacks highlight why structured recipes offer a more transparent, cost-effective, faster and adaptable approach to ad budget management compared to full AI-driven automation.</p><h3>Basic Idea of a Recipe</h3><p>The core principle of a recipe is to create <strong>structured</strong>, <strong>rule</strong>-<strong>based</strong> <strong>automation</strong> for ad spend management. Unlike AI models that rely on training data and probabilistic decision-making, recipes use <strong>deterministic</strong> logic.</p><h3>Recipe</h3><p>A recipe in advertising optimization is a structured set of rules and heuristics that determine how budgets should be allocated across campaigns. Unlike AI models, which require vast amounts of historical data and function as black boxes, recipes are transparent, deterministic, and adaptable.</p><p>A typical recipe consists of:</p><ol><li><strong>Inputs</strong>: Key metrics like CPC (Cost Per Click), CTR (Click-Through Rate), Conversion Rate, and ROAS (Return on Ad Spend).</li><li><strong>Logic</strong>: If-then rules for budget adjustments.</li><li><strong>Outputs</strong>: Budget recommendations or automated adjustments to ad spend.</li></ol><p>Recipes are lightweight, fast, and easier to interpret than machine learning models.</p><h3>Campaign Tags</h3><p>To apply optimization recipes effectively, campaigns need to be categorized based on their goals and audience targeting. Common campaign tags include:</p><ul><li><strong>TOF (Top of Funnel)</strong>: Brand awareness, reach campaigns, cold audience targeting.</li><li><strong>MOF (Middle of Funnel)</strong>: Engagement, retargeting users who interacted but haven’t converted.</li><li><strong>BOF (Bottom of Funnel)</strong>: Conversion-focused campaigns targeting high-intent users.</li></ul><p>Tags allow the system to apply different optimization strategies based on the campaign’s position in the customer journey</p><h3>Separate Recipes for TOF, MOF, BOF</h3><p>Each campaign type requires a different approach:</p><ol><li><strong>TOF (Top of Funnel)</strong> — Maximize reach and awareness at the lowest CPM</li><li><strong>MOF (Middle of Funnel)</strong> — Improve engagement and move users toward conversion.</li><li><strong>BOF (Bottom of Funnel)</strong> — Maximize conversions at the best possible ROAS.</li></ol><p>These separate recipes ensure that each campaign type gets the right level of optimization without overspending.</p><p>To further enhance efficiency, we can segment each funnel stage into <strong>batches</strong> based on factors such as audience segments, ad creatives, or geographic regions. This allows us to apply more <strong>granular recipes</strong> within each level, ensuring even finer budget control and performance improvements.</p><h3>Daily Modes</h3><p>Each recipe optimizes for a <strong>target metric</strong>, such as <strong>ROAS</strong> (Return on Ad Spend) within an expected range (e.g., 2 to 4). Based on real-time performance, the recipe determines the appropriate mode for the current day:</p><ol><li><strong>Stable Mode (Meeting Targets)</strong> —<strong> If metric is within the expected range</strong>, the system continues operating normally, maintaining current budget allocations.</li><li><strong>Aggressive Mode (Exceeding Targets)</strong> — <strong>If metric is higher than expected</strong>, it indicates more revenue than anticipated. The system tried to capitalize on momentum and allocates more budget to well-performing campaigns.</li><li><strong>Defensive Mode (Below Targets)</strong> — <strong>If metric is below the target</strong>, the focus shifts to minimizing losses. The system reduces spending on underperforming campaigns, and increasing budget on over-performing campaigns only if any.</li></ol><p>For added flexibility, these modes can be <strong>manually overridden</strong> when needed, allowing for adjustments based on external factors or business priorities.</p><h3>Guard Rails on Budget Limits</h3><p>Since automated algorithms control ad spend, guard rails help prevent budget waste due to anomalies or misconfigurations. These safeguards ensure spending remains efficient, controlled, and aligned with business goals.</p><h4>Key Guard Rails:</h4><ol><li><strong>Recipe-Level Daily Budget Caps</strong></li></ol><ul><li>Configured dynamically based on the daily mode (Stable, Aggressive, Defensive) to allow adaptive flexibility while maintaining control.</li></ul><p>2. <strong>Campaign-Level Spend Limits</strong></p><ul><li>Prevents any single campaign from consuming a disproportionate share of the budget.</li></ul><h3>Campaign Grading</h3><p>Campaign grading helps assess and categorize campaigns based on performance. It works as follows:</p><ol><li><strong>Aggregated Historical Data</strong> — Each campaign is scored using aggregated historical performance data.</li><li><strong>Configurable Metrics &amp; Time Windows</strong> — Different metrics (e.g., ROAS, CTR, CPC) and time windows can be customized for each campaign type to ensure relevant grading.</li><li><strong>Categorization</strong> — Based on the score and the campaign’s mode for the day, campaigns are classified into four categories: <strong>Best | Good | Average | Worst</strong></li></ol><p><strong>Manual Overrides </strong>— Users can manually override the system-generated scores when needed, providing flexibility in campaign management.</p><h3>Core Heuristics in Each Recipe</h3><p>Each recipe operates based on four key heuristics to dynamically manage campaigns:</p><h3>Scale-Up 🚀</h3><ul><li>Triggered when key metrics (e.g., ROAS, CTR, Conversions) exceed predefined thresholds.</li><li>Follows rate limits to prevent excessive or rapid budget increases.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UG3STLNtDjhVFi64_cWG9g.png" /></figure><h3>Sunsetting 🌅</h3><ul><li>Gradually reduces the budget for declining campaigns.</li><li>Helps phase out underperforming campaigning instead of stopping them abruptly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9lbLTE4ix3fP0v7gNm9uw.png" /></figure><h3>Stop Loss 🛑</h3><ul><li>Enforces stricter conditions than sunsetting to reduce budget or pause campaigns</li><li>Acts as a safety net to cut losses quickly and avoid wasted spend.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtixYP7hmQFW595QkbzNyQ.png" /></figure><h3>Revive 🔄</h3><ul><li>Re-evaluates paused campaigns to check if they can be resumed if conditions have improved due to late attribution.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7otLYzB0AaMvS1GjdSWtpg.png" /></figure><h3>Budget Adjustments</h3><p>The magnitude of budget increases or decreases for each heuristic is configured based on:</p><ol><li><strong>Campaign Grade</strong> — Higher-performing campaigns receive more aggressive budget increases, while lower-performing ones scale conservatively but receive more aggressive budget cuts.</li><li><strong>Deviation from Target Metric</strong> — The farther a campaign deviates from the target metric (e.g., ROAS, CTR, Conversions), the stronger the adjustment.</li></ol><p>These heuristics work together to maximize efficiency, minimize waste, and adapt budgets dynamically based on real-time performance.</p><h3>Simple but Effective Strategy to Enable Daily Modes</h3><p>The algorithm <strong>dynamically adjusts campaign grading</strong> to enable different daily modes. By modifying the grading strategy, it influences how budget adjustments are applied:</p><ul><li><strong>Default Mode </strong>— Maintains a <strong>balanced</strong> distribution across all four grades (Best, Good, Average, Worst).</li><li><strong>Aggressive Mode</strong> — No campaigns are classified as ‘Worst’, and <strong>more campaigns are graded as ‘Best’,</strong> leading to <strong>larger budget increases</strong> across a wider set of campaigns.</li><li><strong>Defensive Mode</strong> — No campaigns are classified as ‘Best’, and <strong>more campaigns are graded as ‘Worst’,</strong> resulting in <strong>stronger budget cuts</strong> and a more conservative approach to spending.</li></ul><p>By leveraging this grading shift, the system automatically adapts budget allocation without requiring complex rule-based overrides, making it a simple yet highly effective strategy for daily mode adjustments.</p><h3>Conclusion</h3><p>Optimizing ad spend with <strong>algorithmic budget management</strong> ensures that every dollar is used efficiently while dynamically adapting to campaign performance. By implementing <strong>structured recipes, campaign grading, daily modes, and core heuristics (Scale-Up, Sunsetting, Stop Loss, and Revive)</strong>, advertisers can maximize return on ad spend (ROAS) while minimizing risk.</p><p>The approach balances <strong>automation with control</strong>, offering flexibility through <strong>manual overrides and guardrails</strong> to handle unexpected anomalies. Additionally, the <strong>daily mode hack</strong> simplifies decision-making by dynamically adjusting campaign grading, ensuring a seamless shift between <strong>aggressive, stable, and defensive</strong> strategies.</p><p>Ultimately, this system <strong>removes guesswork</strong>, making ad budgeting more <strong>data-driven, adaptable, and effective</strong> — leading to better performance, lower waste, and sustained growth in advertising campaigns. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c940784ec2b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>