A computer-implemented method, the method comprising: obtaining a first image depicting at least a foreground item; subsampling the first image to a first level image of a multiscale transform; performing based on a machine learning model, an identification of a foreground portion of the first level image and a background portion of the first level image; generating based on the identification of the foreground portion and the background portion, a first mask; upscaling the first mask to a resolution corresponding to the first image depicting the foreground item; applying the upscaled first mask to the first image to form a second image, the second image depicting the foreground item with at least a portion of the background portion of the second image removed; and providing the second image depicting the foreground item to a publication system; wherein the performing comprises: automatically assigning a first border of pixels with a predefined width around edges of the first level image to initialize the machine learning model to classify the first border of pixels as solid background, wherein the first border of pixels comprises a set quantity of pixels around the edges of the first level image and the set quantity of pixels provides an initial state of the machine learning model to enable classification of one or more pixels of the first level image as solid background, likely background, solid foreground, or likely foreground, and classifying pixels of the first level image as likely the foreground portion or likely the background portion, based on the machine learning model and the assigned first border of pixels as the solid background; and wherein the first mask is generated based on the classified pixels. obtaining a first image depicting at least a foreground item; subsampling the first image to a first level image of a multiscale transform; performing based on a machine learning model, an identification of a foreground portion of the first level image and a background portion of the first level image; generating based on the identification of the foreground portion and the background portion, a first mask; upscaling the first mask to a resolution corresponding to the first image depicting the foreground item; applying the upscaled first mask to the first image to form a second image, the second image depicting the foreground item with at least a portion of the background portion of the second image removed; and providing the second image depicting the foreground item to a publication system; wherein the performing comprises: automatically assigning a first border of pixels with a predefined width around edges of the first level image to initialize the machine learning model to classify the first border of pixels as solid background, wherein the first border of pixels comprises a set quantity of pixels around the edges of the first level image and the set quantity of pixels provides an initial state of the machine learning model to enable classification of one or more pixels of the first level image as solid background, likely background, solid foreground, or likely foreground, and classifying pixels of the first level image as likely the foreground portion or likely the background portion, based on the machine learning model and the assigned first border of pixels as the solid background; and automatically assigning a first border of pixels with a predefined width around edges of the first level image to initialize the machine learning model to classify the first border of pixels as solid background, wherein the first border of pixels comprises a set quantity of pixels around the edges of the first level image and the set quantity of pixels provides an initial state of the machine learning model to enable classification of one or more pixels of the first level image as solid background, likely background, solid foreground, or likely foreground, and classifying pixels of the first level image as likely the foreground portion or likely the background portion, based on the machine learning model and the assigned first border of pixels as the solid background; and wherein the first mask is generated based on the classified pixels.