> ## Documentation Index
> Fetch the complete documentation index at: https://felimet-hub.jmcores.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Holstein dairy cow weight prediction with depth sensing

> Biosystems Engineering paper using Intel RealSense D455 depth sensing and Gaussian Process Regression to predict Holstein cow weight across postpartum stages.

export const CiteSwitch = ({bibtex = "", lang = "zh"}) => {
  const t = lang === "en" ? {
    hint: "Switch citation format",
    copy: "Copy",
    copied: "Copied"
  } : {
    hint: "切換引用格式",
    copy: "複製",
    copied: "已複製"
  };
  const [fmt, setFmt] = useState("bibtex");
  const [copied, setCopied] = useState(false);
  const raw = (bibtex || "").trim();
  const field = name => {
    const m = raw.match(new RegExp(name + "\\s*=\\s*[{\"]([^{}\"]*)[}\"]", "i"));
    return m ? m[1].replace(/\s+/g, " ").trim() : "";
  };
  const typeM = raw.match(/@(\w+)/);
  const isConf = typeM ? (/inproceedings|conference/i).test(typeM[1]) : false;
  const title = field("title");
  const journal = field("journal");
  const booktitle = field("booktitle");
  const year = field("year");
  const volume = field("volume");
  const number = field("number");
  const doi = field("doi").replace(/^\s*(https?:\/\/)?(dx\.)?doi\.org\//i, "").replace(/^doi:\s*/i, "").trim();
  const address = field("address");
  const pages = field("pages").replace(/(\d)\s*-+\s*(\d)/g, "$1–$2");
  const splitName = name => {
    const n = name.trim();
    if (n.includes(",")) {
      const p = n.split(",");
      return {
        last: p[0].trim(),
        first: p.slice(1).join(",").trim()
      };
    }
    const p = n.split(/\s+/);
    const last = p.pop();
    return {
      first: p.join(" "),
      last
    };
  };
  const initialsOf = first => {
    const parts = first.split(/[\s-]+/).filter(Boolean);
    const ini = parts.map(p => p[0].toUpperCase() + ".");
    return first.includes("-") ? ini.join("-") : ini.join(" ");
  };
  const names = field("author") ? field("author").split(/\s+and\s+/).map(splitName) : [];
  const joinList = (arr, amp) => {
    if (arr.length <= 1) return arr[0] || "";
    if (arr.length === 2) return arr.join(amp ? ", & " : " and ");
    const sep = amp ? ", & " : ", and ";
    return arr.slice(0, -1).join(", ") + sep.replace(/^, /, ", ") + arr[arr.length - 1];
  };
  const ieeeAuthors = joinList(names.map(n => (initialsOf(n.first) + " " + n.last).trim()), false);
  const apaAuthors = joinList(names.map(n => (n.last + ", " + initialsOf(n.first)).trim()), true);
  const ieeeRest = isConf ? [booktitle && "in " + booktitle, address, year, pages && "pp. " + pages].filter(Boolean).join(", ") : [journal, volume && "vol. " + volume, number && "no. " + number, pages && "pp. " + pages, year, doi && "doi: " + doi].filter(Boolean).join(", ");
  const ieee = `${ieeeAuthors}, "${title}," ${ieeeRest}.`.replace(/\s+/g, " ");
  const apaVol = volume ? volume + (number ? "(" + number + ")" : "") : "";
  const apa = isConf ? `${apaAuthors} (${year}). ${title}. ${booktitle ? "In " + booktitle + (address ? ", " + address : "") : address}.`.replace(/\s+/g, " ") : `${apaAuthors} (${year}). ${title}. ${[journal, apaVol, pages].filter(Boolean).join(", ")}.${doi ? " https://doi.org/" + doi : ""}`.replace(/\s+/g, " ");
  const TABS = [{
    key: "bibtex",
    label: "BibTeX"
  }, {
    key: "ieee",
    label: "IEEE"
  }, {
    key: "apa",
    label: "APA"
  }];
  const current = fmt === "bibtex" ? raw : fmt === "ieee" ? ieee : apa;
  const doCopy = () => {
    try {
      navigator.clipboard.writeText(current);
      setCopied(true);
      setTimeout(() => setCopied(false), 1500);
    } catch (e) {
      setCopied(false);
    }
  };
  const css = `
  .cs-root{--cs-bg:#FAF8F3;--cs-surface:rgba(0,0,0,0.025);--cs-border:rgba(0,0,0,0.09);--cs-text:#2b2722;--cs-dim:#6f6a62;--cs-faint:#8a8378;--cs-accent:#bf7551;--cs-code:rgba(0,0,0,0.04);border:1px solid var(--cs-border);border-radius:14px;background:var(--cs-bg);color:var(--cs-text);overflow:hidden;}
  .dark .cs-root{--cs-bg:#1b1a18;--cs-surface:rgba(255,255,255,0.03);--cs-border:rgba(255,255,255,0.08);--cs-text:#e7e3da;--cs-dim:#a8a299;--cs-faint:#8a8378;--cs-accent:#cf8a68;--cs-code:rgba(255,255,255,0.05);}
  .cs-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--cs-border);flex-wrap:wrap;}
  .cs-head-ic{color:var(--cs-accent);flex-shrink:0;}
  .cs-hint{font-size:12px;color:var(--cs-faint);margin-right:auto;}
  .cs-tab{border:1px solid var(--cs-border);background:transparent;border-radius:8px;padding:5px 12px;cursor:pointer;color:var(--cs-dim);font:inherit;font-size:12.5px;font-weight:600;transition:all .15s;}
  .cs-tab:hover{background:var(--cs-surface);}
  .cs-tab-on{border-color:rgba(191,117,81,.5);background:rgba(191,117,81,.1);color:var(--cs-accent);}
  .cs-body{position:relative;padding:14px 15px;}
  .cs-pre{margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;white-space:pre-wrap;word-break:break-word;color:var(--cs-text);}
  .cs-cite{font-size:13.5px;line-height:1.7;color:var(--cs-text);word-break:break-word;}
  .cs-copy{position:absolute;top:11px;right:12px;display:flex;align-items:center;gap:5px;border:1px solid var(--cs-border);background:var(--cs-bg);border-radius:8px;padding:5px 10px;cursor:pointer;color:var(--cs-dim);font:inherit;font-size:11.5px;font-weight:600;transition:all .15s;}
  .cs-copy:hover{border-color:rgba(191,117,81,.5);color:var(--cs-accent);}
  .cs-copy-ok{color:#5f8a52;border-color:rgba(95,138,82,.4);}
  .dark .cs-copy-ok{color:#86b274;}
  .cs-copy svg{flex-shrink:0;}
  `;
  return <div className="cs-root">
      <style>{css}</style>
      <div className="cs-head">
        <svg className="cs-head-ic" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10 8h8" /><path d="M6 8h.01" /><path d="M6 12h.01" /><path d="M6 16h.01" /><path d="M10 12h8" /><path d="M10 16h4" /><rect width="20" height="18" x="2" y="3" rx="2" /></svg>
        <span className="cs-hint">{t.hint}</span>
        {TABS.map(tab => <button key={tab.key} type="button" className={"cs-tab" + (fmt === tab.key ? " cs-tab-on" : "")} onClick={() => setFmt(tab.key)}>{tab.label}</button>)}
      </div>
      <div className="cs-body">
        <button type="button" className={"cs-copy" + (copied ? " cs-copy-ok" : "")} onClick={doCopy}>
          {copied ? <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><path d="M20 6 9 17l-5-5" /></svg> : <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg>}
          {copied ? t.copied : t.copy}
        </button>
        {fmt === "bibtex" ? <pre className="cs-pre">{raw}</pre> : <div className="cs-cite">{current}</div>}
      </div>
    </div>;
};

export const PubMeta = ({type = "journal", venue, date, confType, doi, url}) => {
  const doiUrl = doi ? doi.startsWith("http") ? doi : `https://doi.org/${doi}` : null;
  const pillBase = {
    display: "inline-block",
    padding: "0.15rem 0.6rem",
    borderRadius: "9999px",
    fontSize: "0.78rem",
    fontWeight: 600,
    lineHeight: 1.6,
    border: "1px solid"
  };
  const tone = {
    type: {
      color: "#8a9a7b",
      borderColor: "rgba(138,154,123,0.4)",
      background: "rgba(138,154,123,0.1)"
    },
    venue: {
      color: "#c9a35b",
      borderColor: "rgba(201,163,91,0.4)",
      background: "rgba(201,163,91,0.1)"
    },
    date: {
      color: "#5b6c8f",
      borderColor: "rgba(91,108,143,0.4)",
      background: "rgba(91,108,143,0.1)"
    },
    link: {
      color: "#bf7551",
      borderColor: "rgba(191,117,81,0.4)",
      background: "rgba(191,117,81,0.1)"
    }
  };
  const typeLabel = type === "conference" ? "Conference" : "Journal";
  return <div style={{
    display: "flex",
    flexWrap: "wrap",
    gap: "0.5rem",
    alignItems: "center",
    marginBottom: "1.5rem"
  }}>
      <span style={{
    ...pillBase,
    ...tone.type
  }}>{typeLabel}</span>
      {venue && <span style={{
    ...pillBase,
    ...tone.venue
  }}>{venue}</span>}
      {date && <span style={{
    ...pillBase,
    ...tone.date
  }}>{date}</span>}
      {confType && <span style={{
    ...pillBase,
    ...tone.type
  }}>{confType}</span>}
      {doiUrl && <a href={doiUrl} target="_blank" rel="noopener noreferrer" style={{
    ...pillBase,
    ...tone.link,
    textDecoration: "none"
  }}>
          DOI ↗
        </a>}
      {url && <a href={url} target="_blank" rel="noopener noreferrer" style={{
    ...pillBase,
    ...tone.link,
    textDecoration: "none"
  }}>
          Link ↗
        </a>}
    </div>;
};

<PubMeta type="journal" venue="Biosystems Engineering" date="2025-09-11" doi="10.1016/j.biosystemseng.2025.104276" url="https://www.sciencedirect.com/science/article/pii/S1537511025002120" />

# Application of weight prediction for Holstein dairy cows in non-pregnant and postpartum stages

## Abstract

A non-contact weight prediction system for Holstein dairy cows was developed based on depth sensing technology, designed to predict weight changes during non-pregnant and postpartum stages. The system utilises an Intel RealSense D455 depth camera to capture depth image information from cow's dorsal, hips, and side regions, extracting effective body surface feature data through a systematic data processing workflow. Experimental results demonstrate that the Gaussian Process Regression (GPR) model performed most excellently in the cow's dorsal region. For example, with cow number cid603 during the non-pregnant period, prediction accuracy reached a root mean square error (RMSE) of 19.37 kg and a mean absolute percentage error (MAPE) of 1.82 %; with cow number cid700 in the postpartum stage, the model maintained an RMSE of 22.35 kg and MAPE of 2.74%, exhibiting robust model generalisation capability. Compared to traditional farm methods based on body length and heart girth measurements, the weight prediction system proposed in this study significantly improved the accuracy and stability of weight prediction, especially in capturing physiological state changes (such as postpartum weight loss). Experimental results indicate that the GPR model exhibited the best predictive ability and generalisation with feature data from the dorsal region, effectively supporting precise monitoring of dairy cow weight. Future research directions should focus on optimising image preprocessing techniques, incorporating more physiological parameters (such as feed intake), and integrating depth information from different angles to enhance the system's adaptability in complex environments, thereby strengthening the universality and reliability of the weight prediction model.

## Keywords

* Postpartum stages
* Body weight prediction
* Health monitoring
* Machine learning

## Highlights

* Depth imaging accurately predicts Holstein cattle weight vs traditional methods.
* Body surface features from depth imagery enable weight prediction modelling.
* Gaussian Process Regression achieves optimal accuracy using dorsal region data.
* GPR model shows high accuracy: non-pregnant (MAPE 1.82 %) & postpartum (MAPE 2.74 %).
* System monitors weight changes during physiological states like postpartum.

***

## Sample Results

<Tabs>
  <Tab title="Overview">
    <p>To develop a robust non-contact image-based body weight prediction system, this study follows the experimental workflow shown below as its core framework, systematically conducting experimental design and data analysis. Depth cameras were used to collect image data of the cows' side, dorsal, and hip regions, and depth information from each region was processed accordingly. The data processing pipeline includes cow identification, missing value imputation, distance filtering, morphological operations, and connected component analysis to obtain more complete depth information of the cow's body surface and effectively remove extraneous depth noise. Subsequently, an image classifier was used to select valid, high-quality images from each region, and a calibration board area was used to establish an area fitting model for each region. Additional features include cow height, pixel counts per region, and the distance between each body region and the camera (mean and median values). Finally, a Feedforward Neural Network (FNN) and a Gaussian Process Regression (GPR) model were employed for weight prediction, and the prediction results were evaluated.</p>

    <img src="https://mintcdn.com/felimet/o4nUK2uwNPSF27VA/images/dairycow_Biosystems_j1_demo1.png?fit=max&auto=format&n=o4nUK2uwNPSF27VA&q=85&s=247f5d93584e632f7e2117cfb70f5b5f" alt="Flow chart of the main experimental items in this study" width="1275" height="632" data-path="images/dairycow_Biosystems_j1_demo1.png" />
  </Tab>

  <Tab title="System setup">
    <p>To ensure effective capture of cow images, this study adjusted the ground distance (D) and angle (θ) for each camera position. The ground distances for the side, dorsal, and hip cameras were D₁ = 212 cm, D₂ = 195.7 cm, and D₃ = 276.8 cm, respectively; the shooting angles were θ₁ = 50°, θ₂ = 90°, and θ₃ = 40°. In addition, the ground distances to the cross-beam beneath the barn eaves and to the eaves themselves were D₄ = 327 cm and D₅ = 382 cm. Using this hardware configuration, the study divided the electronic scale platform dimensions into coordinate points as a quantitative basis for removing the background from depth images and estimating the area features of each cow body region.</p>

    <img src="https://mintcdn.com/felimet/o4nUK2uwNPSF27VA/images/dairycow_Biosystems_j1_demo2.png?fit=max&auto=format&n=o4nUK2uwNPSF27VA&q=85&s=5c8f173f24c6b1ec4917b9bd3e9d9bfa" alt="System setup" width="2296" height="2123" data-path="images/dairycow_Biosystems_j1_demo2.png" />
  </Tab>

  <Tab title="Weight prediction results">
    <p>The figure below compares, for cow cid603 across three body regions (dorsal, hip, and side), the weekly actual body weight (green curve, from electronic scale measurements), FNN model predictions (blue curve), GPR model predictions (cyan curve), and farm-estimated weight (magenta curve, derived from body length and heart girth measurements). During the training phase (weeks 1–9), both FNN and GPR predictions closely followed the actual weight curve, demonstrating good training fit. The test phase (weeks 10–16, highlighted in lavender) was used to evaluate model generalisation performance.</p>
    <p>Results show that during the test phase, both FNN and GPR models exhibited the smallest prediction errors in the dorsal region, with better prediction stability than in the hip and side regions. Notably, the GPR model's predictions in the dorsal region most closely tracked the actual weight trend. Although the GPR model performed slightly below the FNN on the overall training data, it demonstrated superior generalisation on the test dataset for non-pregnant cows. In contrast, the farm-estimated weights derived from body length and heart girth deviated markedly from measured values across all three regions, particularly in the test phase, where the curves showed large fluctuations and high errors, highlighting the limitations of traditional body measurement-based estimation methods.</p>

    <img src="https://mintcdn.com/felimet/o4nUK2uwNPSF27VA/images/dairycow_Biosystems_j1_demo3.jpg?fit=max&auto=format&n=o4nUK2uwNPSF27VA&q=85&s=47422d5305c9c3e991c8b08dba3ff4b7" alt="Weight prediction results" width="2567" height="2291" data-path="images/dairycow_Biosystems_j1_demo3.jpg" />
  </Tab>
</Tabs>

## BibTeX

<CiteSwitch
  lang="en"
  bibtex={`@article{CHIANG2025104276,
title = {Application of weight prediction for Holstein dairy cows in non-pregnant and postpartum stages},
journal = {Biosystems Engineering},
volume = {259},
pages = {104276},
year = {2025},
issn = {1537-5110},
doi = {https://doi.org/10.1016/j.biosystemseng.2025.104276},
author = {Hsin-I Chiang and Jia-Ming Zhou and Wen-Lin Chu}
}`}
/>
