{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":112509,"databundleVersionId":14254895,"sourceType":"competition"},{"sourceId":14225666,"sourceType":"datasetVersion","datasetId":9075066}],"dockerImageVersionId":31239,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"from PIL import Image","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-01-02T08:21:12.825284Z","iopub.execute_input":"2026-01-02T08:21:12.825600Z","iopub.status.idle":"2026-01-02T08:21:12.830848Z","shell.execute_reply.started":"2026-01-02T08:21:12.825579Z","shell.execute_reply":"2026-01-02T08:21:12.829855Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Image.open('/kaggle/input/grass-analysis/test1_color_distributions.png')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-02T08:21:25.850907Z","iopub.execute_input":"2026-01-02T08:21:25.851247Z","iopub.status.idle":"2026-01-02T08:21:26.220382Z","shell.execute_reply.started":"2026-01-02T08:21:25.851226Z","shell.execute_reply":"2026-01-02T08:21:26.218675Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Color Distributions Overlap Heavily Across Biomass Types\n\nWhen analyzing RGB and HSV distributions for Green, Clover, and Dead biomass:\n\nRed / Green / Blue histograms show significant overlap\n\nHSV Hue peaks cluster tightly for green and clover\n\nSaturation and Value distributions are broad and non-separable\n\n### Key insight\nColor alone cannot reliably distinguish:\n\ngreen grass vs clover\n\ngreen biomass vs high-value brightness effects\n\ndead biomass mixed under green canopy\n\nThis makes any color-threshold or implicit color learning extremely noisy.","metadata":{}},{"cell_type":"code","source":"Image.open('/kaggle/input/grass-analysis/test2_color_mask_correlations.png')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-02T08:23:36.887245Z","iopub.execute_input":"2026-01-02T08:23:36.888326Z","iopub.status.idle":"2026-01-02T08:23:37.069315Z","shell.execute_reply.started":"2026-01-02T08:23:36.888282Z","shell.execute_reply":"2026-01-02T08:23:37.068252Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Weak Correlation Between Color Mask Coverage and Actual Biomass\n\nTested intuitive proxies such as:\n\n% green pixels → green biomass\n\n% brown pixels → dead biomass\n\n% bright green → clover biomass\n\nObserved correlations:\n\nGreen coverage vs green biomass: r ≈ 0.32\n\nBrown coverage vs dead biomass: r ≈ 0.16\n\nBright green vs clover biomass: r ≈ 0.22\n\n### Key Insight\nEven “reasonable” heuristics explain <10% variance.\n\nThis means:\n\nModels can easily overfit color statistics\n\nGeneralization across lighting, angle, and density is poor","metadata":{}},{"cell_type":"code","source":"Image.open('/kaggle/input/grass-analysis/test3_texture_analysis.png')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-02T08:26:44.225249Z","iopub.execute_input":"2026-01-02T08:26:44.225591Z","iopub.status.idle":"2026-01-02T08:26:44.454933Z","shell.execute_reply.started":"2026-01-02T08:26:44.225570Z","shell.execute_reply":"2026-01-02T08:26:44.453754Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Texture Features Are Noisy and Overlapping\n\nExamined texture cues:\n\nPixel variance\n\nEdge density\n\nLocal contrast\n\nOrientation entropy\n\n### Key Insight\n\nDead biomass tends to be slightly more textured\n\nGreen biomass slightly smoother\n\nClover overlaps both\n\nBut the distributions strongly overlap, especially in mixed plots.\n\nTexture is not a clean separating signal.","metadata":{}},{"cell_type":"code","source":"Image.open('/kaggle/input/grass-analysis/test4_feature_clustering.png')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-01-02T08:28:34.001638Z","iopub.execute_input":"2026-01-02T08:28:34.001991Z","iopub.status.idle":"2026-01-02T08:28:34.210535Z","shell.execute_reply.started":"2026-01-02T08:28:34.001966Z","shell.execute_reply":"2026-01-02T08:28:34.209277Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Feature Space (t-SNE) Shows Partial Clustering — Not Separation\n\nUsing deep model embeddings:\n\nSome weak grouping by dominant grass type\n\nLarge overlap between classes\n\nBiomass magnitude varies smoothly within clusters\n\n### Key Insight\nThe model learns visual similarity, not biomass causality.\n\nHigh biomass and low biomass samples often sit close in feature space.","metadata":{}},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}