Non-halogenated flame-retardant Melamine (MEL), an alternative to toxic halogenated flame retardants, has been recognized as a substance of very high concern by the ECHA. Therefore, identifying MEL in plastic waste is essential for ensuring safe handling and recycling. This study presents industrial in-line quantitative identification techniques for MEL in low-density polyethylene (LDPE) and polypropylene (PP) via short-waved infrared (SWIR) hyperspectral imaging combined with machine learning. LDPE and PP samples with varying MEL loadings were compounded and characterized through elemental analysis, ATR-FTIR, TGA, and DSC. Regression on the SWIR band area ratio and principal component one was applied to the SWIR spectra to compile predictive models. The models performed equally well, demonstrating a strong correlation between measured and predicted MEL concentrations. The model based on SWIR band area ratio ranged from 0.8 to 29.8 wt% MEL in LDPE (R