Friday, April 17, 2026
banner
Top Selling Multipurpose WP Theme

It is a visitor submit written by Axfood AB. 

On this submit, we share how Axfood, a big Swedish meals retailer, improved operations and scalability of their current synthetic intelligence (AI) and machine studying (ML) operations by prototyping in shut collaboration with AWS consultants and utilizing Amazon SageMaker.

Axfood is Sweden’s second largest meals retailer, with over 13,000 staff and greater than 300 shops. Axfood has a construction with a number of decentralized knowledge science groups with totally different areas of duty. Along with a central knowledge platform workforce, the info science groups carry innovation and digital transformation by means of AI and ML options to the group. Axfood has been utilizing Amazon SageMaker to domesticate their knowledge utilizing ML and has had fashions in manufacturing for a few years. These days, the extent of sophistication and the sheer variety of fashions in manufacturing is rising exponentially. Nevertheless, though the tempo of innovation is excessive, the totally different groups had developed their very own methods of working and had been seeking a brand new MLOps finest follow.

Our problem

To remain aggressive by way of cloud providers and AI/ML, Axfood selected to companion with AWS and has been collaborating with them for a few years.

Throughout one in every of our recurring brainstorming periods with AWS, we had been discussing find out how to finest collaborate throughout groups to extend the tempo of innovation and effectivity of information science and ML practitioners. We determined to place in a joint effort to construct a prototype on a finest follow for MLOps. The goal of the prototype was to construct a mannequin template for all knowledge science groups to construct scalable and environment friendly ML fashions—the inspiration to a brand new era of AI and ML platforms for Axfood. The template ought to bridge and mix finest practices from AWS ML consultants and company-specific finest follow fashions—the very best of each worlds.

We determined to construct a prototype from one of many at present most developed ML fashions inside Axfood: forecasting gross sales in shops. Extra particularly, the forecast for vegetables and fruit of upcoming campaigns for meals retail shops. Correct day by day forecasting helps the ordering course of for the shops, rising sustainability by minimizing meals waste because of optimizing gross sales by precisely predicting the wanted in-store inventory ranges. This was the right place to start out for our prototype—not solely would Axfood acquire a brand new AI/ML platform, however we might additionally get an opportunity to benchmark our ML capabilities and be taught from main AWS consultants.

Our answer: A brand new ML template on Amazon SageMaker Studio

Constructing a full ML pipeline that’s designed for an precise enterprise case could be difficult. On this case, we’re growing a forecasting mannequin, so there are two important steps to finish:

  1. Prepare the mannequin to make predictions utilizing historic knowledge.
  2. Apply the educated mannequin to make predictions of future occasions.

In Axfood’s case, a well-functioning pipeline for this goal was already arrange utilizing SageMaker notebooks and orchestrated by the third-party workflow administration platform Airflow. Nevertheless, there are numerous clear advantages of modernizing our ML platform and shifting to Amazon SageMaker Studio and Amazon SageMaker Pipelines. Shifting to SageMaker Studio offers many predefined out-of-the-box options:

  • Monitoring mannequin and knowledge high quality in addition to mannequin explainability
  • Constructed-in built-in improvement surroundings (IDE) instruments corresponding to debugging
  • Price/efficiency monitoring
  • Mannequin acceptance framework
  • Mannequin registry

Nevertheless, a very powerful incentive for Axfood is the power to create customized mission templates utilizing Amazon SageMaker Initiatives for use as a blueprint for all knowledge science groups and ML practitioners. The Axfood workforce already had a strong and mature degree of ML modeling, so the primary focus was on constructing the brand new structure.

Answer overview

Axfood’s proposed new ML framework is structured round two important pipelines: the mannequin construct pipeline and the batch inference pipeline:

  • These pipelines are versioned inside two separate Git repositories: one construct repository and one deploy (inference) repository. Collectively, they type a strong pipeline for forecasting vegetables and fruit.
  • The pipelines are packaged right into a customized mission template utilizing SageMaker Initiatives in integration with a third-party Git repository (Bitbucket) and Bitbucket pipelines for steady integration and steady deployment (CI/CD) parts.
  • The SageMaker mission template contains seed code corresponding to every step of the construct and deploy pipelines (we focus on these steps in additional element later on this submit) in addition to the pipeline definition—the recipe for the way the steps must be run.
  • Automation of constructing new initiatives primarily based on the template is streamlined by means of AWS Service Catalog, the place a portfolio is created, serving as an abstraction for a number of merchandise.
  • Every product interprets into an AWS CloudFormation template, which is deployed when a knowledge scientist creates a brand new SageMaker mission with our MLOps blueprint as the inspiration. This prompts an AWS Lambda operate that creates a Bitbucket mission with two repositories—mannequin construct and mannequin deploy—containing the seed code.

The next diagram illustrates the answer structure. Workflow A depicts the intricate movement between the 2 mannequin pipelines—construct and inference. Workflow B reveals the movement to create a brand new ML mission.

Mannequin construct pipeline

The mannequin construct pipeline orchestrates the mannequin’s lifecycle, starting from preprocessing, shifting by means of coaching, and culminating in being registered within the mannequin registry:

  • Preprocessing – Right here, the SageMaker ScriptProcessor class is employed for function engineering, ensuing within the dataset the mannequin shall be educated on.
  • Coaching and batch remodel – Customized coaching and inference containers from SageMaker are harnessed to coach the mannequin on historic knowledge and create predictions on the analysis knowledge utilizing a SageMaker Estimator and Transformer for the respective duties.
  • Analysis – The educated mannequin undergoes analysis by evaluating the generated predictions on the analysis knowledge to the bottom fact utilizing ScriptProcessor.
  • Baseline jobs – The pipeline creates baselines primarily based on statistics within the enter knowledge. These are important for monitoring knowledge and mannequin high quality, in addition to function attributions.
  • Mannequin registry – The educated mannequin is registered for future use. The mannequin shall be accredited by designated knowledge scientists to deploy the mannequin to be used in manufacturing.

For manufacturing environments, knowledge ingestion and set off mechanisms are managed through a main Airflow orchestration. In the meantime, throughout improvement, the pipeline is activated every time a brand new commit is launched to the mannequin construct Bitbucket repository. The next determine visualizes the mannequin construct pipeline.

Batch inference pipeline

The batch inference pipeline handles the inference part, which consists of the next steps:

  • Preprocessing – Information is preprocessed utilizing ScriptProcessor.
  • Batch remodel – The mannequin makes use of the customized inference container with a SageMaker Transformer and generates predictions given the enter preprocessed knowledge. The mannequin used is the newest accredited educated mannequin within the mannequin registry.
  • Postprocessing – The predictions bear a collection of postprocessing steps utilizing ScriptProcessor.
  • Monitoring – Steady surveillance completes checks for drifts associated to knowledge high quality, mannequin high quality, and have attribution.

If discrepancies come up, a enterprise logic inside the postprocessing script assesses whether or not retraining the mannequin is critical. The pipeline is scheduled to run at common intervals.

The next diagram illustrates the batch inference pipeline. Workflow A corresponds to preprocessing, knowledge high quality and have attribution drift checks, inference, and postprocessing. Workflow B corresponds to mannequin high quality drift checks. These pipelines are divided as a result of the mannequin high quality drift examine will solely run if new floor fact knowledge is on the market.

SageMaker Mannequin Monitor

With Amazon SageMaker Mannequin Monitor built-in, the pipelines profit from real-time monitoring on the next:

  • Information high quality – Displays any drift or inconsistencies in knowledge
  • Mannequin high quality – Watches for any fluctuations in mannequin efficiency
  • Characteristic attribution – Checks for drift in function attributions

Monitoring mannequin high quality requires entry to floor fact knowledge. Though acquiring floor fact could be difficult at instances, utilizing knowledge or function attribution drift monitoring serves as a reliable proxy to mannequin high quality.

Particularly, within the case of information high quality drift, the system watches out for the next:

  • Idea drift – This pertains to modifications within the correlation between enter and output, requiring floor fact
  • Covariate shift – Right here, the emphasis is on alterations within the distribution of impartial enter variables

SageMaker Mannequin Monitor’s knowledge drift performance meticulously captures and scrutinizes the enter knowledge, deploying guidelines and statistical checks. Alerts are raised at any time when anomalies are detected.

In parallel to utilizing knowledge high quality drift checks as a proxy for monitoring mannequin degradation, the system additionally screens function attribution drift utilizing the normalized discounted cumulative acquire (NDCG) rating. This rating is delicate to each modifications in function attribution rating order in addition to to the uncooked attribution scores of options. By monitoring drift in attribution for particular person options and their relative significance, it’s easy to identify degradation in mannequin high quality.

Mannequin explainability

Mannequin explainability is a pivotal a part of ML deployments, as a result of it ensures transparency in predictions. For an in depth understanding, we use Amazon SageMaker Make clear.

It gives each world and native mannequin explanations by means of a model-agnostic function attribution approach primarily based on the Shapley worth idea. That is used to decode why a specific prediction was made throughout inference. Such explanations, that are inherently contrastive, can differ primarily based on totally different baselines. SageMaker Make clear aids in figuring out this baseline utilizing Okay-means or Okay-prototypes within the enter dataset, which is then added to the mannequin construct pipeline. This performance permits us to construct generative AI functions sooner or later for elevated understanding of how the mannequin works.

Industrialization: From prototype to manufacturing

The MLOps mission features a excessive diploma of automation and may function a blueprint for related use instances:

  • The infrastructure could be reused fully, whereas the seed code could be tailored for every process, with most modifications restricted to the pipeline definition and the enterprise logic for preprocessing, coaching, inference, and postprocessing.
  • The coaching and inference scripts are hosted utilizing SageMaker customized containers, so a wide range of fashions could be accommodated with out modifications to the info and mannequin monitoring or mannequin explainability steps, so long as the info is in tabular format.

After ending the work on the prototype, we turned to how we should always use it in manufacturing. To take action, we felt the necessity to make some further changes to the MLOps template:

  • The unique seed code used within the prototype for the template included preprocessing and postprocessing steps run earlier than and after the core ML steps (coaching and inference). Nevertheless, when scaling up to make use of the template for a number of use instances in manufacturing, the built-in preprocessing and postprocessing steps might result in decreased generality and copy of code.
  • To enhance generality and reduce repetitive code, we selected to slim down the pipelines even additional. As a substitute of operating the preprocessing and postprocessing steps as a part of the ML pipeline, we run these as a part of the first Airflow orchestration earlier than and after triggering the ML pipeline.
  • This fashion, use case-specific processing duties are abstracted from the template, and what’s left is a core ML pipeline performing duties which might be normal throughout a number of use instances with minimal repetition of code. Parameters that differ between use instances are equipped as enter to the ML pipeline from the first Airflow orchestration.

The consequence: A fast & environment friendly method to mannequin construct & deployment

The prototype in collaboration with AWS has resulted in an MLOps template following present finest practices that’s now obtainable to be used to all of Axfood’s knowledge science groups. By creating a brand new SageMaker mission inside SageMaker Studio, knowledge scientists can get began on new ML initiatives shortly and seamlessly transition to manufacturing, permitting for extra environment friendly time administration. That is made doable by automating tedious, repetitive MLOps duties as a part of the template.

Moreover, a number of new functionalities have been added in an automatic trend to our ML setup. These positive factors embody:

  • Mannequin monitoring – We are able to carry out drift checks for mannequin and knowledge high quality in addition to mannequin explainability
  • Mannequin and knowledge lineage – It’s now doable to hint precisely which knowledge has been used for which mannequin
  • Mannequin registry – This helps us catalog fashions for manufacturing and handle mannequin variations

Conclusion

On this submit, we mentioned how Axfood improved operations and scalability of our current AI and ML operations in collaboration with AWS consultants and by utilizing SageMaker and its associated merchandise.

These enhancements will assist Axfood’s knowledge science groups constructing ML workflows in a extra standardized approach and can drastically simplify evaluation and monitoring of fashions in manufacturing—making certain the standard of ML fashions constructed and maintained by our groups.

Please depart any suggestions or questions within the feedback part.


In regards to the Authors

Dr. Björn Blomqvist is the Head of AI Technique at Axfood AB. Earlier than becoming a member of Axfood AB he led a workforce of Information Scientists at Dagab, part of Axfood, constructing revolutionary machine studying options with the mission to offer good and sustainable meals to folks throughout Sweden. Born and raised within the north of Sweden, in his spare time Björn ventures to snowy mountains and open seas.

Oskar Klang is a Senior Information Scientist on the analytics division at Dagab, the place he enjoys working with every thing analytics and machine studying, e.g. optimizing provide chain operations, constructing forecasting fashions and, extra just lately, GenAI functions. He’s dedicated to constructing extra streamlined machine studying pipelines, enhancing effectivity and scalability.

Pavel Maslov is a Senior DevOps and ML engineer within the Analytic Platforms workforce. Pavel has in depth expertise within the improvement of frameworks, infrastructure, and instruments within the domains of DevOps and ML/AI on the AWS platform. Pavel has been one of many key gamers in constructing the foundational functionality inside ML at Axfood.

Joakim Berg is the Staff Lead and Product Proprietor Analytic Platforms, primarily based in Stockholm Sweden. He’s main a workforce of Information Platform finish DevOps/MLOps engineers offering Information and ML platforms for the Information Science groups. Joakim has a few years of expertise main senior improvement and structure groups from totally different industries.

banner
Top Selling Multipurpose WP Theme

Converter

Top Selling Multipurpose WP Theme

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

banner
Top Selling Multipurpose WP Theme

Leave a Comment

banner
Top Selling Multipurpose WP Theme

Latest

Best selling

22000,00 $
16000,00 $
6500,00 $
900000,00 $

Top rated

6500,00 $
22000,00 $
900000,00 $

Products

Knowledge Unleashed
Knowledge Unleashed

Welcome to Ivugangingo!

At Ivugangingo, we're passionate about delivering insightful content that empowers and informs our readers across a spectrum of crucial topics. Whether you're delving into the world of insurance, navigating the complexities of cryptocurrency, or seeking wellness tips in health and fitness, we've got you covered.